ASN1_OBJECT_free:
  348|    159|{
  349|    159|    if (a == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 159]
  ------------------
  350|      0|        return;
  351|    159|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
  ------------------
  |  |  112|    159|# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
  ------------------
  |  Branch (351:9): [True: 0, False: 159]
  ------------------
  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|    159|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
  ------------------
  |  |  113|    159|# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */
  ------------------
  |  Branch (362:9): [True: 0, False: 159]
  ------------------
  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|    159|    if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
  ------------------
  |  |  110|    159|# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */
  ------------------
  |  Branch (367:9): [True: 0, False: 159]
  ------------------
  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|    159|}

EVP_PKEY_asn1_get_count:
   39|      1|{
   40|      1|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|      1|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   41|      1|    if (app_methods)
  ------------------
  |  Branch (41:9): [True: 0, False: 1]
  ------------------
   42|      0|        num += sk_EVP_PKEY_ASN1_METHOD_num(app_methods);
   43|      1|    return num;
   44|      1|}
EVP_PKEY_asn1_get0:
   47|     15|{
   48|     15|    int num = OSSL_NELEM(standard_methods);
  ------------------
  |  |   14|     15|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
   49|     15|    if (idx < 0)
  ------------------
  |  Branch (49:9): [True: 0, False: 15]
  ------------------
   50|      0|        return NULL;
   51|     15|    if (idx < num)
  ------------------
  |  Branch (51:9): [True: 15, False: 0]
  ------------------
   52|     15|        return standard_methods[idx];
   53|      0|    idx -= num;
   54|      0|    return sk_EVP_PKEY_ASN1_METHOD_value(app_methods, idx);
   55|     15|}
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|}

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|}

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|}

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_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_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|  1.38k|{
  946|  1.38k|    size_t retlen;
  947|  1.38k|    int truncated;
  948|       |
  949|  1.38k|    if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
  ------------------
  |  Branch (949:9): [True: 0, False: 1.38k]
  ------------------
  950|      0|        return -1;
  951|       |
  952|  1.38k|    if (truncated)
  ------------------
  |  Branch (952:9): [True: 0, False: 1.38k]
  ------------------
  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|  1.38k|    return (retlen <= INT_MAX) ? (int)retlen : -1;
  ------------------
  |  Branch (960:12): [True: 1.38k, False: 0]
  ------------------
  961|  1.38k|}
bio_print.c:_dopr:
   91|  1.38k|{
   92|  1.38k|    char ch;
   93|  1.38k|    int64_t value;
   94|  1.38k|#ifndef OPENSSL_SYS_UEFI
   95|  1.38k|    LDOUBLE fvalue;
  ------------------
  |  |   28|  1.38k|# define LDOUBLE double
  ------------------
   96|  1.38k|#endif
   97|  1.38k|    char *strvalue;
   98|  1.38k|    int min;
   99|  1.38k|    int max;
  100|  1.38k|    int state;
  101|  1.38k|    int flags;
  102|  1.38k|    int cflags;
  103|  1.38k|    size_t currlen;
  104|       |
  105|  1.38k|    state = DP_S_DEFAULT;
  ------------------
  |  |   45|  1.38k|#define DP_S_DEFAULT    0
  ------------------
  106|  1.38k|    flags = currlen = cflags = min = 0;
  107|  1.38k|    max = -1;
  108|  1.38k|    ch = *format++;
  109|       |
  110|  12.5k|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|  12.5k|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 11.1k, False: 1.38k]
  ------------------
  111|  11.1k|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 1.38k, False: 9.76k]
  |  Branch (111:28): [True: 9.76k, False: 0]
  |  Branch (111:46): [True: 0, False: 9.76k]
  ------------------
  112|  1.38k|            state = DP_S_DONE;
  ------------------
  |  |   52|  1.38k|#define DP_S_DONE       7
  ------------------
  113|       |
  114|  11.1k|        switch (state) {
  115|  2.80k|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  2.80k|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 2.80k, False: 8.34k]
  ------------------
  116|  2.80k|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 1.39k, False: 1.41k]
  ------------------
  117|  1.39k|                state = DP_S_FLAGS;
  ------------------
  |  |   46|  1.39k|#define DP_S_FLAGS      1
  ------------------
  118|  1.41k|            else
  119|  1.41k|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 1.41k]
  ------------------
  120|      0|                    return 0;
  121|  2.80k|            ch = *format++;
  122|  2.80k|            break;
  123|  1.39k|        case DP_S_FLAGS:
  ------------------
  |  |   46|  1.39k|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 1.39k, False: 9.75k]
  ------------------
  124|  1.39k|            switch (ch) {
  125|      0|            case '-':
  ------------------
  |  Branch (125:13): [True: 0, False: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  142|      0|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|      0|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|      0|                ch = *format++;
  144|      0|                break;
  145|  1.39k|            default:
  ------------------
  |  Branch (145:13): [True: 1.39k, False: 0]
  ------------------
  146|  1.39k|                state = DP_S_MIN;
  ------------------
  |  |   47|  1.39k|#define DP_S_MIN        2
  ------------------
  147|  1.39k|                break;
  148|  1.39k|            }
  149|  1.39k|            break;
  150|  1.39k|        case DP_S_MIN:
  ------------------
  |  |   47|  1.39k|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 1.39k, False: 9.75k]
  ------------------
  151|  1.39k|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 1.39k]
  ------------------
  152|      0|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  153|      0|                ch = *format++;
  154|  1.39k|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 0, False: 1.39k]
  ------------------
  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|  1.39k|                state = DP_S_DOT;
  ------------------
  |  |   48|  1.39k|#define DP_S_DOT        3
  ------------------
  160|  1.39k|            break;
  161|  1.39k|        case DP_S_DOT:
  ------------------
  |  |   48|  1.39k|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 1.39k, False: 9.75k]
  ------------------
  162|  1.39k|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 0, False: 1.39k]
  ------------------
  163|      0|                state = DP_S_MAX;
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  164|      0|                ch = *format++;
  165|      0|            } else
  166|  1.39k|                state = DP_S_MOD;
  ------------------
  |  |   50|  1.39k|#define DP_S_MOD        5
  ------------------
  167|  1.39k|            break;
  168|      0|        case DP_S_MAX:
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 0, False: 11.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|  1.39k|        case DP_S_MOD:
  ------------------
  |  |   50|  1.39k|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 1.39k, False: 9.75k]
  ------------------
  182|  1.39k|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 1.39k]
  ------------------
  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: 10]
  ------------------
  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: 1.39k]
  ------------------
  196|      0|            case 'j':
  ------------------
  |  Branch (196:13): [True: 0, False: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|     10|            default:
  ------------------
  |  Branch (208:13): [True: 10, False: 1.38k]
  ------------------
  209|     10|                break;
  210|  1.39k|            }
  211|  1.39k|            state = DP_S_CONV;
  ------------------
  |  |   51|  1.39k|#define DP_S_CONV       6
  ------------------
  212|  1.39k|            break;
  213|  1.39k|        case DP_S_CONV:
  ------------------
  |  |   51|  1.39k|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 1.39k, False: 9.75k]
  ------------------
  214|  1.39k|            switch (ch) {
  215|      0|            case 'd':
  ------------------
  |  Branch (215:13): [True: 0, False: 1.39k]
  ------------------
  216|      0|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 1.39k]
  ------------------
  217|      0|                switch (cflags) {
  218|      0|                case DP_C_SHORT:
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  |  Branch (218:17): [True: 0, False: 0]
  ------------------
  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: 0]
  ------------------
  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: 0]
  ------------------
  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: 0]
  ------------------
  228|      0|                    value = va_arg(args, ossl_ssize_t);
  229|      0|                    break;
  230|      0|                default:
  ------------------
  |  Branch (230:17): [True: 0, False: 0]
  ------------------
  231|      0|                    value = va_arg(args, int);
  232|      0|                    break;
  233|      0|                }
  234|      0|                if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min,
  ------------------
  |  Branch (234:21): [True: 0, False: 0]
  ------------------
  235|      0|                            max, flags))
  236|      0|                    return 0;
  237|      0|                break;
  238|      0|            case 'X':
  ------------------
  |  Branch (238:13): [True: 0, False: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  242|      0|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 1.39k]
  ------------------
  243|  1.38k|            case 'u':
  ------------------
  |  Branch (243:13): [True: 1.38k, False: 10]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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|     10|            case 's':
  ------------------
  |  Branch (316:13): [True: 10, False: 1.38k]
  ------------------
  317|     10|                strvalue = va_arg(args, char *);
  318|     10|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 10, False: 0]
  ------------------
  319|     10|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 0, False: 10]
  ------------------
  320|      0|                        max = INT_MAX;
  321|     10|                    else
  322|     10|                        max = *maxlen;
  323|     10|                }
  324|     10|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 10]
  ------------------
  325|     10|                            flags, min, max))
  326|      0|                    return 0;
  327|     10|                break;
  328|     10|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  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: 1.39k]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 1.39k]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|  1.39k|            }
  353|  1.39k|            ch = *format++;
  354|  1.39k|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|  1.39k|#define DP_S_DEFAULT    0
  ------------------
  355|  1.39k|            flags = cflags = min = 0;
  356|  1.39k|            max = -1;
  357|  1.39k|            break;
  358|  1.38k|        case DP_S_DONE:
  ------------------
  |  |   52|  1.38k|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 1.38k, False: 9.76k]
  ------------------
  359|  1.38k|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 11.1k]
  ------------------
  361|      0|            break;
  362|  11.1k|        }
  363|  11.1k|    }
  364|       |    /*
  365|       |     * We have to truncate if there is no dynamic buffer and we have filled the
  366|       |     * static buffer.
  367|       |     */
  368|  1.38k|    if (buffer == NULL) {
  ------------------
  |  Branch (368:9): [True: 1.38k, False: 0]
  ------------------
  369|  1.38k|        *truncated = (currlen > *maxlen - 1);
  370|  1.38k|        if (*truncated)
  ------------------
  |  Branch (370:13): [True: 0, False: 1.38k]
  ------------------
  371|      0|            currlen = *maxlen - 1;
  372|  1.38k|    }
  373|  1.38k|    if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'))
  ------------------
  |  Branch (373:9): [True: 0, False: 1.38k]
  ------------------
  374|      0|        return 0;
  375|  1.38k|    *retlen = currlen - 1;
  376|  1.38k|    return 1;
  377|  1.38k|}
bio_print.c:doapr_outch:
  840|  5.42k|{
  841|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  842|  5.42k|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   52|  5.42k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 5.42k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  5.42k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (842:9): [True: 0, False: 5.42k]
  ------------------
  843|      0|        return 0;
  844|       |
  845|       |    /* |currlen| must always be <= |*maxlen| */
  846|  5.42k|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   52|  5.42k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  5.42k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (846:9): [True: 0, False: 5.42k]
  ------------------
  847|      0|        return 0;
  848|       |
  849|  5.42k|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (849:9): [True: 0, False: 5.42k]
  |  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|  5.42k|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (873:9): [True: 5.42k, False: 0]
  ------------------
  874|  5.42k|        if (*sbuffer)
  ------------------
  |  Branch (874:13): [True: 5.42k, False: 0]
  ------------------
  875|  5.42k|            (*sbuffer)[(*currlen)++] = (char)c;
  876|      0|        else
  877|      0|            (*buffer)[(*currlen)++] = (char)c;
  878|  5.42k|    }
  879|       |
  880|  5.42k|    return 1;
  881|  5.42k|}
bio_print.c:fmtint:
  436|  1.38k|{
  437|  1.38k|    int signvalue = 0;
  438|  1.38k|    const char *prefix = "";
  439|  1.38k|    uint64_t uvalue;
  440|  1.38k|    char convert[DECIMAL_SIZE(value) + 3];
  441|  1.38k|    int place = 0;
  442|  1.38k|    int spadlen = 0;
  443|  1.38k|    int zpadlen = 0;
  444|  1.38k|    int caps = 0;
  445|       |
  446|  1.38k|    if (max < 0)
  ------------------
  |  Branch (446:9): [True: 1.38k, False: 0]
  ------------------
  447|  1.38k|        max = 0;
  448|  1.38k|    uvalue = value;
  449|  1.38k|    if (!(flags & DP_F_UNSIGNED)) {
  ------------------
  |  |   68|  1.38k|#define DP_F_UNSIGNED   (1 << 6)
  ------------------
  |  Branch (449:9): [True: 0, False: 1.38k]
  ------------------
  450|      0|        if (value < 0) {
  ------------------
  |  Branch (450:13): [True: 0, False: 0]
  ------------------
  451|      0|            signvalue = '-';
  452|      0|            uvalue = 0 - (uint64_t)value;
  453|      0|        } else if (flags & DP_F_PLUS)
  ------------------
  |  |   58|      0|#define DP_F_PLUS       (1 << 1)
  ------------------
  |  Branch (453:20): [True: 0, False: 0]
  ------------------
  454|      0|            signvalue = '+';
  455|      0|        else if (flags & DP_F_SPACE)
  ------------------
  |  |   60|      0|#define DP_F_SPACE      (1 << 2)
  ------------------
  |  Branch (455:18): [True: 0, False: 0]
  ------------------
  456|      0|            signvalue = ' ';
  457|      0|    }
  458|  1.38k|    if (flags & DP_F_NUM) {
  ------------------
  |  |   62|  1.38k|#define DP_F_NUM        (1 << 3)
  ------------------
  |  Branch (458:9): [True: 0, False: 1.38k]
  ------------------
  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|  1.38k|    if (flags & DP_F_UP)
  ------------------
  |  |   66|  1.38k|#define DP_F_UP         (1 << 5)
  ------------------
  |  Branch (464:9): [True: 0, False: 1.38k]
  ------------------
  465|      0|        caps = 1;
  466|  2.51k|    do {
  467|  2.51k|        convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef")
  ------------------
  |  Branch (467:29): [True: 0, False: 2.51k]
  ------------------
  468|  2.51k|            [uvalue % (unsigned)base];
  469|  2.51k|        uvalue = (uvalue / (unsigned)base);
  470|  2.51k|    } while (uvalue && (place < (int)sizeof(convert)));
  ------------------
  |  Branch (470:14): [True: 1.13k, False: 1.38k]
  |  Branch (470:24): [True: 1.13k, False: 0]
  ------------------
  471|  1.38k|    if (place == sizeof(convert))
  ------------------
  |  Branch (471:9): [True: 0, False: 1.38k]
  ------------------
  472|      0|        place--;
  473|  1.38k|    convert[place] = 0;
  474|       |
  475|  1.38k|    zpadlen = max - place;
  476|  1.38k|    spadlen =
  477|  1.38k|        min - OSSL_MAX(max, place) - (signvalue ? 1 : 0) - strlen(prefix);
  ------------------
  |  |   84|  1.38k|#define OSSL_MAX(p,q) ((p >= q) ? p : q)
  |  |  ------------------
  |  |  |  Branch (84:24): [True: 0, False: 1.38k]
  |  |  ------------------
  ------------------
  |  Branch (477:39): [True: 0, False: 1.38k]
  ------------------
  478|  1.38k|    if (zpadlen < 0)
  ------------------
  |  Branch (478:9): [True: 1.38k, False: 0]
  ------------------
  479|  1.38k|        zpadlen = 0;
  480|  1.38k|    if (spadlen < 0)
  ------------------
  |  Branch (480:9): [True: 1.38k, False: 0]
  ------------------
  481|  1.38k|        spadlen = 0;
  482|  1.38k|    if (flags & DP_F_ZERO) {
  ------------------
  |  |   64|  1.38k|#define DP_F_ZERO       (1 << 4)
  ------------------
  |  Branch (482:9): [True: 0, False: 1.38k]
  ------------------
  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|  1.38k|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|  1.38k|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (486:9): [True: 0, False: 1.38k]
  ------------------
  487|      0|        spadlen = -spadlen;
  488|       |
  489|       |    /* spaces */
  490|  1.38k|    while (spadlen > 0) {
  ------------------
  |  Branch (490:12): [True: 0, False: 1.38k]
  ------------------
  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|  1.38k|    if (signvalue)
  ------------------
  |  Branch (497:9): [True: 0, False: 1.38k]
  ------------------
  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|  1.38k|    while (*prefix) {
  ------------------
  |  Branch (502:12): [True: 0, False: 1.38k]
  ------------------
  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|  1.38k|    if (zpadlen > 0) {
  ------------------
  |  Branch (509:9): [True: 0, False: 1.38k]
  ------------------
  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|  3.89k|    while (place > 0) {
  ------------------
  |  Branch (517:12): [True: 2.51k, False: 1.38k]
  ------------------
  518|  2.51k|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]))
  ------------------
  |  Branch (518:13): [True: 0, False: 2.51k]
  ------------------
  519|      0|            return 0;
  520|  2.51k|    }
  521|       |
  522|       |    /* left justified spaces */
  523|  1.38k|    while (spadlen < 0) {
  ------------------
  |  Branch (523:12): [True: 0, False: 1.38k]
  ------------------
  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|  1.38k|    return 1;
  529|  1.38k|}
bio_print.c:fmtstr:
  384|     10|{
  385|     10|    int padlen;
  386|     10|    size_t strln;
  387|     10|    int cnt = 0;
  388|       |
  389|     10|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 0, False: 10]
  ------------------
  390|      0|        value = "<NULL>";
  391|       |
  392|     10|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 10]
  ------------------
  393|       |
  394|     10|    padlen = min - strln;
  395|     10|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 10]
  |  Branch (395:20): [True: 10, False: 0]
  ------------------
  396|     10|        padlen = 0;
  397|     10|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 10, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|     10|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 10, False: 0]
  ------------------
  403|     10|            max += padlen;
  404|      0|        else
  405|      0|            max = INT_MAX;
  406|     10|    }
  407|     10|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|     10|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 0, False: 10]
  ------------------
  408|      0|        padlen = -padlen;
  409|       |
  410|     10|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 0, False: 10]
  |  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|    118|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 108, False: 10]
  |  Branch (416:26): [True: 0, False: 108]
  |  Branch (416:37): [True: 108, False: 0]
  ------------------
  417|    108|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 108]
  ------------------
  418|      0|            return 0;
  419|    108|        --strln;
  420|    108|        ++cnt;
  421|    108|    }
  422|     10|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 0, False: 10]
  |  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|     10|    return 1;
  429|     10|}

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_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|    209|{
  228|    209|    if (a == NULL)
  ------------------
  |  Branch (228:9): [True: 209, False: 0]
  ------------------
  229|    209|        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_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_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|}

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|    136|{
   68|    136|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 136]
  ------------------
   69|      0|        return 0;
   70|    136|    return CRYPTO_THREAD_read_lock(ctx->lock);
   71|    136|}
ossl_lib_ctx_unlock:
   74|    138|{
   75|    138|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 138]
  ------------------
   76|      0|        return 0;
   77|    138|    return CRYPTO_THREAD_unlock(ctx->lock);
   78|    138|}
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_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|  4.53k|{
  544|  4.53k|#ifndef FIPS_MODULE
  545|  4.53k|    if (ctx == NULL)
  ------------------
  |  Branch (545:9): [True: 3.79k, False: 737]
  ------------------
  546|  3.79k|        return get_default_context();
  547|    737|#endif
  548|    737|    return ctx;
  549|  4.53k|}
ossl_lib_ctx_is_default:
  552|      8|{
  553|      8|#ifndef FIPS_MODULE
  554|      8|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (554:9): [True: 5, False: 3]
  |  Branch (554:24): [True: 3, False: 0]
  ------------------
  555|      8|        return 1;
  556|      0|#endif
  557|      0|    return 0;
  558|      8|}
ossl_lib_ctx_get_data:
  570|  4.23k|{
  571|  4.23k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  572|  4.23k|    if (ctx == NULL)
  ------------------
  |  Branch (572:9): [True: 0, False: 4.23k]
  ------------------
  573|      0|        return NULL;
  574|       |
  575|  4.23k|    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: 4.20k]
  ------------------
  577|     36|        return ctx->property_string_data;
  578|  1.31k|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   98|  1.31k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (578:5): [True: 1.31k, False: 2.92k]
  ------------------
  579|  1.31k|        return ctx->evp_method_store;
  580|     19|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   99|     19|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (580:5): [True: 19, False: 4.22k]
  ------------------
  581|     19|        return ctx->provider_store;
  582|  1.56k|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  102|  1.56k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (582:5): [True: 1.56k, False: 2.67k]
  ------------------
  583|  1.56k|        return ctx->namemap;
  584|    138|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |  100|    138|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (584:5): [True: 138, False: 4.10k]
  ------------------
  585|    138|        return ctx->property_defns;
  586|      3|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  114|      3|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (586:5): [True: 3, False: 4.23k]
  ------------------
  587|      3|        return ctx->global_properties;
  588|  1.16k|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  103|  1.16k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (588:5): [True: 1.16k, False: 3.07k]
  ------------------
  589|  1.16k|        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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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: 4.23k]
  ------------------
  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|      2|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  121|      2|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
  |  Branch (625:5): [True: 2, False: 4.23k]
  ------------------
  626|      2|        return (void *)&ctx->comp_methods;
  627|       |
  628|      0|    default:
  ------------------
  |  Branch (628:5): [True: 0, False: 4.23k]
  ------------------
  629|      0|        return NULL;
  630|  4.23k|    }
  631|  4.23k|}
OSSL_LIB_CTX_get_data:
  634|      2|{
  635|      2|    return ossl_lib_ctx_get_data(ctx, index);
  636|      2|}
ossl_lib_ctx_get_ex_data_global:
  639|      6|{
  640|      6|    ctx = ossl_lib_ctx_get_concrete(ctx);
  641|      6|    if (ctx == NULL)
  ------------------
  |  Branch (641:9): [True: 0, False: 6]
  ------------------
  642|      0|        return NULL;
  643|      6|    return &ctx->global;
  644|      6|}
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|  3.79k|{
  430|  3.79k|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  431|       |
  432|  3.79k|    if (current_defctx == NULL && default_context_inited)
  ------------------
  |  Branch (432:9): [True: 3.79k, False: 0]
  |  Branch (432:35): [True: 3.79k, False: 0]
  ------------------
  433|  3.79k|        current_defctx = &default_context_int;
  434|  3.79k|    return current_defctx;
  435|  3.79k|}
context.c:get_thread_default_context:
  421|  3.79k|{
  422|  3.79k|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  3.79k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3.79k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (422:9): [True: 0, False: 3.79k]
  ------------------
  423|      0|        return NULL;
  424|       |
  425|  3.79k|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  426|  3.79k|}

ossl_algorithm_do_all:
  149|      3|{
  150|      3|    struct algorithm_data_st cbdata = { 0, };
  151|       |
  152|      3|    cbdata.libctx = libctx;
  153|      3|    cbdata.operation_id = operation_id;
  154|      3|    cbdata.pre = pre;
  155|      3|    cbdata.reserve_store = reserve_store;
  156|      3|    cbdata.fn = fn;
  157|      3|    cbdata.unreserve_store = unreserve_store;
  158|      3|    cbdata.post = post;
  159|      3|    cbdata.data = data;
  160|       |
  161|      3|    if (provider == NULL) {
  ------------------
  |  Branch (161:9): [True: 3, False: 0]
  ------------------
  162|      3|        ossl_provider_doall_activated(libctx, algorithm_do_this, &cbdata);
  163|      3|    } 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|      3|}
ossl_algorithm_get1_first_name:
  181|    136|{
  182|    136|    const char *first_name_end = NULL;
  183|    136|    size_t first_name_len = 0;
  184|    136|    char *ret;
  185|       |
  186|    136|    if (algo->algorithm_names == NULL)
  ------------------
  |  Branch (186:9): [True: 0, False: 136]
  ------------------
  187|      0|        return NULL;
  188|       |
  189|    136|    first_name_end = strchr(algo->algorithm_names, ':');
  190|    136|    if (first_name_end == NULL)
  ------------------
  |  Branch (190:9): [True: 56, False: 80]
  ------------------
  191|     56|        first_name_len = strlen(algo->algorithm_names);
  192|     80|    else
  193|     80|        first_name_len = first_name_end - algo->algorithm_names;
  194|       |
  195|    136|    ret = OPENSSL_strndup(algo->algorithm_names, first_name_len);
  ------------------
  |  |  121|    136|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    136|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    136|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  196|    136|    return ret;
  197|    136|}
core_algorithm.c:algorithm_do_this:
  103|      6|{
  104|      6|    struct algorithm_data_st *data = cbdata;
  105|      6|    int first_operation = 1;
  106|      6|    int last_operation = OSSL_OP__HIGHEST;
  ------------------
  |  |  326|      6|# define OSSL_OP__HIGHEST                           22
  ------------------
  107|      6|    int cur_operation;
  108|      6|    int ok = 1;
  109|       |
  110|      6|    if (data->operation_id != 0)
  ------------------
  |  Branch (110:9): [True: 6, False: 0]
  ------------------
  111|      6|        first_operation = last_operation = data->operation_id;
  112|       |
  113|      6|    for (cur_operation = first_operation;
  114|     12|         cur_operation <= last_operation;
  ------------------
  |  Branch (114:10): [True: 6, False: 6]
  ------------------
  115|      6|         cur_operation++) {
  116|      6|        int no_store = 0;        /* Assume caching is ok */
  117|      6|        const OSSL_ALGORITHM *map = NULL;
  118|      6|        int ret = 0;
  119|       |
  120|      6|        map = ossl_provider_query_operation(provider, cur_operation,
  121|      6|                                            &no_store);
  122|      6|        ret = algorithm_do_map(provider, map, cur_operation, no_store, data);
  123|      6|        ossl_provider_unquery_operation(provider, cur_operation, map);
  124|       |
  125|      6|        if (ret < 0)
  ------------------
  |  Branch (125:13): [True: 0, False: 6]
  ------------------
  126|       |            /* Hard error, bail out immediately! */
  127|      0|            return 0;
  128|       |
  129|       |        /* If post-condition not fulfilled, set general failure */
  130|      6|        if (!ret)
  ------------------
  |  Branch (130:13): [True: 0, False: 6]
  ------------------
  131|      0|            ok = 0;
  132|      6|    }
  133|       |
  134|      6|    return ok;
  135|      6|}
core_algorithm.c:algorithm_do_map:
   44|      6|{
   45|      6|    struct algorithm_data_st *data = cbdata;
   46|      6|    int ret = 0;
   47|       |
   48|      6|    if (!data->reserve_store(no_store, data->data))
  ------------------
  |  Branch (48:9): [True: 0, False: 6]
  ------------------
   49|       |        /* Error, bail out! */
   50|      0|        return -1;
   51|       |
   52|       |    /* Do we fulfill pre-conditions? */
   53|      6|    if (data->pre == NULL) {
  ------------------
  |  Branch (53:9): [True: 0, False: 6]
  ------------------
   54|       |        /* If there is no pre-condition function, assume "yes" */
   55|      0|        ret = 1;
   56|      6|    } else if (!data->pre(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (56:16): [True: 0, False: 6]
  ------------------
   57|      6|                          &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|      6|    if (ret == 0) {
  ------------------
  |  Branch (68:9): [True: 2, False: 4]
  ------------------
   69|      2|        ret = 1;
   70|      2|        goto end;
   71|      2|    }
   72|       |
   73|      4|    if (map != NULL) {
  ------------------
  |  Branch (73:9): [True: 3, False: 1]
  ------------------
   74|      3|        const OSSL_ALGORITHM *thismap;
   75|       |
   76|    139|        for (thismap = map; thismap->algorithm_names != NULL; thismap++)
  ------------------
  |  Branch (76:29): [True: 136, False: 3]
  ------------------
   77|    136|            data->fn(provider, thismap, no_store, data->data);
   78|      3|    }
   79|       |
   80|       |    /* Do we fulfill post-conditions? */
   81|      4|    if (data->post == NULL) {
  ------------------
  |  Branch (81:9): [True: 0, False: 4]
  ------------------
   82|       |        /* If there is no post-condition function, assume "yes" */
   83|      0|        ret = 1;
   84|      4|    } else if (!data->post(provider, cur_operation, no_store, data->data,
  ------------------
  |  Branch (84:16): [True: 0, False: 4]
  ------------------
   85|      4|                           &ret)) {
   86|       |        /* Error, bail out! */
   87|      0|        ret = -1;
   88|      0|    }
   89|       |
   90|      6| end:
   91|      6|    data->unreserve_store(data->data);
   92|       |
   93|      6|    return ret;
   94|      4|}

ossl_method_construct:
  137|      3|{
  138|      3|    void *method = NULL;
  139|      3|    OSSL_PROVIDER *provider = provider_rw != NULL ? *provider_rw : NULL;
  ------------------
  |  Branch (139:31): [True: 3, False: 0]
  ------------------
  140|      3|    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|      3|    cbdata.store = NULL;
  154|      3|    cbdata.force_store = force_store;
  155|      3|    cbdata.mcm = mcm;
  156|      3|    cbdata.mcm_data = mcm_data;
  157|      3|    ossl_algorithm_do_all(libctx, operation_id, provider,
  158|      3|                          ossl_method_construct_precondition,
  159|      3|                          ossl_method_construct_reserve_store,
  160|      3|                          ossl_method_construct_this,
  161|      3|                          ossl_method_construct_unreserve_store,
  162|      3|                          ossl_method_construct_postcondition,
  163|      3|                          &cbdata);
  164|       |
  165|       |    /* If there is a temporary store, try there first */
  166|      3|    if (cbdata.store != NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (method == NULL)
  ------------------
  |  Branch (171:9): [True: 3, False: 0]
  ------------------
  172|      3|        method = mcm->get(NULL, (const OSSL_PROVIDER **)provider_rw, mcm_data);
  173|       |
  174|      3|    return method;
  175|      3|}
core_fetch.c:ossl_method_construct_precondition:
   63|      6|{
   64|      6|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|      6|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      6|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (64:9): [True: 0, False: 6]
  ------------------
   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|      6|    *result = 0;
   71|       |
   72|       |    /* No flag bits for temporary stores */
   73|      6|    if (!is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (73:9): [True: 6, False: 0]
  ------------------
   74|      6|        && !ossl_provider_test_operation_bit(provider, operation_id, result))
  ------------------
  |  Branch (74:12): [True: 0, False: 6]
  ------------------
   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|      6|    *result = !*result;
   83|       |
   84|      6|    return 1;
   85|      6|}
core_fetch.c:is_temporary_method_store:
   29|     16|{
   30|     16|    struct construct_data_st *data = cbdata;
   31|       |
   32|     16|    return no_store && !data->force_store;
  ------------------
  |  Branch (32:12): [True: 0, False: 16]
  |  Branch (32:24): [True: 0, False: 0]
  ------------------
   33|     16|}
core_fetch.c:ossl_method_construct_reserve_store:
   36|      6|{
   37|      6|    struct construct_data_st *data = cbdata;
   38|       |
   39|      6|    if (is_temporary_method_store(no_store, data) && data->store == NULL) {
  ------------------
  |  Branch (39:9): [True: 0, False: 6]
  |  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|      6|    return data->mcm->lock_store(data->store, data->mcm_data);
   51|      6|}
core_fetch.c:ossl_method_construct_this:
  106|    136|{
  107|    136|    struct construct_data_st *data = cbdata;
  108|    136|    void *method = NULL;
  109|       |
  110|    136|    if ((method = data->mcm->construct(algo, provider, data->mcm_data))
  ------------------
  |  Branch (110:9): [True: 0, False: 136]
  ------------------
  111|    136|        == NULL)
  112|      0|        return;
  113|       |
  114|    136|    OSSL_TRACE2(QUERY,
  ------------------
  |  |  293|    136|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    136|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  115|    136|                "ossl_method_construct_this: putting an algo to the store %p with no_store %d\n",
  116|    136|                (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|    136|    data->mcm->put(no_store ? data->store : NULL, method, provider, algo->algorithm_names,
  ------------------
  |  Branch (127:20): [True: 0, False: 136]
  ------------------
  128|    136|                   algo->property_definition, data->mcm_data);
  129|       |
  130|       |    /* refcnt-- because we're dropping the reference */
  131|    136|    data->mcm->destruct(method, data->mcm_data);
  132|    136|}
core_fetch.c:ossl_method_construct_unreserve_store:
   54|      6|{
   55|      6|    struct construct_data_st *data = cbdata;
   56|       |
   57|      6|    return data->mcm->unlock_store(data->store, data->mcm_data);
   58|      6|}
core_fetch.c:ossl_method_construct_postcondition:
   90|      4|{
   91|      4|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|      4|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      4|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (91:9): [True: 0, False: 4]
  ------------------
   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|      4|    *result = 1;
   97|       |
   98|       |    /* No flag bits for temporary stores */
   99|      4|    return is_temporary_method_store(no_store, cbdata)
  ------------------
  |  Branch (99:12): [True: 0, False: 4]
  ------------------
  100|      4|        || ossl_provider_set_operation_bit(provider, operation_id);
  ------------------
  |  Branch (100:12): [True: 4, False: 0]
  ------------------
  101|      4|}

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|  1.56k|{
   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|  1.56k|    return namemap == NULL || tsan_load(&namemap->max_number) == 0;
  ------------------
  |  |   61|  1.56k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (97:12): [True: 0, False: 1.56k]
  |  Branch (97:31): [True: 1, False: 1.55k]
  ------------------
   98|  1.56k|#endif
   99|  1.56k|}
ossl_namemap_doall_names:
  109|    130|{
  110|    130|    int i;
  111|    130|    NAMES *names;
  112|       |
  113|    130|    if (namemap == NULL || number <= 0)
  ------------------
  |  Branch (113:9): [True: 0, False: 130]
  |  Branch (113:28): [True: 0, False: 130]
  ------------------
  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|    130|    if (!CRYPTO_THREAD_read_lock(namemap->lock))
  ------------------
  |  Branch (121:9): [True: 0, False: 130]
  ------------------
  122|      0|        return 0;
  123|       |
  124|    130|    names = sk_NAMES_value(namemap->numnames, number - 1);
  125|    130|    if (names != NULL)
  ------------------
  |  Branch (125:9): [True: 130, False: 0]
  ------------------
  126|    130|        names = sk_OPENSSL_STRING_dup(names);
  ------------------
  |  |  251|    130|#define sk_OPENSSL_STRING_dup(sk) ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_dup(ossl_check_const_OPENSSL_STRING_sk_type(sk)))
  ------------------
  127|       |
  128|    130|    CRYPTO_THREAD_unlock(namemap->lock);
  129|       |
  130|    130|    if (names == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 130]
  ------------------
  131|      0|        return 0;
  132|       |
  133|    373|    for (i = 0; i < sk_OPENSSL_STRING_num(names); i++)
  ------------------
  |  |  229|    373|#define sk_OPENSSL_STRING_num(sk) OPENSSL_sk_num(ossl_check_const_OPENSSL_STRING_sk_type(sk))
  ------------------
  |  Branch (133:17): [True: 243, False: 130]
  ------------------
  134|    243|        fn(sk_OPENSSL_STRING_value(names, i), data);
  ------------------
  |  |  230|    243|#define sk_OPENSSL_STRING_value(sk, idx) ((char *)OPENSSL_sk_value(ossl_check_const_OPENSSL_STRING_sk_type(sk), (idx)))
  ------------------
  135|       |
  136|    130|    sk_OPENSSL_STRING_free(names);
  ------------------
  |  |  235|    130|#define sk_OPENSSL_STRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_STRING_sk_type(sk))
  ------------------
  137|    130|    return i > 0;
  138|    130|}
ossl_namemap_name2num:
  141|  2.30k|{
  142|  2.30k|    int number = 0;
  143|  2.30k|    HT_VALUE *val;
  144|  2.30k|    NAMENUM_KEY key;
  145|       |
  146|  2.30k|#ifndef FIPS_MODULE
  147|  2.30k|    if (namemap == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 2.30k]
  ------------------
  148|      0|        namemap = ossl_namemap_stored(NULL);
  149|  2.30k|#endif
  150|       |
  151|  2.30k|    if (namemap == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 2.30k]
  ------------------
  152|      0|        return 0;
  153|       |
  154|  2.30k|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|  2.30k|#define HT_INIT_KEY(key) do { \
  |  |  108|  2.30k|memset((key), 0, sizeof(*(key))); \
  |  |  109|  2.30k|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|  2.30k|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|  2.30k|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  155|  2.30k|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  138|  2.30k|#define HT_SET_KEY_STRING_CASE(key, member, value) do { \
  |  |  139|  2.30k|   ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) -1); \
  |  |  140|  2.30k|} while(0)
  |  |  ------------------
  |  |  |  Branch (140:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  156|       |
  157|  2.30k|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  173|  2.30k|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  158|       |
  159|  2.30k|    if (val != NULL)
  ------------------
  |  Branch (159:9): [True: 1.83k, False: 466]
  ------------------
  160|       |        /* We store a (small) int directly instead of a pointer to it. */
  161|  1.83k|        number = (int)(intptr_t)val->value;
  162|       |
  163|  2.30k|    return number;
  164|  2.30k|}
ossl_namemap_name2num_n:
  168|    137|{
  169|    137|    int number = 0;
  170|    137|    HT_VALUE *val;
  171|    137|    NAMENUM_KEY key;
  172|       |
  173|    137|#ifndef FIPS_MODULE
  174|    137|    if (namemap == NULL)
  ------------------
  |  Branch (174:9): [True: 0, False: 137]
  ------------------
  175|      0|        namemap = ossl_namemap_stored(NULL);
  176|    137|#endif
  177|       |
  178|    137|    if (namemap == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 137]
  ------------------
  179|      0|        return 0;
  180|       |
  181|    137|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|    137|#define HT_INIT_KEY(key) do { \
  |  |  108|    137|memset((key), 0, sizeof(*(key))); \
  |  |  109|    137|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|    137|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|    137|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  182|    137|    HT_SET_KEY_STRING_CASE_N(&key, name, name, name_len);
  ------------------
  |  |  155|    137|#define HT_SET_KEY_STRING_CASE_N(key, member, value, len) do { \
  |  |  156|    137|    if (len < sizeof((key)->keyfields.member)) \
  |  |  ------------------
  |  |  |  Branch (156:9): [True: 137, False: 0]
  |  |  ------------------
  |  |  157|    137|        ossl_ht_strcase((key)->keyfields.member, value, len); \
  |  |  158|    137|    else \
  |  |  159|    137|        ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) - 1); \
  |  |  160|    137|} while(0)
  |  |  ------------------
  |  |  |  Branch (160:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  183|       |
  184|    137|    val = ossl_ht_get(namemap->namenum_ht, TO_HT_KEY(&key));
  ------------------
  |  |  173|    137|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  185|       |
  186|    137|    if (val != NULL)
  ------------------
  |  Branch (186:9): [True: 137, False: 0]
  ------------------
  187|       |        /* We store a (small) int directly instead of a pointer to it. */
  188|    137|        number = (int)(intptr_t)val->value;
  189|       |
  190|    137|    return number;
  191|    137|}
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|    136|{
  310|    136|    char *tmp, *p, *q, *endp;
  311|       |
  312|       |    /* Check that we have a namemap */
  313|    136|    if (!ossl_assert(namemap != NULL)) {
  ------------------
  |  |   52|    136|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    136|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (313:9): [True: 0, False: 136]
  ------------------
  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|    136|    if ((tmp = OPENSSL_strdup(names)) == NULL)
  ------------------
  |  |  119|    136|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    136|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    136|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (318:9): [True: 0, False: 136]
  ------------------
  319|      0|        return 0;
  320|       |
  321|    136|    if (!CRYPTO_THREAD_write_lock(namemap->lock)) {
  ------------------
  |  Branch (321:9): [True: 0, False: 136]
  ------------------
  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|    385|    for (p = tmp; *p != '\0'; p = q) {
  ------------------
  |  Branch (329:19): [True: 249, False: 136]
  ------------------
  330|    249|        int this_number;
  331|    249|        size_t l;
  332|       |
  333|    249|        if ((q = strchr(p, separator)) == NULL) {
  ------------------
  |  Branch (333:13): [True: 136, False: 113]
  ------------------
  334|    136|            l = strlen(p);       /* offset to \0 */
  335|    136|            q = p + l;
  336|    136|        } else {
  337|    113|            l = q - p;           /* offset to the next separator */
  338|    113|            *q++ = '\0';
  339|    113|        }
  340|       |
  341|    249|        if (*p == '\0') {
  ------------------
  |  Branch (341:13): [True: 0, False: 249]
  ------------------
  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|    249|        this_number = ossl_namemap_name2num(namemap, p);
  348|       |
  349|    249|        if (number == 0) {
  ------------------
  |  Branch (349:13): [True: 154, False: 95]
  ------------------
  350|    154|            number = this_number;
  351|    154|        } else if (this_number != 0 && this_number != number) {
  ------------------
  |  Branch (351:20): [True: 76, False: 19]
  |  Branch (351:40): [True: 0, False: 76]
  ------------------
  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|    249|    }
  359|    136|    endp = p;
  360|       |
  361|       |    /* Now that we have checked, register all names */
  362|    385|    for (p = tmp; p < endp; p = q) {
  ------------------
  |  Branch (362:19): [True: 249, False: 136]
  ------------------
  363|    249|        int this_number;
  364|       |
  365|    249|        q = p + strlen(p) + 1;
  366|       |
  367|    249|        this_number = namemap_add_name(namemap, number, p);
  368|    249|        if (number == 0) {
  ------------------
  |  Branch (368:13): [True: 66, False: 183]
  ------------------
  369|     66|            number = this_number;
  370|    183|        } else if (this_number != number) {
  ------------------
  |  Branch (370:20): [True: 0, False: 183]
  ------------------
  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|    249|    }
  378|       |
  379|    136| end:
  380|    136|    CRYPTO_THREAD_unlock(namemap->lock);
  381|    136|    OPENSSL_free(tmp);
  ------------------
  |  |  115|    136|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    136|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    136|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  382|    136|    return number;
  383|    136|}
ossl_namemap_stored:
  481|  1.56k|{
  482|  1.56k|#ifndef FIPS_MODULE
  483|  1.56k|    int nms;
  484|  1.56k|#endif
  485|  1.56k|    OSSL_NAMEMAP *namemap =
  486|  1.56k|        ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_NAMEMAP_INDEX);
  ------------------
  |  |  102|  1.56k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  487|       |
  488|  1.56k|    if (namemap == NULL)
  ------------------
  |  Branch (488:9): [True: 0, False: 1.56k]
  ------------------
  489|      0|        return NULL;
  490|       |
  491|  1.56k|#ifndef FIPS_MODULE
  492|  1.56k|    nms = ossl_namemap_empty(namemap);
  493|  1.56k|    if (nms < 0) {
  ------------------
  |  Branch (493:9): [True: 0, False: 1.56k]
  ------------------
  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|  1.56k|    if (nms == 1) {
  ------------------
  |  Branch (500:9): [True: 1, False: 1.55k]
  ------------------
  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|  1.56k|#endif
  517|       |
  518|  1.56k|    return namemap;
  519|  1.56k|}
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|    897|{
  259|    897|    int ret;
  260|    897|    HT_VALUE val = { 0 };
  261|    897|    NAMENUM_KEY key;
  262|       |
  263|       |    /* If it already exists, we don't add it */
  264|    897|    if ((ret = ossl_namemap_name2num(namemap, name)) != 0)
  ------------------
  |  Branch (264:9): [True: 535, False: 362]
  ------------------
  265|    535|        return ret;
  266|       |
  267|    362|    if ((number = numname_insert(namemap, number, name)) == 0)
  ------------------
  |  Branch (267:9): [True: 0, False: 362]
  ------------------
  268|      0|        return 0;
  269|       |
  270|       |    /* Using tsan_store alone here is safe since we're under lock */
  271|    362|    tsan_store(&namemap->max_number, number);
  ------------------
  |  |   62|    362|#   define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  272|       |
  273|    362|    HT_INIT_KEY(&key);
  ------------------
  |  |  107|    362|#define HT_INIT_KEY(key) do { \
  |  |  108|    362|memset((key), 0, sizeof(*(key))); \
  |  |  109|    362|(key)->key_header.keysize = (sizeof(*(key)) - sizeof(HT_KEY)); \
  |  |  110|    362|(key)->key_header.keybuf = (((uint8_t *)key) + sizeof(HT_KEY)); \
  |  |  111|    362|} while(0)
  |  |  ------------------
  |  |  |  Branch (111:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  274|    362|    HT_SET_KEY_STRING_CASE(&key, name, name);
  ------------------
  |  |  138|    362|#define HT_SET_KEY_STRING_CASE(key, member, value) do { \
  |  |  139|    362|   ossl_ht_strcase((key)->keyfields.member, value, sizeof((key)->keyfields.member) -1); \
  |  |  140|    362|} while(0)
  |  |  ------------------
  |  |  |  Branch (140:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  275|    362|    val.value = (void *)(intptr_t)number;
  276|    362|    ret = ossl_ht_insert(namemap->namenum_ht, TO_HT_KEY(&key), &val, NULL);
  ------------------
  |  |  173|    362|#define TO_HT_KEY(key) &(key)->key_header
  ------------------
  277|    362|    if (!ossl_assert(ret != 0)) /* cannot happen as we are under write lock */
  ------------------
  |  |   52|    362|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    362|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (277:9): [True: 0, False: 362]
  ------------------
  278|      0|        return 0;
  279|    362|    if (ret < 1) {
  ------------------
  |  Branch (279:9): [True: 0, False: 362]
  ------------------
  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|    362|    return number;
  285|    362|}
core_namemap.c:numname_insert:
  217|    362|{
  218|    362|    NAMES *names;
  219|    362|    char *tmpname;
  220|       |
  221|    362|    if (number > 0) {
  ------------------
  |  Branch (221:9): [True: 178, False: 184]
  ------------------
  222|    178|        names = sk_NAMES_value(namemap->numnames, number - 1);
  223|    178|        if (!ossl_assert(names != NULL)) {
  ------------------
  |  |   52|    178|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    178|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (223:13): [True: 0, False: 178]
  ------------------
  224|       |            /* cannot happen */
  225|      0|            return 0;
  226|      0|        }
  227|    184|    } else {
  228|       |        /* a completely new entry */
  229|    184|        names = sk_OPENSSL_STRING_new_null();
  ------------------
  |  |  232|    184|#define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)OPENSSL_sk_new_null())
  ------------------
  230|    184|        if (names == NULL)
  ------------------
  |  Branch (230:13): [True: 0, False: 184]
  ------------------
  231|      0|            return 0;
  232|    184|    }
  233|       |
  234|    362|    if ((tmpname = OPENSSL_strdup(name)) == NULL)
  ------------------
  |  |  119|    362|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    362|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    362|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (234:9): [True: 0, False: 362]
  ------------------
  235|      0|        goto err;
  236|       |
  237|    362|    if (!sk_OPENSSL_STRING_push(names, tmpname))
  ------------------
  |  |  239|    362|#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: 362]
  ------------------
  238|      0|        goto err;
  239|    362|    tmpname = NULL;
  240|       |
  241|    362|    if (number <= 0) {
  ------------------
  |  Branch (241:9): [True: 184, False: 178]
  ------------------
  242|    184|        if (!sk_NAMES_push(namemap->numnames, names))
  ------------------
  |  Branch (242:13): [True: 0, False: 184]
  ------------------
  243|      0|            goto err;
  244|    184|        number = sk_NAMES_num(namemap->numnames);
  245|    184|    }
  246|    362|    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|    362|}
core_namemap.c:name_string_free:
   44|    362|{
   45|    362|    OPENSSL_free(name);
  ------------------
  |  |  115|    362|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    362|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    362|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   46|    362|}
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|    184|{
   50|    184|    sk_OPENSSL_STRING_pop_free(n, name_string_free);
  ------------------
  |  |  243|    184|#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|    184|}

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|}

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

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|}

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|}

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|      2|{
  108|      2|    int to_return = 1;
  109|       |
  110|      2|    if (e == NULL)
  ------------------
  |  Branch (110:9): [True: 2, False: 0]
  ------------------
  111|      2|        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: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|  1.15k|{
  203|  1.15k|    ENGINE *ret = NULL;
  204|  1.15k|    ENGINE_PILE tmplate, *fnd = NULL;
  205|  1.15k|    int initres, loop = 0;
  206|       |
  207|  1.15k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
  208|       |    /* Load the config before trying to check if engines are available */
  209|  1.15k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|  1.15k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  210|  1.15k|#endif
  211|       |
  212|  1.15k|    if (!(*table)) {
  ------------------
  |  Branch (212:9): [True: 1.15k, False: 0]
  ------------------
  213|  1.15k|        OSSL_TRACE3(ENGINE_TABLE,
  ------------------
  |  |  295|  1.15k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  ------------------
  |  |  |  |  283|  1.15k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  214|  1.15k|                   "%s:%d, nid=%d, nothing registered!\n",
  215|  1.15k|                   f, l, nid);
  216|  1.15k|        return NULL;
  217|  1.15k|    }
  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_get_cipher_engine:
   67|  1.15k|{
   68|  1.15k|    return ossl_engine_table_select(&cipher_table, nid,
   69|  1.15k|                                    OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  ------------------
                                                  OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  ------------------
   70|  1.15k|}

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|      2|{
  203|      2|    int i;
  204|       |
  205|      2|    if (state == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 2]
  ------------------
  206|      0|        return;
  207|     34|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|     34|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (207:17): [True: 32, False: 2]
  ------------------
  208|     32|        err_clear(state, i, 1);
  209|     32|    }
  210|      2|    CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  ------------------
  211|      2|}
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|      2|{
  336|      2|    int i;
  337|      2|    ERR_STATE *es;
  338|       |
  339|      2|    es = ossl_err_get_state_int();
  340|      2|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 2]
  ------------------
  341|      0|        return;
  342|       |
  343|     34|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|     34|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 32, False: 2]
  ------------------
  344|     32|        err_clear(es, i, 0);
  345|     32|    }
  346|      2|    es->top = es->bottom = 0;
  347|      2|}
ERR_peek_last_error:
  410|      4|{
  411|      4|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  412|      4|}
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|     30|{
  674|     30|    ERR_STATE *state;
  675|     30|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|     30|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|     30|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|     30|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 30]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|     30|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|     30|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 30, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 30]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|     30|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|     30|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 30]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|     30|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 28]
  ------------------
  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|     30|    set_sys_error(saveerrno);
  ------------------
  |  |   32|     30|# define set_sys_error(e)        errno=(e)
  ------------------
  709|     30|    return state;
  710|     30|}
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|      4|{
  449|      4|    int i = 0;
  450|      4|    ERR_STATE *es;
  451|      4|    unsigned long ret;
  452|       |
  453|      4|    es = ossl_err_get_state_int();
  454|      4|    if (es == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 4]
  ------------------
  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|      4|    while (es->bottom != es->top) {
  ------------------
  |  Branch (461:12): [True: 4, False: 0]
  ------------------
  462|      4|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|      4|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (462:13): [True: 0, False: 4]
  ------------------
  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|      4|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      4|#  define ERR_NUM_ERRORS  16
  ------------------
  468|      4|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|      4|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (468:13): [True: 0, False: 4]
  ------------------
  469|      0|            es->bottom = i;
  470|      0|            err_clear(es, es->bottom, 0);
  471|      0|            continue;
  472|      0|        }
  473|      4|        break;
  474|      4|    }
  475|       |
  476|       |    /* If everything has been cleared, the stack is empty. */
  477|      4|    if (es->bottom == es->top)
  ------------------
  |  Branch (477:9): [True: 0, False: 4]
  ------------------
  478|      0|        return 0;
  479|       |
  480|       |    /* Which error, the top of stack (latest one) or the first one? */
  481|      4|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (481:9): [True: 4, False: 0]
  ------------------
  482|      4|        i = es->top;
  483|      0|    else
  484|      0|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  485|       |
  486|      4|    ret = es->err_buffer[i];
  487|      4|    if (g == EV_POP) {
  ------------------
  |  Branch (487:9): [True: 0, False: 4]
  ------------------
  488|      0|        es->bottom = i;
  489|      0|        es->err_buffer[i] = 0;
  490|      0|    }
  491|       |
  492|      4|    if (file != NULL) {
  ------------------
  |  Branch (492:9): [True: 0, False: 4]
  ------------------
  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|      4|    if (line != NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 4]
  ------------------
  498|      0|        *line = es->err_line[i];
  499|      4|    if (func != NULL) {
  ------------------
  |  Branch (499:9): [True: 0, False: 4]
  ------------------
  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|      4|    if (flags != NULL)
  ------------------
  |  Branch (504:9): [True: 0, False: 4]
  ------------------
  505|      0|        *flags = es->err_data_flags[i];
  506|      4|    if (data == NULL) {
  ------------------
  |  Branch (506:9): [True: 4, False: 0]
  ------------------
  507|      4|        if (g == EV_POP) {
  ------------------
  |  Branch (507:13): [True: 0, False: 4]
  ------------------
  508|      0|            err_clear_data(es, i, 0);
  509|      0|        }
  510|      4|    } 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|      4|    return ret;
  519|      4|}
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|      6|{
   18|      6|    ERR_STATE *es;
   19|       |
   20|      6|    es = ossl_err_get_state_int();
   21|      6|    if (es == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 6]
  ------------------
   22|      0|        return;
   23|       |
   24|       |    /* Allocate a slot */
   25|      6|    err_get_slot(es);
   26|      6|    err_clear(es, es->top, 0);
   27|      6|}
ERR_set_debug:
   30|      6|{
   31|      6|    ERR_STATE *es;
   32|       |
   33|      6|    es = ossl_err_get_state_int();
   34|      6|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 6]
  ------------------
   35|      0|        return;
   36|       |
   37|      6|    err_set_debug(es, es->top, file, line, func);
   38|      6|}
ERR_set_error:
   41|      6|{
   42|      6|    va_list args;
   43|       |
   44|      6|    va_start(args, fmt);
   45|      6|    ERR_vset_error(lib, reason, fmt, args);
   46|      6|    va_end(args);
   47|      6|}
ERR_vset_error:
   50|      6|{
   51|      6|    ERR_STATE *es;
   52|      6|    char *buf = NULL;
   53|      6|    size_t buf_size = 0;
   54|      6|    unsigned long flags = 0;
   55|      6|    size_t i;
   56|       |
   57|      6|    es = ossl_err_get_state_int();
   58|      6|    if (es == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 6]
  ------------------
   59|      0|        return;
   60|      6|    i = es->top;
   61|       |
   62|      6|    if (fmt != NULL) {
  ------------------
  |  Branch (62:9): [True: 2, False: 4]
  ------------------
   63|      2|        int printed_len = 0;
   64|      2|        char *rbuf = NULL;
   65|       |
   66|      2|        buf = es->err_data[i];
   67|      2|        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|      2|        es->err_data[i] = NULL;
   77|      2|        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|      2|        if (buf_size < ERR_MAX_DATA_SIZE
  ------------------
  |  |  392|      4|#define ERR_MAX_DATA_SIZE       1024
  ------------------
  |  Branch (83:13): [True: 2, False: 0]
  ------------------
   84|      2|            && (rbuf = OPENSSL_realloc(buf, ERR_MAX_DATA_SIZE)) != NULL) {
  ------------------
  |  |  109|      2|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (84:16): [True: 2, False: 0]
  ------------------
   85|      2|            buf = rbuf;
   86|      2|            buf_size = ERR_MAX_DATA_SIZE;
  ------------------
  |  |  392|      2|#define ERR_MAX_DATA_SIZE       1024
  ------------------
   87|      2|        }
   88|       |
   89|      2|        if (buf != NULL) {
  ------------------
  |  Branch (89:13): [True: 2, False: 0]
  ------------------
   90|      2|            printed_len = BIO_vsnprintf(buf, buf_size, fmt, args);
   91|      2|        }
   92|      2|        if (printed_len < 0)
  ------------------
  |  Branch (92:13): [True: 0, False: 2]
  ------------------
   93|      0|            printed_len = 0;
   94|      2|        if (buf != NULL)
  ------------------
  |  Branch (94:13): [True: 2, False: 0]
  ------------------
   95|      2|            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|      2|        if ((rbuf = OPENSSL_realloc(buf, printed_len + 1)) != NULL) {
  ------------------
  |  |  109|      2|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (103:13): [True: 2, False: 0]
  ------------------
  104|      2|            buf = rbuf;
  105|      2|            buf_size = printed_len + 1;
  106|      2|            buf[printed_len] = '\0';
  107|      2|        }
  108|       |
  109|      2|        if (buf != NULL)
  ------------------
  |  Branch (109:13): [True: 2, False: 0]
  ------------------
  110|      2|            flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|      2|# define ERR_TXT_MALLOCED        0x01
  ------------------
                          flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|      2|# define ERR_TXT_STRING          0x02
  ------------------
  111|      2|    }
  112|       |
  113|      6|    err_clear_data(es, es->top, 0);
  114|      6|    err_set_error(es, es->top, lib, reason);
  115|      6|    if (fmt != NULL)
  ------------------
  |  Branch (115:9): [True: 2, False: 4]
  ------------------
  116|      2|        err_set_data(es, es->top, buf, buf_size, flags);
  117|      6|}

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

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

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

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_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|  1.15k|{
   35|  1.15k|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 1.15k]
  ------------------
   36|      0|        return 1;
   37|       |
   38|  1.15k|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 1.15k]
  |  Branch (38:32): [True: 0, False: 1.15k]
  ------------------
   39|      0|        goto legacy;
   40|       |
   41|  1.15k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (41:9): [True: 1.15k, False: 0]
  ------------------
   42|  1.15k|        if (ctx->cipher->freectx != NULL)
  ------------------
  |  Branch (42:13): [True: 1.15k, False: 0]
  ------------------
   43|  1.15k|            ctx->cipher->freectx(ctx->algctx);
   44|  1.15k|        ctx->algctx = NULL;
   45|  1.15k|    }
   46|  1.15k|    if (ctx->fetched_cipher != NULL)
  ------------------
  |  Branch (46:9): [True: 1.15k, False: 0]
  ------------------
   47|  1.15k|        EVP_CIPHER_free(ctx->fetched_cipher);
   48|  1.15k|    memset(ctx, 0, sizeof(*ctx));
   49|  1.15k|    ctx->iv_len = -1;
   50|       |
   51|  1.15k|    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|  1.15k|{
   74|  1.15k|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|  1.15k|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  104|  1.15k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|  1.15k|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 1.15k]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|  1.15k|    ctx->iv_len = -1;
   81|  1.15k|    return ctx;
   82|  1.15k|}
EVP_CIPHER_CTX_free:
   85|  1.15k|{
   86|  1.15k|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 1.15k]
  ------------------
   87|      0|        return;
   88|  1.15k|    EVP_CIPHER_CTX_reset(ctx);
   89|  1.15k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  1.15k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|  1.15k|}
EVP_CipherInit_ex2:
  637|  1.15k|{
  638|  1.15k|    return evp_cipher_init_internal(ctx, cipher, NULL, key, iv, enc, 0, params);
  639|  1.15k|}
EVP_EncryptInit_ex2:
  825|  1.15k|{
  826|  1.15k|    return EVP_CipherInit_ex2(ctx, cipher, key, iv, 1, params);
  827|  1.15k|}
EVP_EncryptUpdate:
  979|   207k|{
  980|   207k|    int ret;
  981|   207k|    size_t soutl, inl_ = (size_t)inl;
  982|   207k|    int blocksize;
  983|       |
  984|   207k|    if (ossl_likely(outl != NULL)) {
  ------------------
  |  |   22|   207k|#  define ossl_likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:30): [True: 207k, False: 0]
  |  |  ------------------
  ------------------
  985|   207k|        *outl = 0;
  986|   207k|    } else {
  987|      0|        ERR_raise(ERR_LIB_EVP, 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)
  |  |  ------------------
  ------------------
  988|      0|        return 0;
  989|      0|    }
  990|       |
  991|       |    /* Prevent accidental use of decryption context when encrypting */
  992|   207k|    if (ossl_unlikely(!ctx->encrypt)) {
  ------------------
  |  |   23|   207k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 207k]
  |  |  ------------------
  ------------------
  993|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_OPERATION);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  994|      0|        return 0;
  995|      0|    }
  996|       |
  997|   207k|    if (ossl_unlikely(ctx->cipher == NULL)) {
  ------------------
  |  |   23|   207k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 207k]
  |  |  ------------------
  ------------------
  998|      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)
  |  |  ------------------
  ------------------
  999|      0|        return 0;
 1000|      0|    }
 1001|       |
 1002|   207k|    if (ossl_unlikely(ctx->cipher->prov == NULL))
  ------------------
  |  |   23|   207k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 207k]
  |  |  ------------------
  ------------------
 1003|      0|        goto legacy;
 1004|       |
 1005|   207k|    blocksize = ctx->cipher->block_size;
 1006|       |
 1007|   207k|    if (ossl_unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
  ------------------
  |  |   23|   414k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 207k]
  |  |  |  Branch (23:50): [True: 0, False: 207k]
  |  |  |  Branch (23:50): [True: 0, False: 207k]
  |  |  ------------------
  ------------------
 1008|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_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)
  |  |  ------------------
  ------------------
 1009|      0|        return 0;
 1010|      0|    }
 1011|       |
 1012|   207k|    ret = ctx->cipher->cupdate(ctx->algctx, out, &soutl,
 1013|   207k|                               inl_ + (size_t)(blocksize == 1 ? 0 : blocksize),
  ------------------
  |  Branch (1013:48): [True: 0, False: 207k]
  ------------------
 1014|   207k|                               in, inl_);
 1015|       |
 1016|   207k|    if (ossl_likely(ret)) {
  ------------------
  |  |   22|   207k|#  define ossl_likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:30): [True: 207k, False: 0]
  |  |  ------------------
  ------------------
 1017|   207k|        if (soutl > INT_MAX) {
  ------------------
  |  Branch (1017:13): [True: 0, False: 207k]
  ------------------
 1018|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UPDATE_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)
  |  |  ------------------
  ------------------
 1019|      0|            return 0;
 1020|      0|        }
 1021|   207k|        *outl = soutl;
 1022|   207k|    }
 1023|       |
 1024|   207k|    return ret;
 1025|       |
 1026|       |    /* Code below to be removed when legacy support is dropped. */
 1027|      0| legacy:
 1028|       |
 1029|      0|    return evp_EncryptDecryptUpdate(ctx, out, outl, in, inl);
 1030|   207k|}
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.15k|{
 2074|  1.15k|    EVP_CIPHER *cipher =
 2075|  1.15k|        evp_generic_fetch(ctx, OSSL_OP_CIPHER, algorithm, properties,
  ------------------
  |  |  311|  1.15k|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
 2076|  1.15k|                          evp_cipher_from_algorithm, evp_cipher_up_ref,
 2077|  1.15k|                          evp_cipher_free);
 2078|       |
 2079|  1.15k|    return cipher;
 2080|  1.15k|}
EVP_CIPHER_up_ref:
 2103|  2.43k|{
 2104|  2.43k|    int ref = 0;
 2105|       |
 2106|  2.43k|    if (cipher->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  2.43k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (2106:9): [True: 2.43k, False: 0]
  ------------------
 2107|  2.43k|        CRYPTO_UP_REF(&cipher->refcnt, &ref);
 2108|  2.43k|    return 1;
 2109|  2.43k|}
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|  3.72k|{
 2121|  3.72k|    int i;
 2122|       |
 2123|  3.72k|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  2.56k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (2123:9): [True: 1.15k, False: 2.56k]
  |  Branch (2123:27): [True: 0, False: 2.56k]
  ------------------
 2124|  1.15k|        return;
 2125|       |
 2126|  2.56k|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 2127|  2.56k|    if (i > 0)
  ------------------
  |  Branch (2127:9): [True: 2.43k, False: 130]
  ------------------
 2128|  2.43k|        return;
 2129|    130|    evp_cipher_free_int(cipher);
 2130|    130|}
evp_enc.c:evp_cipher_init_internal:
   98|  1.15k|{
   99|  1.15k|    int n;
  100|  1.15k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  101|  1.15k|    ENGINE *tmpimpl = NULL;
  102|  1.15k|#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|  1.15k|    if (enc == -1) {
  ------------------
  |  Branch (109:9): [True: 0, False: 1.15k]
  ------------------
  110|      0|        enc = ctx->encrypt;
  111|  1.15k|    } else {
  112|  1.15k|        if (enc)
  ------------------
  |  Branch (112:13): [True: 1.15k, False: 0]
  ------------------
  113|  1.15k|            enc = 1;
  114|  1.15k|        ctx->encrypt = enc;
  115|  1.15k|    }
  116|       |
  117|  1.15k|    if (cipher == NULL && ctx->cipher == NULL) {
  ------------------
  |  Branch (117:9): [True: 0, False: 1.15k]
  |  Branch (117:27): [True: 0, False: 0]
  ------------------
  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|  1.15k|    if (is_pipeline)
  ------------------
  |  Branch (123:9): [True: 0, False: 1.15k]
  ------------------
  124|      0|        goto nonlegacy;
  125|       |
  126|  1.15k|#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|  1.15k|    if (ctx->engine && ctx->cipher
  ------------------
  |  Branch (133:9): [True: 0, False: 1.15k]
  |  Branch (133:24): [True: 0, False: 0]
  ------------------
  134|  1.15k|        && (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|  1.15k|    if (cipher != NULL && impl == NULL) {
  ------------------
  |  Branch (137:9): [True: 1.15k, False: 0]
  |  Branch (137:27): [True: 1.15k, False: 0]
  ------------------
  138|       |         /* Ask if an ENGINE is reserved for this job */
  139|  1.15k|        tmpimpl = ENGINE_get_cipher_engine(cipher->nid);
  140|  1.15k|    }
  141|  1.15k|#endif
  142|       |
  143|       |    /*
  144|       |     * If there are engines involved then we should use legacy handling for now.
  145|       |     */
  146|  1.15k|    if (ctx->engine != NULL
  ------------------
  |  Branch (146:9): [True: 0, False: 1.15k]
  ------------------
  147|  1.15k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  148|  1.15k|            || tmpimpl != NULL
  ------------------
  |  Branch (148:16): [True: 0, False: 1.15k]
  ------------------
  149|  1.15k|#endif
  150|  1.15k|            || impl != NULL
  ------------------
  |  Branch (150:16): [True: 0, False: 1.15k]
  ------------------
  151|  1.15k|            || (cipher != NULL && cipher->origin == EVP_ORIG_METH)
  ------------------
  |  |  254|  1.15k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (151:17): [True: 1.15k, False: 0]
  |  Branch (151:35): [True: 0, False: 1.15k]
  ------------------
  152|  1.15k|            || (cipher == NULL && ctx->cipher != NULL
  ------------------
  |  Branch (152:17): [True: 0, False: 1.15k]
  |  Branch (152:35): [True: 0, False: 0]
  ------------------
  153|  1.15k|                               && ctx->cipher->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  254|      0|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (153:35): [True: 0, False: 0]
  ------------------
  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|  1.15k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (164:9): [True: 1.15k, False: 0]
  |  Branch (164:27): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|nonlegacy:
  173|       |    /* Ensure a context left lying around from last time is cleared */
  174|  1.15k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (174:9): [True: 1.15k, False: 0]
  |  Branch (174:27): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    if (cipher == NULL)
  ------------------
  |  Branch (183:9): [True: 0, False: 1.15k]
  ------------------
  184|      0|        cipher = ctx->cipher;
  185|       |
  186|  1.15k|    if (cipher->prov == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    if (!ossl_assert(cipher->prov != NULL)) {
  ------------------
  |  |   52|  1.15k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.15k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (206:9): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    if (cipher != ctx->fetched_cipher) {
  ------------------
  |  Branch (211:9): [True: 1.15k, False: 0]
  ------------------
  212|  1.15k|        if (!EVP_CIPHER_up_ref((EVP_CIPHER *)cipher)) {
  ------------------
  |  Branch (212:13): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|        EVP_CIPHER_free(ctx->fetched_cipher);
  217|       |        /* Coverity false positive, the reference counting is confusing it */
  218|       |        /* coverity[use_after_free] */
  219|  1.15k|        ctx->fetched_cipher = (EVP_CIPHER *)cipher;
  220|  1.15k|    }
  221|  1.15k|    ctx->cipher = cipher;
  222|       |
  223|  1.15k|    if (is_pipeline && !EVP_CIPHER_can_pipeline(cipher, enc)) {
  ------------------
  |  Branch (223:9): [True: 0, False: 1.15k]
  |  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|  1.15k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (228:9): [True: 1.15k, False: 0]
  ------------------
  229|  1.15k|        ctx->algctx = ctx->cipher->newctx(ossl_provider_ctx(cipher->prov));
  230|  1.15k|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (230:13): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    }
  235|       |
  236|  1.15k|    if ((ctx->flags & EVP_CIPH_NO_PADDING) != 0) {
  ------------------
  |  |  346|  1.15k|# define         EVP_CIPH_NO_PADDING             0x100
  ------------------
  |  Branch (236:9): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|#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|  1.15k|    if (params != NULL) {
  ------------------
  |  Branch (254:9): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|#endif
  280|       |
  281|  1.15k|    if (is_pipeline)
  ------------------
  |  Branch (281:9): [True: 0, False: 1.15k]
  ------------------
  282|      0|        return 1;
  283|       |
  284|  1.15k|    if (enc) {
  ------------------
  |  Branch (284:9): [True: 1.15k, False: 0]
  ------------------
  285|  1.15k|        if (ctx->cipher->einit == NULL) {
  ------------------
  |  Branch (285:13): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|        return ctx->cipher->einit(ctx->algctx,
  302|  1.15k|                                  key,
  303|  1.15k|                                  key == NULL ? 0
  ------------------
  |  Branch (303:35): [True: 0, False: 1.15k]
  ------------------
  304|  1.15k|                                              : EVP_CIPHER_CTX_get_key_length(ctx),
  305|  1.15k|                                  iv,
  306|  1.15k|                                  iv == NULL ? 0
  ------------------
  |  Branch (306:35): [True: 1.15k, False: 0]
  ------------------
  307|  1.15k|                                             : EVP_CIPHER_CTX_get_iv_length(ctx),
  308|  1.15k|                                  params);
  309|  1.15k|    }
  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.28k|{
 2063|  1.28k|    return EVP_CIPHER_up_ref(cipher);
 2064|  1.28k|}
evp_enc.c:evp_cipher_free:
 2067|    261|{
 2068|    261|    EVP_CIPHER_free(cipher);
 2069|    261|}

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|  1.15k|{
  398|  1.15k|    struct evp_method_data_st methdata;
  399|  1.15k|    void *method;
  400|       |
  401|  1.15k|    methdata.libctx = libctx;
  402|  1.15k|    methdata.tmp_store = NULL;
  403|  1.15k|    method = inner_evp_generic_fetch(&methdata, NULL, operation_id,
  404|  1.15k|                                     name, properties,
  405|  1.15k|                                     new_method, up_ref_method, free_method);
  406|  1.15k|    dealloc_tmp_evp_method_store(methdata.tmp_store);
  407|  1.15k|    return method;
  408|  1.15k|}
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|    130|{
  674|    130|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  675|    130|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  676|       |
  677|    130|    return ossl_namemap_doall_names(namemap, number, fn, data);
  678|    130|}
evp_fetch.c:inner_evp_generic_fetch:
  259|  1.15k|{
  260|  1.15k|    OSSL_METHOD_STORE *store = get_evp_method_store(methdata->libctx);
  261|  1.15k|    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|  1.15k|    const char *const propq = properties != NULL ? properties : "";
  ------------------
  |  Branch (271:31): [True: 0, False: 1.15k]
  ------------------
  272|  1.15k|#endif  /* FIPS_MODULE */
  273|  1.15k|    uint32_t meth_id = 0;
  274|  1.15k|    void *method = NULL;
  275|  1.15k|    int unsupported, name_id;
  276|       |
  277|  1.15k|    if (store == NULL || namemap == NULL) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.15k]
  |  Branch (277:26): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    if (!ossl_assert(operation_id > 0)) {
  ------------------
  |  |   52|  1.15k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  1.15k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (286:9): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    name_id = name != NULL ? ossl_namemap_name2num(namemap, name) : 0;
  ------------------
  |  Branch (292:15): [True: 1.15k, 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|  1.15k|    if (name_id != 0 && (meth_id = evp_method_id(name_id, operation_id)) == 0) {
  ------------------
  |  Branch (302:9): [True: 1.15k, False: 1]
  |  Branch (302:25): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    unsupported = name_id == 0;
  312|       |
  313|  1.15k|    if (meth_id == 0
  ------------------
  |  Branch (313:9): [True: 1, False: 1.15k]
  ------------------
  314|  1.15k|        || !ossl_method_store_cache_get(store, prov, meth_id, propq, &method)) {
  ------------------
  |  Branch (314:12): [True: 2, False: 1.15k]
  ------------------
  315|      3|        OSSL_METHOD_CONSTRUCT_METHOD mcm = {
  316|      3|            get_tmp_evp_method_store,
  317|      3|            reserve_evp_method_store,
  318|      3|            unreserve_evp_method_store,
  319|      3|            get_evp_method_from_store,
  320|      3|            put_evp_method_in_store,
  321|      3|            construct_evp_method,
  322|      3|            destruct_evp_method
  323|      3|        };
  324|       |
  325|      3|        methdata->operation_id = operation_id;
  326|      3|        methdata->name_id = name_id;
  327|      3|        methdata->names = name;
  328|      3|        methdata->propquery = propq;
  329|      3|        methdata->method_from_algorithm = new_method;
  330|      3|        methdata->refcnt_up_method = up_ref_method;
  331|      3|        methdata->destruct_method = free_method;
  332|      3|        methdata->flag_construct_error_occurred = 0;
  333|      3|        if ((method = ossl_method_construct(methdata->libctx, operation_id,
  ------------------
  |  Branch (333:13): [True: 3, False: 0]
  ------------------
  334|      3|                                            &prov, 0 /* !force_cache */,
  335|      3|                                            &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|      3|            if (name_id == 0)
  ------------------
  |  Branch (348:17): [True: 1, False: 2]
  ------------------
  349|      1|                name_id = ossl_namemap_name2num(namemap, name);
  350|      3|            if (name_id == 0) {
  ------------------
  |  Branch (350:17): [True: 0, False: 3]
  ------------------
  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|      3|            } else {
  356|      3|                meth_id = evp_method_id(name_id, operation_id);
  357|      3|                if (meth_id != 0)
  ------------------
  |  Branch (357:21): [True: 3, False: 0]
  ------------------
  358|      3|                    ossl_method_store_cache_set(store, prov, meth_id, propq,
  359|      3|                                                method, up_ref_method, free_method);
  360|      3|            }
  361|      3|        }
  362|       |
  363|       |        /*
  364|       |         * If we never were in the constructor, the algorithm to be fetched
  365|       |         * is unsupported.
  366|       |         */
  367|      3|        unsupported = !methdata->flag_construct_error_occurred;
  368|      3|    }
  369|       |
  370|  1.15k|    if ((name_id != 0 || name != NULL) && method == NULL) {
  ------------------
  |  Branch (370:10): [True: 1.15k, False: 0]
  |  Branch (370:26): [True: 0, False: 0]
  |  Branch (370:43): [True: 0, False: 1.15k]
  ------------------
  371|      0|        int code = unsupported ? ERR_R_UNSUPPORTED : ERR_R_FETCH_FAILED;
  ------------------
  |  |  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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      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: 0, False: 0]
  ------------------
  372|       |
  373|      0|        if (name == NULL)
  ------------------
  |  Branch (373:13): [True: 0, False: 0]
  ------------------
  374|      0|            name = ossl_namemap_num2name(namemap, name_id, 0);
  375|      0|        ERR_raise_data(ERR_LIB_EVP, code,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   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, code,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
  376|      0|                       "%s, Algorithm (%s : %d), Properties (%s)",
  377|      0|                       ossl_lib_ctx_get_descriptor(methdata->libctx),
  378|      0|                       name == NULL ? "<null>" : name, name_id,
  ------------------
  |  Branch (378:24): [True: 0, False: 0]
  ------------------
  379|      0|                       properties == NULL ? "<null>" : properties);
  ------------------
  |  Branch (379:24): [True: 0, False: 0]
  ------------------
  380|  1.15k|    } else {
  381|  1.15k|        OSSL_TRACE4(QUERY, "%s, Algorithm (%s : %d), Properties (%s)\n",
  ------------------
  |  |  297|  1.15k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4))
  |  |  ------------------
  |  |  |  |  283|  1.15k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  382|  1.15k|                    ossl_lib_ctx_get_descriptor(methdata->libctx),
  383|  1.15k|                    name == NULL ? "<null>" : name, name_id,
  384|  1.15k|                    properties == NULL ? "<null>" : properties);
  385|  1.15k|    }
  386|       |
  387|  1.15k|    return method;
  388|  1.15k|}
evp_fetch.c:evp_method_id:
  117|  1.29k|{
  118|  1.29k|    if (!ossl_assert(name_id > 0 && name_id <= METHOD_ID_NAME_MAX)
  ------------------
  |  |   52|  2.59k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 1.29k, False: 0]
  |  |  |  Branch (52:43): [True: 1.29k, False: 0]
  |  |  ------------------
  |  |   53|  2.59k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (118:9): [True: 0, False: 1.29k]
  ------------------
  119|  1.29k|        || !ossl_assert(operation_id > 0
  ------------------
  |  |   52|  2.59k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 1.29k, False: 0]
  |  |  |  Branch (52:43): [True: 1.29k, False: 0]
  |  |  ------------------
  |  |   53|  1.29k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (119:12): [True: 0, False: 1.29k]
  ------------------
  120|  1.29k|                        && operation_id <= METHOD_ID_OPERATION_MAX))
  121|      0|        return 0;
  122|  1.29k|    return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  114|  1.29k|#define METHOD_ID_NAME_OFFSET           8
  ------------------
                  return (((name_id << METHOD_ID_NAME_OFFSET) & METHOD_ID_NAME_MASK)
  ------------------
  |  |  113|  1.29k|#define METHOD_ID_NAME_MASK             0x7FFFFF00
  ------------------
  123|  1.29k|            | (operation_id & METHOD_ID_OPERATION_MASK));
  ------------------
  |  |  111|  1.29k|#define METHOD_ID_OPERATION_MASK        0x000000FF
  ------------------
  124|  1.29k|}
evp_fetch.c:reserve_evp_method_store:
   73|      6|{
   74|      6|    struct evp_method_data_st *methdata = data;
   75|       |
   76|      6|    if (store == NULL
  ------------------
  |  Branch (76:9): [True: 6, False: 0]
  ------------------
   77|      6|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (77:12): [True: 0, False: 6]
  ------------------
   78|      0|        return 0;
   79|       |
   80|      6|    return ossl_method_lock_store(store);
   81|      6|}
evp_fetch.c:unreserve_evp_method_store:
   84|      6|{
   85|      6|    struct evp_method_data_st *methdata = data;
   86|       |
   87|      6|    if (store == NULL
  ------------------
  |  Branch (87:9): [True: 6, False: 0]
  ------------------
   88|      6|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (88:12): [True: 0, False: 6]
  ------------------
   89|      0|        return 0;
   90|       |
   91|      6|    return ossl_method_unlock_store(store);
   92|      6|}
evp_fetch.c:get_evp_method_from_store:
  128|      3|{
  129|      3|    struct evp_method_data_st *methdata = data;
  130|      3|    void *method = NULL;
  131|      3|    int name_id;
  132|      3|    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|      3|    if ((name_id = methdata->name_id) == 0 && methdata->names != NULL) {
  ------------------
  |  Branch (139:9): [True: 1, False: 2]
  |  Branch (139:47): [True: 1, False: 0]
  ------------------
  140|      1|        OSSL_NAMEMAP *namemap = ossl_namemap_stored(methdata->libctx);
  141|      1|        const char *names = methdata->names;
  142|      1|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|      1|#define NAME_SEPARATOR ':'
  ------------------
  143|      1|        size_t l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (143:21): [True: 1, False: 0]
  ------------------
  144|       |
  145|      1|        if (namemap == 0)
  ------------------
  |  Branch (145:13): [True: 0, False: 1]
  ------------------
  146|      0|            return NULL;
  147|      1|        name_id = ossl_namemap_name2num_n(namemap, names, l);
  148|      1|    }
  149|       |
  150|      3|    if (name_id == 0
  ------------------
  |  Branch (150:9): [True: 0, False: 3]
  ------------------
  151|      3|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (151:12): [True: 0, False: 3]
  ------------------
  152|      0|        return NULL;
  153|       |
  154|      3|    if (store == NULL
  ------------------
  |  Branch (154:9): [True: 3, False: 0]
  ------------------
  155|      3|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (155:12): [True: 0, False: 3]
  ------------------
  156|      0|        return NULL;
  157|       |
  158|      3|    if (!ossl_method_store_fetch(store, meth_id, methdata->propquery, prov,
  ------------------
  |  Branch (158:9): [True: 0, False: 3]
  ------------------
  159|      3|                                 &method))
  160|      0|        return NULL;
  161|      3|    return method;
  162|      3|}
evp_fetch.c:put_evp_method_in_store:
  168|    136|{
  169|    136|    struct evp_method_data_st *methdata = data;
  170|    136|    OSSL_NAMEMAP *namemap;
  171|    136|    int name_id;
  172|    136|    uint32_t meth_id;
  173|    136|    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|    136|    if (names != NULL) {
  ------------------
  |  Branch (181:9): [True: 136, False: 0]
  ------------------
  182|    136|        const char *q = strchr(names, NAME_SEPARATOR);
  ------------------
  |  |   24|    136|#define NAME_SEPARATOR ':'
  ------------------
  183|       |
  184|    136|        l = (q == NULL ? strlen(names) : (size_t)(q - names));
  ------------------
  |  Branch (184:14): [True: 56, False: 80]
  ------------------
  185|    136|    }
  186|       |
  187|    136|    if ((namemap = ossl_namemap_stored(methdata->libctx)) == NULL
  ------------------
  |  Branch (187:9): [True: 0, False: 136]
  ------------------
  188|    136|        || (name_id = ossl_namemap_name2num_n(namemap, names, l)) == 0
  ------------------
  |  Branch (188:12): [True: 0, False: 136]
  ------------------
  189|    136|        || (meth_id = evp_method_id(name_id, methdata->operation_id)) == 0)
  ------------------
  |  Branch (189:12): [True: 0, False: 136]
  ------------------
  190|      0|        return 0;
  191|       |
  192|    136|    OSSL_TRACE1(QUERY, "put_evp_method_in_store: original store: %p\n", store);
  ------------------
  |  |  291|    136|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|    136|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  193|    136|    if (store == NULL
  ------------------
  |  Branch (193:9): [True: 136, False: 0]
  ------------------
  194|    136|        && (store = get_evp_method_store(methdata->libctx)) == NULL)
  ------------------
  |  Branch (194:12): [True: 0, False: 136]
  ------------------
  195|      0|        return 0;
  196|       |
  197|    136|    OSSL_TRACE5(QUERY,
  ------------------
  |  |  299|    136|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3, arg4, arg5))
  |  |  ------------------
  |  |  |  |  283|    136|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  198|    136|                "put_evp_method_in_store: "
  199|    136|                "store: %p, names: %s, operation_id %d, method_id: %d, properties: %s\n",
  200|    136|                store, names, methdata->operation_id, meth_id, propdef ? propdef : "<null>");
  201|    136|    return ossl_method_store_add(store, prov, meth_id, propdef, method,
  202|    136|                                 methdata->refcnt_up_method,
  203|    136|                                 methdata->destruct_method);
  204|    136|}
evp_fetch.c:construct_evp_method:
  212|    136|{
  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|    136|    struct evp_method_data_st *methdata = data;
  221|    136|    OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
  222|    136|    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
  223|    136|    const char *names = algodef->algorithm_names;
  224|    136|    int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR);
  ------------------
  |  |   24|    136|#define NAME_SEPARATOR ':'
  ------------------
  225|    136|    void *method;
  226|       |
  227|    136|    if (name_id == 0)
  ------------------
  |  Branch (227:9): [True: 0, False: 136]
  ------------------
  228|      0|        return NULL;
  229|       |
  230|    136|    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|    136|    if (method == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 136]
  ------------------
  238|      0|        methdata->flag_construct_error_occurred = 1;
  239|       |
  240|    136|    return method;
  241|    136|}
evp_fetch.c:destruct_evp_method:
  244|    136|{
  245|    136|    struct evp_method_data_st *methdata = data;
  246|       |
  247|    136|    methdata->destruct_method(method);
  248|    136|}
evp_fetch.c:dealloc_tmp_evp_method_store:
   61|  1.15k|{
   62|  1.15k|    OSSL_TRACE1(QUERY, "Deallocating the tmp_store %p\n", store);
  ------------------
  |  |  291|  1.15k|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|  1.15k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   63|  1.15k|    if (store != NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 1.15k]
  ------------------
   64|      0|        ossl_method_store_free(store);
   65|  1.15k|}
evp_fetch.c:get_evp_method_store:
   68|  1.31k|{
   69|  1.31k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX);
  ------------------
  |  |   98|  1.31k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
   70|  1.31k|}

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|  1.15k|{
  648|  1.15k|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (648:9): [True: 0, False: 1.15k]
  ------------------
  649|      0|        return 0;
  650|       |
  651|  1.15k|    if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) {
  ------------------
  |  Branch (651:9): [True: 1.15k, False: 0]
  |  Branch (651:30): [True: 1.15k, False: 0]
  ------------------
  652|  1.15k|        int ok;
  653|  1.15k|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.15k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.15k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  654|  1.15k|        size_t len;
  655|       |
  656|  1.15k|        params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
  ------------------
  |  |  194|  1.15k|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  657|  1.15k|        ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  658|  1.15k|        if (ok <= 0)
  ------------------
  |  Branch (658:13): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|        if (!OSSL_PARAM_get_int(params, &((EVP_CIPHER_CTX *)ctx)->key_len))
  ------------------
  |  Branch (668:13): [True: 0, False: 1.15k]
  ------------------
  669|      0|            return -1;
  670|  1.15k|        ((EVP_CIPHER_CTX *)ctx)->key_len = (int)len;
  671|  1.15k|    }
  672|  1.15k|    return ctx->key_len;
  673|  1.15k|}
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|    130|{
  733|    130|    return cipher->prov;
  734|    130|}
EVP_MD_get_type:
  795|     59|{
  796|     59|    return md->type;
  797|     59|}

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|      3|{
  288|      3|    return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties,
  ------------------
  |  |  314|      3|# define OSSL_OP_RAND                                5
  ------------------
  289|      3|                             evp_rand_from_algorithm, evp_rand_up_ref,
  290|      3|                             evp_rand_free);
  291|      3|}
EVP_RAND_up_ref:
  294|      3|{
  295|      3|    return evp_rand_up_ref(rand);
  296|      3|}
EVP_RAND_free:
  299|      6|{
  300|      6|    evp_rand_free(rand);
  301|      6|}
EVP_RAND_get0_provider:
  324|      2|{
  325|      2|    return rand->prov;
  326|      2|}
EVP_RAND_CTX_up_ref:
  336|      2|{
  337|      2|    int ref = 0;
  338|       |
  339|      2|    return CRYPTO_UP_REF(&ctx->refcnt, &ref);
  340|      2|}
EVP_RAND_CTX_new:
  343|      3|{
  344|      3|    EVP_RAND_CTX *ctx;
  345|      3|    void *parent_ctx = NULL;
  346|      3|    const OSSL_DISPATCH *parent_dispatch = NULL;
  347|       |
  348|      3|    if (rand == NULL) {
  ------------------
  |  Branch (348:9): [True: 0, False: 3]
  ------------------
  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|      3|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  354|      3|    if (ctx == NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 3]
  ------------------
  355|      0|        return NULL;
  356|      3|    if (!CRYPTO_NEW_REF(&ctx->refcnt, 1)) {
  ------------------
  |  Branch (356:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (parent != NULL) {
  ------------------
  |  Branch (360:9): [True: 2, False: 1]
  ------------------
  361|      2|        if (!EVP_RAND_CTX_up_ref(parent)) {
  ------------------
  |  Branch (361:13): [True: 0, False: 2]
  ------------------
  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|      2|        parent_ctx = parent->algctx;
  368|      2|        parent_dispatch = parent->meth->dispatch;
  369|      2|    }
  370|      3|    if ((ctx->algctx = rand->newctx(ossl_provider_ctx(rand->prov), parent_ctx,
  ------------------
  |  Branch (370:9): [True: 0, False: 3]
  ------------------
  371|      3|                                    parent_dispatch)) == NULL
  372|      3|            || !EVP_RAND_up_ref(rand)) {
  ------------------
  |  Branch (372:16): [True: 0, False: 3]
  ------------------
  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|      3|    ctx->meth = rand;
  381|      3|    ctx->parent = parent;
  382|      3|    return ctx;
  383|      3|}
EVP_RAND_CTX_free:
  386|      9|{
  387|      9|    int ref = 0;
  388|      9|    EVP_RAND_CTX *parent;
  389|       |
  390|      9|    if (ctx == NULL)
  ------------------
  |  Branch (390:9): [True: 4, False: 5]
  ------------------
  391|      4|        return;
  392|       |
  393|      5|    CRYPTO_DOWN_REF(&ctx->refcnt, &ref);
  394|      5|    if (ref > 0)
  ------------------
  |  Branch (394:9): [True: 2, False: 3]
  ------------------
  395|      2|        return;
  396|      3|    parent = ctx->parent;
  397|      3|    ctx->meth->freectx(ctx->algctx);
  398|      3|    ctx->algctx = NULL;
  399|      3|    EVP_RAND_free(ctx->meth);
  400|      3|    CRYPTO_FREE_REF(&ctx->refcnt);
  401|      3|    OPENSSL_free(ctx);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  402|      3|    EVP_RAND_CTX_free(parent);
  403|      3|}
EVP_RAND_CTX_settable_params:
  484|      2|{
  485|      2|    void *provctx;
  486|       |
  487|      2|    if (ctx->meth->settable_ctx_params == NULL)
  ------------------
  |  Branch (487:9): [True: 2, False: 0]
  ------------------
  488|      2|        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|      2|}
EVP_RAND_instantiate:
  525|      3|{
  526|      3|    int res;
  527|       |
  528|      3|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (528:9): [True: 0, False: 3]
  ------------------
  529|      0|        return 0;
  530|      3|    res = evp_rand_instantiate_locked(ctx, strength, prediction_resistance,
  531|      3|                                      pstr, pstr_len, params);
  532|      3|    evp_rand_unlock(ctx);
  533|      3|    return res;
  534|      3|}
EVP_RAND_generate:
  587|  1.15k|{
  588|  1.15k|    int res;
  589|       |
  590|  1.15k|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (590:9): [True: 0, False: 1.15k]
  ------------------
  591|      0|        return 0;
  592|  1.15k|    res = evp_rand_generate_locked(ctx, out, outlen, strength,
  593|  1.15k|                                   prediction_resistance, addin, addin_len);
  594|  1.15k|    evp_rand_unlock(ctx);
  595|  1.15k|    return res;
  596|  1.15k|}
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|     14|{
   55|     14|    EVP_RAND *rand = (EVP_RAND *)vrand;
   56|     14|    int ref = 0;
   57|       |
   58|     14|    if (rand != NULL)
  ------------------
  |  Branch (58:9): [True: 14, False: 0]
  ------------------
   59|     14|        return CRYPTO_UP_REF(&rand->refcnt, &ref);
   60|      0|    return 1;
   61|     14|}
evp_rand.c:evp_rand_free:
   64|     20|{
   65|     20|    EVP_RAND *rand = (EVP_RAND *)vrand;
   66|     20|    int ref = 0;
   67|       |
   68|     20|    if (rand == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 20]
  ------------------
   69|      0|        return;
   70|     20|    CRYPTO_DOWN_REF(&rand->refcnt, &ref);
   71|     20|    if (ref > 0)
  ------------------
  |  Branch (71:9): [True: 14, False: 6]
  ------------------
   72|     14|        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|  1.15k|{
  105|  1.15k|    if (rand->meth->lock != NULL)
  ------------------
  |  Branch (105:9): [True: 1, False: 1.15k]
  ------------------
  106|      1|        return rand->meth->lock(rand->algctx);
  107|  1.15k|    return 1;
  108|  1.15k|}
evp_rand.c:evp_rand_get_ctx_params_locked:
  412|  1.15k|{
  413|  1.15k|    return ctx->meth->get_ctx_params(ctx->algctx, params);
  414|  1.15k|}
evp_rand.c:evp_rand_unlock:
  112|  1.15k|{
  113|  1.15k|    if (rand->meth->unlock != NULL)
  ------------------
  |  Branch (113:9): [True: 1, False: 1.15k]
  ------------------
  114|      1|        rand->meth->unlock(rand->algctx);
  115|  1.15k|}
evp_rand.c:evp_rand_instantiate_locked:
  516|      3|{
  517|      3|    return ctx->meth->instantiate(ctx->algctx, strength, prediction_resistance,
  518|      3|                                  pstr, pstr_len, params);
  519|      3|}
evp_rand.c:evp_rand_generate_locked:
  557|  1.15k|{
  558|  1.15k|    size_t chunk, max_request = 0;
  559|  1.15k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.15k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.15k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  560|       |
  561|  1.15k|    params[0] = OSSL_PARAM_construct_size_t(OSSL_RAND_PARAM_MAX_REQUEST,
  ------------------
  |  |  532|  1.15k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  562|  1.15k|                                            &max_request);
  563|  1.15k|    if (!evp_rand_get_ctx_params_locked(ctx, params)
  ------------------
  |  Branch (563:9): [True: 0, False: 1.15k]
  ------------------
  564|  1.15k|            || max_request == 0) {
  ------------------
  |  Branch (564:16): [True: 0, False: 1.15k]
  ------------------
  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|  2.30k|    for (; outlen > 0; outlen -= chunk, out += chunk) {
  ------------------
  |  Branch (568:12): [True: 1.15k, False: 1.15k]
  ------------------
  569|  1.15k|        chunk = outlen > max_request ? max_request : outlen;
  ------------------
  |  Branch (569:17): [True: 0, False: 1.15k]
  ------------------
  570|  1.15k|        if (!ctx->meth->generate(ctx->algctx, out, chunk, strength,
  ------------------
  |  Branch (570:13): [True: 0, False: 1.15k]
  ------------------
  571|  1.15k|                                 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|  1.15k|        prediction_resistance = 0;
  580|  1.15k|    }
  581|  1.15k|    return 1;
  582|  1.15k|}

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|  1.15k|int name (const type *obj, void *algctx, OSSL_PARAM params[])                  \
   46|  1.15k|{                                                                              \
   47|  2.30k|    PARAM_CHECK(obj, func, err)                                                \
  ------------------
  |  |   28|  1.15k|    if (obj == NULL)                                                           \
  |  |  ------------------
  |  |  |  Branch (28:9): [True: 0, False: 1.15k]
  |  |  ------------------
  |  |   29|  1.15k|        return 0;                                                              \
  |  |   30|  1.15k|    if (obj->prov == NULL)                                                     \
  |  |  ------------------
  |  |  |  Branch (30:9): [True: 0, False: 1.15k]
  |  |  ------------------
  |  |   31|  1.15k|        return EVP_CTRL_RET_UNSUPPORTED;                                       \
  |  |  ------------------
  |  |  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  |  |  ------------------
  |  |   32|  1.15k|    if (obj->func == NULL) {                                                   \
  |  |  ------------------
  |  |  |  Branch (32:9): [True: 0, False: 1.15k]
  |  |  ------------------
  |  |   33|      0|        errfunc();                                                             \
  |  |   34|      0|        return 0;                                                              \
  |  |   35|      0|    }
  ------------------
   48|  2.30k|    return obj->func(algctx, params);                                          \
   49|  2.30k|}

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_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|}

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_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|  2.80k|{
   15|  2.80k|    uint64_t hash = 0xcbf29ce484222325ULL;
   16|  2.80k|    size_t i;
   17|       |
   18|   182k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (18:17): [True: 179k, False: 2.80k]
  ------------------
   19|   179k|        hash ^= key[i];
   20|   179k|        hash *= 0x00000100000001B3ULL;
   21|   179k|    }
   22|  2.80k|    return hash;
   23|  2.80k|}

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|    362|{
  630|    362|    struct ht_internal_value_st *newval = NULL;
  631|    362|    uint64_t hash;
  632|    362|    int rc = 0;
  633|    362|    int i;
  634|       |
  635|    362|    if (data->value == NULL)
  ------------------
  |  Branch (635:9): [True: 0, False: 362]
  ------------------
  636|      0|        goto out;
  637|       |
  638|    362|    newval = alloc_new_value(h, key, data->value, data->type_id);
  639|    362|    if (newval == NULL)
  ------------------
  |  Branch (639:9): [True: 0, False: 362]
  ------------------
  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|    362|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  647|       |
  648|    362|    for (i = 0;
  649|    362|         (rc = ossl_ht_insert_locked(h, hash, newval, olddata)) == -1
  ------------------
  |  Branch (649:10): [True: 0, False: 362]
  ------------------
  650|    362|         && i < 4;
  ------------------
  |  Branch (650:13): [True: 0, False: 0]
  ------------------
  651|    362|         ++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|    362|    if (rc <= 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 362]
  ------------------
  658|      0|        free_value(newval);
  659|       |
  660|    362|out:
  661|    362|    return rc;
  662|    362|}
ossl_ht_get:
  665|  2.44k|{
  666|  2.44k|    struct ht_mutable_data_st *md;
  667|  2.44k|    uint64_t hash;
  668|  2.44k|    uint64_t neigh_idx_start;
  669|  2.44k|    uint64_t neigh_idx;
  670|  2.44k|    struct ht_internal_value_st *ival = NULL;
  671|  2.44k|    size_t j;
  672|  2.44k|    uint64_t ehash;
  673|  2.44k|    int lockless_reads = h->config.lockless_reads;
  674|       |
  675|  2.44k|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  676|       |
  677|  2.44k|    md = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|  2.44k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  678|  2.44k|    neigh_idx = neigh_idx_start = hash & md->neighborhood_mask;
  679|  2.44k|    do {
  680|  2.44k|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|  2.44k|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  681|  2.49k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|  2.49k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|  2.49k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (681:21): [True: 2.49k, False: 0]
  ------------------
  682|  2.49k|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|  2.49k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  683|  2.49k|            if (ival == NULL) {
  ------------------
  |  Branch (683:17): [True: 466, False: 2.02k]
  ------------------
  684|    466|                if (lockless_reads)
  ------------------
  |  Branch (684:21): [True: 466, False: 0]
  ------------------
  685|       |                    /* lockless_reads implies no deletion, we can break out */
  686|    466|                    return NULL;
  687|      0|                continue;
  688|    466|            }
  689|  2.02k|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (689:17): [True: 0, False: 2.02k]
  ------------------
  690|  2.02k|                                    &ehash, h->atomic_lock))
  691|      0|                return NULL;
  692|  2.02k|            if (compare_hash(hash, ehash) && match_key(&ival->value.key, key))
  ------------------
  |  Branch (692:17): [True: 1.97k, False: 54]
  |  Branch (692:46): [True: 1.97k, False: 0]
  ------------------
  693|  1.97k|                return (HT_VALUE *)ival;
  694|  2.02k|        }
  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|  2.44k|}
hashtable.c:internal_free_nop:
  171|    362|{
  172|    362|    return;
  173|    362|}
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: 362, False: 16.0k]
  ------------------
  272|    362|                v = oldmd->neighborhoods[i].entries[j].value;
  273|    362|                v->ht->config.ht_free_fn((HT_VALUE *)v);
  274|    362|                free_value(v);
  275|    362|            }
  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|    362|{
  598|    362|    struct ht_internal_value_st *tmp;
  599|    362|    size_t nvsize = sizeof(*tmp);
  600|       |
  601|    362|    if (h->config.collision_check == 1)
  ------------------
  |  Branch (601:9): [True: 362, False: 0]
  ------------------
  602|    362|        nvsize += key->keysize;
  603|       |
  604|    362|    tmp = OPENSSL_malloc(nvsize);
  ------------------
  |  |  102|    362|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    362|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    362|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  605|       |
  606|    362|    if (tmp == NULL)
  ------------------
  |  Branch (606:9): [True: 0, False: 362]
  ------------------
  607|      0|        return NULL;
  608|       |
  609|    362|    tmp->ht = h;
  610|    362|    tmp->value.value = data;
  611|    362|    tmp->value.type_id = type;
  612|    362|    tmp->value.key.keybuf = NULL;
  613|    362|    if (h->config.collision_check) {
  ------------------
  |  Branch (613:9): [True: 362, False: 0]
  ------------------
  614|    362|        tmp->value.key.keybuf = (uint8_t *)(tmp + 1);
  615|    362|        tmp->value.key.keysize = key->keysize;
  616|    362|        memcpy(tmp->value.key.keybuf, key->keybuf, key->keysize);
  617|    362|    }
  618|       |
  619|       |
  620|    362|    return tmp;
  621|    362|}
hashtable.c:ossl_ht_insert_locked:
  532|    362|{
  533|    362|    struct ht_mutable_data_st *md = h->md;
  534|    362|    uint64_t neigh_idx_start = hash & md->neighborhood_mask;
  535|    362|    uint64_t neigh_idx = neigh_idx_start;
  536|    362|    size_t j;
  537|    362|    uint64_t ihash;
  538|    362|    HT_VALUE *ival;
  539|    362|    size_t empty_idx = SIZE_MAX;
  540|    362|    int lockless_reads = h->config.lockless_reads;
  541|       |
  542|    362|    do {
  543|    362|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|    362|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  544|       |
  545|    381|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|    381|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|    381|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (545:21): [True: 381, False: 0]
  ------------------
  546|    381|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|    381|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  547|    381|            if (ival == NULL) {
  ------------------
  |  Branch (547:17): [True: 362, False: 19]
  ------------------
  548|    362|                empty_idx = j;
  549|       |                /* lockless_reads implies no deletion, we can break out */
  550|    362|                if (lockless_reads)
  ------------------
  |  Branch (550:21): [True: 362, False: 0]
  ------------------
  551|    362|                    goto not_found;
  552|      0|                continue;
  553|    362|            }
  554|     19|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (554:17): [True: 0, False: 19]
  ------------------
  555|     19|                                    &ihash, h->atomic_lock))
  556|      0|                return 0;
  557|     19|            if (compare_hash(hash, ihash) && match_key(&newval->value.key,
  ------------------
  |  Branch (557:17): [True: 0, False: 19]
  |  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|     19|        }
  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|    362| not_found:
  582|       |    /* If we get to here, its just an insert */
  583|    362|    if (empty_idx == SIZE_MAX)
  ------------------
  |  Branch (583:9): [True: 0, False: 362]
  ------------------
  584|      0|        return -1; /* out of space */
  585|    362|    if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[empty_idx].hash,
  ------------------
  |  Branch (585:9): [True: 0, False: 362]
  ------------------
  586|    362|                             hash, h->atomic_lock))
  587|      0|        return 0;
  588|    362|    h->wpd.value_count++;
  589|    362|    ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[empty_idx].value,
  ------------------
  |  |   31|    362|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  590|    362|                        &newval);
  591|    362|    return 1;
  592|    362|}
hashtable.c:free_value:
  624|    362|{
  625|    362|    OPENSSL_free(v);
  ------------------
  |  |  115|    362|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    362|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    362|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  626|    362|}
hashtable.c:compare_hash:
  405|  2.04k|{
  406|  2.04k|    return (hash1 == hash2);
  407|  2.04k|}
hashtable.c:match_key:
  516|  1.97k|{
  517|       |    /*
  518|       |     * keys match if they are both present, the same size
  519|       |     * and compare equal in memory
  520|       |     */
  521|  1.97k|    PREFETCH(a->keybuf);
  ------------------
  |  |   84|  1.97k|# define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  522|  1.97k|    PREFETCH(b->keybuf);
  ------------------
  |  |   84|  1.97k|# define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  523|  1.97k|    if (a->keybuf != NULL && b->keybuf != NULL && a->keysize == b->keysize)
  ------------------
  |  Branch (523:9): [True: 1.97k, False: 0]
  |  Branch (523:30): [True: 1.97k, False: 0]
  |  Branch (523:51): [True: 1.97k, False: 0]
  ------------------
  524|  1.97k|        return !memcmp(a->keybuf, b->keybuf, a->keysize);
  525|       |
  526|      0|    return 1;
  527|  1.97k|}

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|  1.20k|{
  501|  1.20k|    uint64_t tmp;
  502|  1.20k|    int aloaddone = 0;
  503|       |
  504|       |   /* Applications depend on 0 being returned when cleanup was already done */
  505|  1.20k|    if (stopped) {
  ------------------
  |  Branch (505:9): [True: 0, False: 1.20k]
  ------------------
  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|  1.20k|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (524:9): [True: 1.20k, False: 0]
  ------------------
  525|  1.20k|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (525:13): [True: 1.16k, False: 46]
  ------------------
  526|  1.16k|            return 1;
  527|     46|        aloaddone = 1;
  528|     46|    }
  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|     46|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|     46|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 46, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (544:9): [True: 0, False: 46]
  ------------------
  545|      0|        return 0;
  546|       |
  547|     46|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|     46|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (547:9): [True: 38, False: 8]
  ------------------
  548|     38|        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|  2.46k|{
   53|       |
   54|  2.46k|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 2.46k]
  ------------------
   55|      0|        return NULL;
   56|  2.46k|    lh->compw = cw;
   57|  2.46k|    lh->hashw = hw;
   58|  2.46k|    lh->daw = daw;
   59|  2.46k|    lh->daaw = daaw;
   60|  2.46k|    return lh;
   61|  2.46k|}
OPENSSL_LH_new:
   64|  2.46k|{
   65|  2.46k|    OPENSSL_LHASH *ret;
   66|       |
   67|  2.46k|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|  2.46k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.46k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.46k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 2.46k]
  ------------------
   68|      0|        return NULL;
   69|  2.46k|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |  104|  2.46k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.46k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.46k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 2.46k]
  ------------------
   70|      0|        goto err;
   71|  2.46k|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 2.46k]
  ------------------
   72|  2.46k|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 2.46k]
  ------------------
   73|  2.46k|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|  2.46k|#define MIN_NODES       16
  ------------------
   74|  2.46k|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|  2.46k|#define MIN_NODES       16
  ------------------
   75|  2.46k|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|  2.46k|#define MIN_NODES       16
  ------------------
   76|  2.46k|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|  2.46k|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   85|  2.46k|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   77|  2.46k|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|  2.46k|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   85|  2.46k|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   78|  2.46k|    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|  2.46k|}
OPENSSL_LH_free:
   87|  2.45k|{
   88|  2.45k|    if (lh == NULL)
  ------------------
  |  Branch (88:9): [True: 2, False: 2.45k]
  ------------------
   89|      2|        return;
   90|       |
   91|  2.45k|    OPENSSL_LH_flush(lh);
   92|  2.45k|    OPENSSL_free(lh->b);
  ------------------
  |  |  115|  2.45k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.45k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.45k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|  2.45k|    OPENSSL_free(lh);
  ------------------
  |  |  115|  2.45k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.45k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.45k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|  2.45k|}
OPENSSL_LH_flush:
   97|  2.45k|{
   98|  2.45k|    unsigned int i;
   99|  2.45k|    OPENSSL_LH_NODE *n, *nn;
  100|       |
  101|  2.45k|    if (lh == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 2.45k]
  ------------------
  102|      0|        return;
  103|       |
  104|   121k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (104:17): [True: 119k, False: 2.45k]
  ------------------
  105|   119k|        n = lh->b[i];
  106|   327k|        while (n != NULL) {
  ------------------
  |  Branch (106:16): [True: 207k, False: 119k]
  ------------------
  107|   207k|            nn = n->next;
  108|   207k|            OPENSSL_free(n);
  ------------------
  |  |  115|   207k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   207k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   207k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|   207k|            n = nn;
  110|   207k|        }
  111|   119k|        lh->b[i] = NULL;
  112|   119k|    }
  113|       |
  114|  2.45k|    lh->num_items = 0;
  115|  2.45k|}
OPENSSL_LH_insert:
  118|   269k|{
  119|   269k|    unsigned long hash;
  120|   269k|    OPENSSL_LH_NODE *nn, **rn;
  121|   269k|    void *ret;
  122|       |
  123|   269k|    lh->error = 0;
  124|   269k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   85|   269k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (124:9): [True: 101k, False: 167k]
  |  Branch (124:76): [True: 0, False: 101k]
  ------------------
  125|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  126|       |
  127|   269k|    rn = getrn(lh, data, &hash);
  128|       |
  129|   269k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 249k, False: 19.9k]
  ------------------
  130|   249k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  102|   249k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   249k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   249k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 249k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|   249k|        nn->data = data;
  135|   249k|        nn->next = NULL;
  136|   249k|        nn->hash = hash;
  137|   249k|        *rn = nn;
  138|   249k|        ret = NULL;
  139|   249k|        lh->num_items++;
  140|   249k|    } else {                    /* replace same key */
  141|  19.9k|        ret = (*rn)->data;
  142|  19.9k|        (*rn)->data = data;
  143|  19.9k|    }
  144|   269k|    return ret;
  145|   269k|}
OPENSSL_LH_delete:
  148|  41.9k|{
  149|  41.9k|    unsigned long hash;
  150|  41.9k|    OPENSSL_LH_NODE *nn, **rn;
  151|  41.9k|    void *ret;
  152|       |
  153|  41.9k|    lh->error = 0;
  154|  41.9k|    rn = getrn(lh, data, &hash);
  155|       |
  156|  41.9k|    if (*rn == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 41.9k]
  ------------------
  157|      0|        return NULL;
  158|  41.9k|    } else {
  159|  41.9k|        nn = *rn;
  160|  41.9k|        *rn = nn->next;
  161|  41.9k|        ret = nn->data;
  162|  41.9k|        OPENSSL_free(nn);
  ------------------
  |  |  115|  41.9k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  41.9k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  41.9k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|  41.9k|    }
  164|       |
  165|  41.9k|    lh->num_items--;
  166|  41.9k|    if ((lh->num_nodes > MIN_NODES) &&
  ------------------
  |  |   39|  41.9k|#define MIN_NODES       16
  ------------------
  |  Branch (166:9): [True: 38.0k, False: 3.88k]
  ------------------
  167|  41.9k|        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   85|  38.0k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (167:9): [True: 2.09k, False: 35.9k]
  ------------------
  168|  2.09k|        contract(lh);
  169|       |
  170|  41.9k|    return ret;
  171|  41.9k|}
OPENSSL_LH_retrieve:
  174|   821k|{
  175|   821k|    unsigned long hash;
  176|   821k|    OPENSSL_LH_NODE **rn;
  177|       |
  178|   821k|    if (lh->error != 0)
  ------------------
  |  Branch (178:9): [True: 0, False: 821k]
  ------------------
  179|      0|        lh->error = 0;
  180|       |
  181|   821k|    rn = getrn(lh, data, &hash);
  182|       |
  183|   821k|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (183:12): [True: 536k, False: 284k]
  ------------------
  184|   821k|}
OPENSSL_LH_doall:
  217|  1.30k|{
  218|  1.30k|    if (lh == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 1.30k]
  ------------------
  219|      0|        return;
  220|       |
  221|  1.30k|    doall_util_fn(lh, 0, lh->daw, func, (OPENSSL_LH_DOALL_FUNCARG)NULL,
  222|  1.30k|                  (OPENSSL_LH_DOALL_FUNCARG_THUNK)NULL, NULL);
  223|  1.30k|}
OPENSSL_LH_doall_arg:
  227|  2.50M|{
  228|  2.50M|    if (lh == NULL)
  ------------------
  |  Branch (228:9): [True: 0, False: 2.50M]
  ------------------
  229|      0|        return;
  230|       |
  231|  2.50M|    doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC_THUNK)NULL,
  232|  2.50M|                  (OPENSSL_LH_DOALL_FUNC)NULL, func, lh->daaw, arg);
  233|  2.50M|}
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|  1.40k|{
  363|  1.40k|    unsigned long ret = 0;
  364|  1.40k|    long n;
  365|  1.40k|    unsigned long v;
  366|  1.40k|    int r;
  367|       |
  368|  1.40k|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (368:9): [True: 0, False: 1.40k]
  |  Branch (368:24): [True: 1.15k, False: 244]
  ------------------
  369|  1.15k|        return ret;
  370|       |
  371|    244|    n = 0x100;
  372|  3.08k|    while (*c) {
  ------------------
  |  Branch (372:12): [True: 2.83k, False: 244]
  ------------------
  373|  2.83k|        v = n | (*c);
  374|  2.83k|        n += 0x100;
  375|  2.83k|        r = (int)((v >> 2) ^ v) & 0x0f;
  376|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  377|  2.83k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  378|  2.83k|        ret &= 0xFFFFFFFFL;
  379|  2.83k|        ret ^= v * v;
  380|  2.83k|        c++;
  381|  2.83k|    }
  382|    244|    return (ret >> 16) ^ ret;
  383|  1.40k|}
ossl_lh_strcasehash:
  400|  1.90k|{
  401|  1.90k|    unsigned long ret = 0;
  402|  1.90k|    long n;
  403|  1.90k|    unsigned long v;
  404|  1.90k|    int r;
  405|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  406|       |    const long int case_adjust = ~0x40;
  407|       |#else
  408|  1.90k|    const long int case_adjust = ~0x20;
  409|  1.90k|#endif
  410|       |
  411|  1.90k|    if (c == NULL || *c == '\0')
  ------------------
  |  Branch (411:9): [True: 0, False: 1.90k]
  |  Branch (411:22): [True: 0, False: 1.90k]
  ------------------
  412|      0|        return ret;
  413|       |
  414|  24.1k|    for (n = 0x100; *c != '\0'; n += 0x100) {
  ------------------
  |  Branch (414:21): [True: 22.2k, False: 1.90k]
  ------------------
  415|  22.2k|        v = n | (case_adjust & *c);
  416|  22.2k|        r = (int)((v >> 2) ^ v) & 0x0f;
  417|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  418|  22.2k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  419|  22.2k|        ret &= 0xFFFFFFFFL;
  420|  22.2k|        ret ^= v * v;
  421|  22.2k|        c++;
  422|  22.2k|    }
  423|  1.90k|    return (ret >> 16) ^ ret;
  424|  1.90k|}
OPENSSL_LH_get_down_load:
  432|      8|{
  433|      8|    return lh->down_load;
  434|      8|}
OPENSSL_LH_set_down_load:
  437|     14|{
  438|     14|    lh->down_load = down_load;
  439|     14|}
OPENSSL_LH_error:
  442|   259k|{
  443|   259k|    return lh->error;
  444|   259k|}
lhash.c:doall_util_fn:
  192|  2.50M|{
  193|  2.50M|    int i;
  194|  2.50M|    OPENSSL_LH_NODE *a, *n;
  195|       |
  196|  2.50M|    if (lh == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 2.50M]
  ------------------
  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|   459M|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (203:33): [True: 457M, False: 2.50M]
  ------------------
  204|   457M|        a = lh->b[i];
  205|  1.35G|        while (a != NULL) {
  ------------------
  |  Branch (205:16): [True: 899M, False: 457M]
  ------------------
  206|   899M|            n = a->next;
  207|   899M|            if (use_arg)
  ------------------
  |  Branch (207:17): [True: 899M, False: 103k]
  ------------------
  208|   899M|                wfunc_arg(a->data, arg, func_arg);
  209|   103k|            else
  210|   103k|                wfunc(a->data, func);
  211|   899M|            a = n;
  212|   899M|        }
  213|   457M|    }
  214|  2.50M|}
lhash.c:expand:
  244|   101k|{
  245|   101k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  246|   101k|    unsigned int p, pmax, nni, j;
  247|   101k|    unsigned long hash;
  248|       |
  249|   101k|    nni = lh->num_alloc_nodes;
  250|   101k|    p = lh->p;
  251|   101k|    pmax = lh->pmax;
  252|   101k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (252:9): [True: 1.73k, False: 100k]
  ------------------
  253|  1.73k|        j = nni * 2;
  254|  1.73k|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  109|  1.73k|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.73k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.73k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  255|  1.73k|        if (n == NULL) {
  ------------------
  |  Branch (255:13): [True: 0, False: 1.73k]
  ------------------
  256|      0|            lh->error++;
  257|      0|            return 0;
  258|      0|        }
  259|  1.73k|        lh->b = n;
  260|  1.73k|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  261|  1.73k|        lh->pmax = nni;
  262|  1.73k|        lh->num_alloc_nodes = j;
  263|  1.73k|        lh->p = 0;
  264|   100k|    } else {
  265|   100k|        lh->p++;
  266|   100k|    }
  267|       |
  268|   101k|    lh->num_nodes++;
  269|   101k|    n1 = &(lh->b[p]);
  270|   101k|    n2 = &(lh->b[p + pmax]);
  271|   101k|    *n2 = NULL;
  272|       |
  273|   405k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (273:20): [True: 303k, False: 101k]
  ------------------
  274|   303k|        hash = np->hash;
  275|   303k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (275:13): [True: 142k, False: 160k]
  ------------------
  276|   142k|            *n1 = (*n1)->next;
  277|   142k|            np->next = *n2;
  278|   142k|            *n2 = np;
  279|   142k|        } else
  280|   160k|            n1 = &((*n1)->next);
  281|   303k|        np = *n1;
  282|   303k|    }
  283|       |
  284|   101k|    return 1;
  285|   101k|}
lhash.c:contract:
  288|  2.09k|{
  289|  2.09k|    OPENSSL_LH_NODE **n, *n1, *np;
  290|       |
  291|  2.09k|    np = lh->b[lh->p + lh->pmax - 1];
  292|  2.09k|    lh->b[lh->p + lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
  293|  2.09k|    if (lh->p == 0) {
  ------------------
  |  Branch (293:9): [True: 551, False: 1.54k]
  ------------------
  294|    551|        n = OPENSSL_realloc(lh->b,
  ------------------
  |  |  109|    551|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    551|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    551|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  295|    551|                            (unsigned int)(sizeof(OPENSSL_LH_NODE *) * lh->pmax));
  296|    551|        if (n == NULL) {
  ------------------
  |  Branch (296:13): [True: 0, False: 551]
  ------------------
  297|       |            /* fputs("realloc error in lhash", stderr); */
  298|      0|            lh->error++;
  299|    551|        } else {
  300|    551|            lh->b = n;
  301|    551|        }
  302|    551|        lh->num_alloc_nodes /= 2;
  303|    551|        lh->pmax /= 2;
  304|    551|        lh->p = lh->pmax - 1;
  305|    551|    } else
  306|  1.54k|        lh->p--;
  307|       |
  308|  2.09k|    lh->num_nodes--;
  309|       |
  310|  2.09k|    n1 = lh->b[(int)lh->p];
  311|  2.09k|    if (n1 == NULL)
  ------------------
  |  Branch (311:9): [True: 687, False: 1.40k]
  ------------------
  312|    687|        lh->b[(int)lh->p] = np;
  313|  1.40k|    else {
  314|  3.31k|        while (n1->next != NULL)
  ------------------
  |  Branch (314:16): [True: 1.91k, False: 1.40k]
  ------------------
  315|  1.91k|            n1 = n1->next;
  316|  1.40k|        n1->next = np;
  317|  1.40k|    }
  318|  2.09k|}
lhash.c:getrn:
  322|  1.13M|{
  323|  1.13M|    OPENSSL_LH_NODE **ret, *n1;
  324|  1.13M|    unsigned long hash, nn;
  325|       |
  326|  1.13M|    if (lh->hashw != NULL)
  ------------------
  |  Branch (326:9): [True: 1.13M, False: 0]
  ------------------
  327|  1.13M|        hash = lh->hashw(data, lh->hash);
  328|      0|    else
  329|      0|        hash = lh->hash(data);
  330|       |
  331|  1.13M|    *rhash = hash;
  332|       |
  333|  1.13M|    nn = hash % lh->pmax;
  334|  1.13M|    if (nn < lh->p)
  ------------------
  |  Branch (334:9): [True: 550k, False: 582k]
  ------------------
  335|   550k|        nn = hash % lh->num_alloc_nodes;
  336|       |
  337|  1.13M|    ret = &(lh->b[(int)nn]);
  338|  13.5M|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (338:21): [True: 12.7M, False: 786k]
  ------------------
  339|  12.7M|        if (n1->hash != hash) {
  ------------------
  |  Branch (339:13): [True: 12.3M, False: 347k]
  ------------------
  340|  12.3M|            ret = &(n1->next);
  341|  12.3M|            continue;
  342|  12.3M|        }
  343|       |
  344|   347k|        if (lh->compw != NULL) {
  ------------------
  |  Branch (344:13): [True: 347k, False: 0]
  ------------------
  345|   347k|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (345:17): [True: 346k, False: 420]
  ------------------
  346|   346k|                break;
  347|   347k|        } 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|  1.13M|    return ret;
  354|  1.13M|}

CRYPTO_malloc:
  187|   412k|{
  188|   412k|    void *ptr;
  189|       |
  190|   412k|    INCREMENT(malloc_count);
  191|   412k|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (191:9): [True: 0, False: 412k]
  ------------------
  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|   412k|    if (num == 0)
  ------------------
  |  Branch (198:9): [True: 0, False: 412k]
  ------------------
  199|      0|        return NULL;
  200|       |
  201|   412k|    FAILTEST();
  202|   412k|    if (allow_customize) {
  ------------------
  |  Branch (202:9): [True: 2, False: 412k]
  ------------------
  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|   412k|    ptr = malloc(num);
  212|   412k|    if (ptr != NULL)
  ------------------
  |  Branch (212:9): [True: 412k, False: 0]
  ------------------
  213|   412k|        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|   412k|}
CRYPTO_zalloc:
  228|   160k|{
  229|   160k|    void *ret;
  230|       |
  231|   160k|    ret = CRYPTO_malloc(num, file, line);
  232|   160k|    if (ret != NULL)
  ------------------
  |  Branch (232:9): [True: 160k, False: 0]
  ------------------
  233|   160k|        memset(ret, 0, num);
  234|       |
  235|   160k|    return ret;
  236|   160k|}
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.30k|{
  302|  2.30k|    INCREMENT(realloc_count);
  303|  2.30k|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (303:9): [True: 0, False: 2.30k]
  ------------------
  304|      0|        return realloc_impl(str, num, file, line);
  305|       |
  306|  2.30k|    if (str == NULL)
  ------------------
  |  Branch (306:9): [True: 4, False: 2.30k]
  ------------------
  307|      4|        return CRYPTO_malloc(num, file, line);
  308|       |
  309|  2.30k|    if (num == 0) {
  ------------------
  |  Branch (309:9): [True: 0, False: 2.30k]
  ------------------
  310|      0|        CRYPTO_free(str, file, line);
  311|      0|        return NULL;
  312|      0|    }
  313|       |
  314|  2.30k|    FAILTEST();
  315|  2.30k|    return realloc(str, num);
  316|  2.30k|}
CRYPTO_free:
  346|   412k|{
  347|   412k|    INCREMENT(free_count);
  348|   412k|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (348:9): [True: 0, False: 412k]
  ------------------
  349|      0|        free_impl(str, file, line);
  350|      0|        return;
  351|      0|    }
  352|       |
  353|   412k|    free(str);
  354|   412k|}
CRYPTO_clear_free:
  357|  1.15k|{
  358|  1.15k|    if (str == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 1.15k]
  ------------------
  359|      0|        return;
  360|  1.15k|    if (num)
  ------------------
  |  Branch (360:9): [True: 1.15k, False: 0]
  ------------------
  361|  1.15k|        OPENSSL_cleanse(str, num);
  362|  1.15k|    CRYPTO_free(str, file, line);
  363|  1.15k|}

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|}
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|}

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|    510|{
   24|    510|    char *ret;
   25|       |
   26|    510|    if (str == NULL)
  ------------------
  |  Branch (26:9): [True: 0, False: 510]
  ------------------
   27|      0|        return NULL;
   28|    510|    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
   29|    510|    if (ret != NULL)
  ------------------
  |  Branch (29:9): [True: 510, False: 0]
  ------------------
   30|    510|        strcpy(ret, str);
   31|    510|    return ret;
   32|    510|}
CRYPTO_strndup:
   35|    136|{
   36|    136|    size_t maxlen;
   37|    136|    char *ret;
   38|       |
   39|    136|    if (str == NULL)
  ------------------
  |  Branch (39:9): [True: 0, False: 136]
  ------------------
   40|      0|        return NULL;
   41|       |
   42|    136|    maxlen = OPENSSL_strnlen(str, s);
   43|       |
   44|    136|    ret = CRYPTO_malloc(maxlen + 1, file, line);
   45|    136|    if (ret) {
  ------------------
  |  Branch (45:9): [True: 136, False: 0]
  ------------------
   46|    136|        memcpy(ret, str, maxlen);
   47|    136|        ret[maxlen] = CH_ZERO;
  ------------------
  |  |   20|    136|#define CH_ZERO '\0'
  ------------------
   48|    136|    }
   49|    136|    return ret;
   50|    136|}
OPENSSL_strnlen:
   66|    146|{
   67|    146|    const char *p;
   68|       |
   69|  2.00k|    for (p = str; maxlen-- != 0 && *p != CH_ZERO; ++p) ;
  ------------------
  |  |   20|  1.87k|#define CH_ZERO '\0'
  ------------------
  |  Branch (69:19): [True: 1.87k, False: 136]
  |  Branch (69:36): [True: 1.86k, False: 10]
  ------------------
   70|       |
   71|    146|    return p - str;
   72|    146|}
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|  1.31k|{
  408|  1.31k|    int t;
  409|       |
  410|  15.9k|    while ((t = ossl_tolower(*s1) - ossl_tolower(*s2++)) == 0)
  ------------------
  |  Branch (410:12): [True: 15.9k, False: 0]
  ------------------
  411|  15.9k|        if (*s1++ == '\0')
  ------------------
  |  Branch (411:13): [True: 1.31k, False: 14.6k]
  ------------------
  412|  1.31k|            return 0;
  413|      0|    return t;
  414|  1.31k|}

OBJ_NAME_init:
   64|  1.81k|{
   65|  1.81k|    return RUN_ONCE(&init, o_names_init);
  ------------------
  |  |  130|  1.81k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.81k, False: 0]
  |  |  ------------------
  ------------------
   66|  1.81k|}
OBJ_NAME_get:
  152|    485|{
  153|    485|    OBJ_NAME on, *ret;
  154|    485|    int num = 0, alias;
  155|    485|    const char *value = NULL;
  156|       |
  157|    485|    if (name == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 485]
  ------------------
  158|      0|        return NULL;
  159|    485|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (159:9): [True: 0, False: 485]
  ------------------
  160|      0|        return NULL;
  161|    485|    if (!CRYPTO_THREAD_read_lock(obj_lock))
  ------------------
  |  Branch (161:9): [True: 0, False: 485]
  ------------------
  162|      0|        return NULL;
  163|       |
  164|    485|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    485|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  165|    485|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    485|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  166|       |
  167|    485|    on.name = name;
  168|    485|    on.type = type;
  169|       |
  170|    576|    for (;;) {
  171|    576|        ret = lh_OBJ_NAME_retrieve(names_lh, &on);
  172|    576|        if (ret == NULL)
  ------------------
  |  Branch (172:13): [True: 109, False: 467]
  ------------------
  173|    109|            break;
  174|    467|        if ((ret->alias) && !alias) {
  ------------------
  |  Branch (174:13): [True: 91, False: 376]
  |  Branch (174:29): [True: 91, False: 0]
  ------------------
  175|     91|            if (++num > 10)
  ------------------
  |  Branch (175:17): [True: 0, False: 91]
  ------------------
  176|      0|                break;
  177|     91|            on.name = ret->data;
  178|    376|        } else {
  179|    376|            value = ret->data;
  180|    376|            break;
  181|    376|        }
  182|    467|    }
  183|       |
  184|    485|    CRYPTO_THREAD_unlock(obj_lock);
  185|    485|    return value;
  186|    485|}
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.90k|{
  137|  1.90k|    unsigned long ret;
  138|       |
  139|  1.90k|    if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 1.90k]
  ------------------
  140|  1.90k|        && (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.90k|    } else {
  145|  1.90k|        ret = ossl_lh_strcasehash(a->name);
  146|  1.90k|    }
  147|  1.90k|    ret ^= a->type;
  148|  1.90k|    return ret;
  149|  1.90k|}
o_names.c:obj_name_cmp:
  120|  1.31k|{
  121|  1.31k|    int ret;
  122|       |
  123|  1.31k|    ret = a->type - b->type;
  124|  1.31k|    if (ret == 0) {
  ------------------
  |  Branch (124:9): [True: 1.31k, False: 0]
  ------------------
  125|  1.31k|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (125:13): [True: 0, False: 1.31k]
  ------------------
  126|  1.31k|            && (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.31k|            ret = OPENSSL_strcasecmp(a->name, b->name);
  131|  1.31k|    }
  132|  1.31k|    return ret;
  133|  1.31k|}
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|  1.52k|{
  332|  1.52k|    ADDED_OBJ ad, *adp = NULL;
  333|  1.52k|    ASN1_OBJECT ob;
  334|       |
  335|  1.52k|    if (n == NID_undef
  ------------------
  |  |   18|  3.05k|#define NID_undef                       0
  ------------------
  |  Branch (335:9): [True: 0, False: 1.52k]
  ------------------
  336|  1.52k|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1353|  3.05k|#define NUM_NID 1496
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   18|  1.52k|#define NID_undef                       0
  ------------------
  |  Branch (336:13): [True: 1.52k, False: 0]
  |  Branch (336:22): [True: 1.52k, False: 0]
  |  Branch (336:37): [True: 1.52k, False: 0]
  ------------------
  337|  1.52k|        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|    578|{
  358|    578|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  359|       |
  360|    578|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (360:12): [True: 0, False: 578]
  ------------------
  361|    578|}
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_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_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_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|}

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_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|}

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|  12.9k|{
   55|  12.9k|    if (p != NULL && key != NULL)
  ------------------
  |  Branch (55:9): [True: 12.9k, False: 6]
  |  Branch (55:22): [True: 12.9k, False: 0]
  ------------------
   56|  29.0k|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (56:16): [True: 19.6k, False: 9.37k]
  ------------------
   57|  19.6k|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (57:17): [True: 3.60k, False: 16.0k]
  ------------------
   58|  3.60k|                return p;
   59|  9.37k|    return NULL;
   60|  12.9k|}
OSSL_PARAM_locate_const:
   63|    136|{
   64|    136|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   65|    136|}
OSSL_PARAM_get_int:
  267|  1.15k|{
  268|  1.15k|#ifndef OPENSSL_SMALL_FOOTPRINT
  269|  1.15k|    switch (sizeof(int)) {
  ------------------
  |  Branch (269:13): [Folded - Ignored]
  ------------------
  270|  1.15k|    case sizeof(int32_t):
  ------------------
  |  Branch (270:5): [True: 1.15k, False: 0]
  ------------------
  271|  1.15k|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  272|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (272:5): [True: 0, False: 1.15k]
  ------------------
  273|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  274|  1.15k|    }
  275|      0|#endif
  276|      0|    return general_get_int(p, val, sizeof(*val));
  277|  1.15k|}
OSSL_PARAM_set_int:
  280|    780|{
  281|    780|#ifndef OPENSSL_SMALL_FOOTPRINT
  282|    780|    switch (sizeof(int)) {
  ------------------
  |  Branch (282:13): [Folded - Ignored]
  ------------------
  283|    780|    case sizeof(int32_t):
  ------------------
  |  Branch (283:5): [True: 780, False: 0]
  ------------------
  284|    780|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  285|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (285:5): [True: 0, False: 780]
  ------------------
  286|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  287|    780|    }
  288|      0|#endif
  289|      0|    return general_set_int(p, &val, sizeof(val));
  290|    780|}
OSSL_PARAM_construct_int:
  293|    780|{
  294|    780|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|    780|# define OSSL_PARAM_INTEGER              1
  ------------------
  295|    780|}
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|    132|{
  325|    132|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|    132|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  326|    132|                                sizeof(unsigned int));
  327|    132|}
OSSL_PARAM_get_int32:
  393|  1.15k|{
  394|  1.15k|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (394:9): [True: 0, False: 1.15k]
  |  Branch (394:24): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    if (p->data == NULL) {
  ------------------
  |  Branch (399:9): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  1.15k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (404:9): [True: 0, False: 1.15k]
  ------------------
  405|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  406|      0|        int64_t i64;
  407|       |
  408|      0|        switch (p->data_size) {
  ------------------
  |  Branch (408:17): [True: 0, False: 0]
  ------------------
  409|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (409:9): [True: 0, False: 0]
  ------------------
  410|      0|            *val = *(const int32_t *)p->data;
  411|      0|            return 1;
  412|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (412:9): [True: 0, False: 0]
  ------------------
  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|      0|        }
  421|      0|#endif
  422|      0|        return general_get_int(p, val, sizeof(*val));
  423|       |
  424|  1.15k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  1.15k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (424:16): [True: 1.15k, False: 0]
  ------------------
  425|  1.15k|#ifndef OPENSSL_SMALL_FOOTPRINT
  426|  1.15k|        uint32_t u32;
  427|  1.15k|        uint64_t u64;
  428|       |
  429|  1.15k|        switch (p->data_size) {
  ------------------
  |  Branch (429:17): [True: 0, False: 1.15k]
  ------------------
  430|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (430:9): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|        case sizeof(uint64_t):
  ------------------
  |  Branch (438:9): [True: 1.15k, False: 0]
  ------------------
  439|  1.15k|            u64 = *(const uint64_t *)p->data;
  440|  1.15k|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (440:17): [True: 1.15k, False: 0]
  ------------------
  441|  1.15k|                *val = (int32_t)u64;
  442|  1.15k|                return 1;
  443|  1.15k|            }
  444|      0|            err_out_of_range;
  ------------------
  |  |   25|  1.15k|    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|  1.15k|        }
  447|      0|#endif
  448|      0|        return general_get_int(p, val, sizeof(*val));
  449|       |
  450|  1.15k|    } 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|  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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|      0|    return 0;
  470|  1.15k|}
OSSL_PARAM_set_int32:
  473|    780|{
  474|    780|    if (p == NULL) {
  ------------------
  |  Branch (474:9): [True: 0, False: 780]
  ------------------
  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|    780|    p->return_size = 0;
  479|    780|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|    780|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (479:9): [True: 780, False: 0]
  ------------------
  480|    780|#ifndef OPENSSL_SMALL_FOOTPRINT
  481|    780|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  482|    780|        if (p->data == NULL)
  ------------------
  |  Branch (482:13): [True: 0, False: 780]
  ------------------
  483|      0|            return 1;
  484|    780|        switch (p->data_size) {
  ------------------
  |  Branch (484:17): [True: 0, False: 780]
  ------------------
  485|    780|        case sizeof(int32_t):
  ------------------
  |  Branch (485:9): [True: 780, False: 0]
  ------------------
  486|    780|            *(int32_t *)p->data = val;
  487|    780|            return 1;
  488|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (488:9): [True: 0, False: 780]
  ------------------
  489|      0|            p->return_size = sizeof(int64_t);
  490|      0|            *(int64_t *)p->data = (int64_t)val;
  491|      0|            return 1;
  492|    780|        }
  493|      0|#endif
  494|      0|        return general_set_int(p, &val, sizeof(val));
  495|    780|    } 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|    780|    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|    780|}
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|  2.69k|{
  939|  2.69k|    if (p == NULL) {
  ------------------
  |  Branch (939:9): [True: 0, False: 2.69k]
  ------------------
  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|  2.69k|    p->return_size = 0;
  944|       |
  945|  2.69k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  2.69k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (945:9): [True: 2.69k, False: 0]
  ------------------
  946|  2.69k|#ifndef OPENSSL_SMALL_FOOTPRINT
  947|  2.69k|        if (p->data == NULL) {
  ------------------
  |  Branch (947:13): [True: 0, False: 2.69k]
  ------------------
  948|      0|            p->return_size = sizeof(uint64_t); /* Expected size */
  949|      0|            return 1;
  950|      0|        }
  951|  2.69k|        switch (p->data_size) {
  ------------------
  |  Branch (951:17): [True: 0, False: 2.69k]
  ------------------
  952|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (952:9): [True: 0, False: 2.69k]
  ------------------
  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|  2.69k|        case sizeof(uint64_t):
  ------------------
  |  Branch (960:9): [True: 2.69k, False: 0]
  ------------------
  961|  2.69k|            p->return_size = sizeof(uint64_t);
  962|  2.69k|            *(uint64_t *)p->data = val;
  963|  2.69k|            return 1;
  964|  2.69k|        }
  965|      0|#endif
  966|      0|        return general_set_uint(p, &val, sizeof(val));
  967|  2.69k|    } 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|  2.69k|    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|  2.69k|}
OSSL_PARAM_set_size_t:
 1033|  2.69k|{
 1034|  2.69k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1035|  2.69k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1035:13): [Folded - Ignored]
  ------------------
 1036|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1036:5): [True: 0, False: 2.69k]
  ------------------
 1037|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
 1038|  2.69k|    case sizeof(uint64_t):
  ------------------
  |  Branch (1038:5): [True: 2.69k, False: 0]
  ------------------
 1039|  2.69k|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
 1040|  2.69k|    }
 1041|      0|#endif
 1042|      0|    return general_set_uint(p, &val, sizeof(val));
 1043|  2.69k|}
OSSL_PARAM_construct_size_t:
 1046|  2.69k|{
 1047|  2.69k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  2.69k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
 1048|  2.69k|                                sizeof(size_t));
 1049|  2.69k|}
OSSL_PARAM_construct_time_t:
 1078|      2|{
 1079|      2|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(time_t));
  ------------------
  |  |  106|      2|# define OSSL_PARAM_INTEGER              1
  ------------------
 1080|      2|}
OSSL_PARAM_construct_utf8_string:
 1462|      2|{
 1463|      2|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1463:9): [True: 2, False: 0]
  |  Branch (1463:24): [True: 2, False: 0]
  ------------------
 1464|      2|        bsize = strlen(buf);
 1465|      2|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|      2|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1466|      2|}
OSSL_PARAM_construct_end:
 1661|    132|{
 1662|    132|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|    132|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1663|       |
 1664|    132|    return end;
 1665|    132|}
params.c:ossl_param_construct:
   69|  3.61k|{
   70|  3.61k|    OSSL_PARAM res;
   71|       |
   72|  3.61k|    res.key = key;
   73|  3.61k|    res.data_type = data_type;
   74|  3.61k|    res.data = data;
   75|  3.61k|    res.data_size = data_size;
   76|  3.61k|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|  3.61k|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   77|  3.61k|    return res;
   78|  3.61k|}

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|    136|{
   68|    136|    PROPERTY_DEFN_ELEM elem, *r;
   69|    136|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
  ------------------
  |  |  149|    136|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   70|       |
   71|    136|    property_defns = ossl_lib_ctx_get_data(ctx,
   72|    136|                                           OSSL_LIB_CTX_PROPERTY_DEFN_INDEX);
  ------------------
  |  |  100|    136|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
   73|    136|    if (!ossl_assert(property_defns != NULL) || !ossl_lib_ctx_read_lock(ctx))
  ------------------
  |  |   52|    272|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    272|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (73:9): [True: 0, False: 136]
  |  Branch (73:49): [True: 0, False: 136]
  ------------------
   74|      0|        return NULL;
   75|       |
   76|    136|    elem.prop = prop;
   77|    136|    r = lh_PROPERTY_DEFN_ELEM_retrieve(property_defns, &elem);
   78|    136|    ossl_lib_ctx_unlock(ctx);
   79|    136|    if (r == NULL || !ossl_assert(r->defn != NULL))
  ------------------
  |  |   52|    134|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    134|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (79:9): [True: 2, False: 134]
  |  Branch (79:22): [True: 0, False: 134]
  ------------------
   80|      2|        return NULL;
   81|    134|    return r->defn;
   82|    136|}
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|    140|{
   36|    140|    return OPENSSL_LH_strhash(a->prop);
   37|    140|}
defn_cache.c:property_defn_cmp:
   41|    134|{
   42|    134|    return strcmp(a->prop, b->prop);
   43|    134|}

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|      3|{
  132|      3|    OSSL_GLOBAL_PROPERTIES *globp;
  133|       |
  134|      3|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  135|      3|    if (loadconfig && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  472|      0|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (135:9): [True: 0, False: 3]
  |  Branch (135:23): [True: 0, False: 0]
  ------------------
  136|      0|        return NULL;
  137|      3|#endif
  138|      3|    globp = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_GLOBAL_PROPERTIES);
  ------------------
  |  |  114|      3|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  139|       |
  140|      3|    return globp != NULL ? &globp->list : NULL;
  ------------------
  |  Branch (140:12): [True: 3, False: 0]
  ------------------
  141|      3|}
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|      6|{
  274|      6|    return store != NULL ? CRYPTO_THREAD_write_lock(store->biglock) : 0;
  ------------------
  |  Branch (274:12): [True: 6, False: 0]
  ------------------
  275|      6|}
ossl_method_unlock_store:
  278|      6|{
  279|      6|    return store != NULL ? CRYPTO_THREAD_unlock(store->biglock) : 0;
  ------------------
  |  Branch (279:12): [True: 6, False: 0]
  ------------------
  280|      6|}
ossl_method_store_add:
  321|    136|{
  322|    136|    ALGORITHM *alg = NULL;
  323|    136|    IMPLEMENTATION *impl;
  324|    136|    int ret = 0;
  325|    136|    int i;
  326|       |
  327|    136|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (327:9): [True: 0, False: 136]
  |  Branch (327:21): [True: 0, False: 136]
  |  Branch (327:39): [True: 0, False: 136]
  ------------------
  328|      0|        return 0;
  329|       |
  330|    136|    if (properties == NULL)
  ------------------
  |  Branch (330:9): [True: 0, False: 136]
  ------------------
  331|      0|        properties = "";
  332|       |
  333|    136|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|    136|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    136|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (333:9): [True: 0, False: 136]
  ------------------
  334|      0|        return 0;
  335|       |
  336|       |    /* Create new entry */
  337|    136|    impl = OPENSSL_malloc(sizeof(*impl));
  ------------------
  |  |  102|    136|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    136|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    136|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  338|    136|    if (impl == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 136]
  ------------------
  339|      0|        return 0;
  340|    136|    impl->method.method = method;
  341|    136|    impl->method.up_ref = method_up_ref;
  342|    136|    impl->method.free = method_destruct;
  343|    136|    if (!ossl_method_up_ref(&impl->method)) {
  ------------------
  |  Branch (343:9): [True: 0, False: 136]
  ------------------
  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|    136|    impl->provider = prov;
  348|       |
  349|       |    /* Insert into the hash table if required */
  350|    136|    if (!ossl_property_write_lock(store)) {
  ------------------
  |  Branch (350:9): [True: 0, False: 136]
  ------------------
  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|    136|    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|    136|    if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
  ------------------
  |  Branch (373:9): [True: 2, False: 134]
  ------------------
  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|    136|    alg = ossl_method_store_retrieve(store, nid);
  389|    136|    if (alg == NULL) {
  ------------------
  |  Branch (389:9): [True: 136, False: 0]
  ------------------
  390|    136|        if ((alg = OPENSSL_zalloc(sizeof(*alg))) == NULL
  ------------------
  |  |  104|    136|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    136|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    136|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (390:13): [True: 0, False: 136]
  ------------------
  391|    136|                || (alg->impls = sk_IMPLEMENTATION_new_null()) == NULL
  ------------------
  |  Branch (391:20): [True: 0, False: 136]
  ------------------
  392|    136|                || (alg->cache = lh_QUERY_new(&query_hash, &query_cmp)) == NULL)
  ------------------
  |  Branch (392:20): [True: 0, False: 136]
  ------------------
  393|      0|            goto err;
  394|    136|        alg->nid = nid;
  395|    136|        if (!ossl_method_store_insert(store, alg))
  ------------------
  |  Branch (395:13): [True: 0, False: 136]
  ------------------
  396|      0|            goto err;
  397|    136|        OSSL_TRACE2(QUERY, "Inserted an alg with nid %d into the store %p\n", nid, (void *)store);
  ------------------
  |  |  293|    136|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|    136|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  398|    136|    }
  399|       |
  400|       |    /* Push onto stack if there isn't one there already */
  401|    136|    for (i = 0; i < sk_IMPLEMENTATION_num(alg->impls); i++) {
  ------------------
  |  Branch (401:17): [True: 0, False: 136]
  ------------------
  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|    136|    if (i == sk_IMPLEMENTATION_num(alg->impls)
  ------------------
  |  Branch (409:9): [True: 136, False: 0]
  ------------------
  410|    136|        && sk_IMPLEMENTATION_push(alg->impls, impl)) {
  ------------------
  |  Branch (410:12): [True: 136, False: 0]
  ------------------
  411|    136|        ret = 1;
  412|    136|#ifndef FIPS_MODULE
  413|    136|        OSSL_TRACE_BEGIN(QUERY) {
  ------------------
  |  |  220|    136|    do {                                        \
  |  |  221|    136|        BIO *trc_out = NULL;                    \
  |  |  222|    136|        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|    136|        } OSSL_TRACE_END(QUERY);
  ------------------
  |  |  225|    136|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  420|    136|#endif
  421|    136|    }
  422|    136|    ossl_property_unlock(store);
  423|    136|    if (ret == 0)
  ------------------
  |  Branch (423:9): [True: 0, False: 136]
  ------------------
  424|      0|        impl_free(impl);
  425|    136|    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|    136|}
ossl_method_store_fetch:
  624|      3|{
  625|      3|    OSSL_PROPERTY_LIST **plp;
  626|      3|    ALGORITHM *alg;
  627|      3|    IMPLEMENTATION *impl, *best_impl = NULL;
  628|      3|    OSSL_PROPERTY_LIST *pq = NULL, *p2 = NULL;
  629|      3|    const OSSL_PROVIDER *prov = prov_rw != NULL ? *prov_rw : NULL;
  ------------------
  |  Branch (629:33): [True: 3, False: 0]
  ------------------
  630|      3|    int ret = 0;
  631|      3|    int j, best = -1, score, optional;
  632|       |
  633|      3|    if (nid <= 0 || method == NULL || store == NULL)
  ------------------
  |  Branch (633:9): [True: 0, False: 3]
  |  Branch (633:21): [True: 0, False: 3]
  |  Branch (633:39): [True: 0, False: 3]
  ------------------
  634|      0|        return 0;
  635|       |
  636|      3|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_AUTOLOAD_CONFIG)
  637|      3|    if (ossl_lib_ctx_is_default(store->ctx)
  ------------------
  |  Branch (637:9): [True: 3, False: 0]
  ------------------
  638|      3|            && !OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL))
  ------------------
  |  |  472|      3|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (638:16): [True: 0, False: 3]
  ------------------
  639|      0|        return 0;
  640|      3|#endif
  641|       |
  642|       |    /* This only needs to be a read lock, because the query won't create anything */
  643|      3|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (643:9): [True: 0, False: 3]
  ------------------
  644|      0|        return 0;
  645|       |
  646|      3|    OSSL_TRACE2(QUERY, "Retrieving by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|      3|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      3|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  647|      3|    alg = ossl_method_store_retrieve(store, nid);
  648|      3|    if (alg == NULL) {
  ------------------
  |  Branch (648:9): [True: 0, False: 3]
  ------------------
  649|      0|        ossl_property_unlock(store);
  650|      0|        OSSL_TRACE2(QUERY, "Failed to retrieve by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|      0|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  651|      0|        return 0;
  652|      0|    }
  653|      3|    OSSL_TRACE2(QUERY, "Retrieved by nid %d from store %p\n", nid, (void *)store);
  ------------------
  |  |  293|      3|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2))
  |  |  ------------------
  |  |  |  |  283|      3|#  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|      3|    if (prop_query != NULL)
  ------------------
  |  Branch (659:9): [True: 3, False: 0]
  ------------------
  660|      3|        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|      3|    plp = ossl_ctx_global_properties(store->ctx, 0);
  667|      3|    if (plp != NULL && *plp != NULL) {
  ------------------
  |  Branch (667:9): [True: 3, False: 0]
  |  Branch (667:24): [True: 0, False: 3]
  ------------------
  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|      3|    if (pq == NULL) {
  ------------------
  |  Branch (686:9): [True: 0, False: 3]
  ------------------
  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|      3|    optional = ossl_property_has_optional(pq);
  704|      3|    for (j = 0; j < sk_IMPLEMENTATION_num(alg->impls); j++) {
  ------------------
  |  Branch (704:17): [True: 3, False: 0]
  ------------------
  705|      3|        if ((impl = sk_IMPLEMENTATION_value(alg->impls, j)) != NULL
  ------------------
  |  Branch (705:13): [True: 3, False: 0]
  ------------------
  706|      3|            && (prov == NULL || impl->provider == prov)) {
  ------------------
  |  Branch (706:17): [True: 3, False: 0]
  |  Branch (706:33): [True: 0, False: 0]
  ------------------
  707|      3|            score = ossl_property_match_count(pq, impl->properties);
  708|      3|            if (score > best) {
  ------------------
  |  Branch (708:17): [True: 3, False: 0]
  ------------------
  709|      3|                best_impl = impl;
  710|      3|                best = score;
  711|      3|                ret = 1;
  712|      3|                if (!optional)
  ------------------
  |  Branch (712:21): [True: 3, False: 0]
  ------------------
  713|      3|                    goto fin;
  714|      3|            }
  715|      3|        }
  716|      3|    }
  717|      3|fin:
  718|      3|    if (ret && ossl_method_up_ref(&best_impl->method)) {
  ------------------
  |  Branch (718:9): [True: 3, False: 0]
  |  Branch (718:16): [True: 3, False: 0]
  ------------------
  719|      3|        *method = best_impl->method.method;
  720|      3|        if (prov_rw != NULL)
  ------------------
  |  Branch (720:13): [True: 3, False: 0]
  ------------------
  721|      3|            *prov_rw = best_impl->provider;
  722|      3|    } else {
  723|      0|        ret = 0;
  724|      0|    }
  725|       |
  726|      3|#ifndef FIPS_MODULE
  727|      3|    OSSL_TRACE_BEGIN(QUERY) {
  ------------------
  |  |  220|      3|    do {                                        \
  |  |  221|      3|        BIO *trc_out = NULL;                    \
  |  |  222|      3|        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|      3|    } OSSL_TRACE_END(QUERY);
  ------------------
  |  |  225|      3|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
  738|      3|#endif
  739|       |
  740|      3|    ossl_property_unlock(store);
  741|      3|    ossl_property_free(p2);
  742|      3|    return ret;
  743|      3|}
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|  1.15k|{
  847|  1.15k|    ALGORITHM *alg;
  848|  1.15k|    QUERY elem, *r;
  849|  1.15k|    int res = 0;
  850|       |
  851|  1.15k|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (851:9): [True: 0, False: 1.15k]
  |  Branch (851:21): [True: 0, False: 1.15k]
  |  Branch (851:38): [True: 0, False: 1.15k]
  ------------------
  852|      0|        return 0;
  853|       |
  854|  1.15k|    if (!ossl_property_read_lock(store))
  ------------------
  |  Branch (854:9): [True: 0, False: 1.15k]
  ------------------
  855|      0|        return 0;
  856|  1.15k|    alg = ossl_method_store_retrieve(store, nid);
  857|  1.15k|    if (alg == NULL)
  ------------------
  |  Branch (857:9): [True: 1, False: 1.15k]
  ------------------
  858|      1|        goto err;
  859|       |
  860|  1.15k|    elem.query = prop_query;
  861|  1.15k|    elem.provider = prov;
  862|  1.15k|    r = lh_QUERY_retrieve(alg->cache, &elem);
  863|  1.15k|    if (r == NULL)
  ------------------
  |  Branch (863:9): [True: 1, False: 1.15k]
  ------------------
  864|      1|        goto err;
  865|  1.15k|    if (ossl_method_up_ref(&r->method)) {
  ------------------
  |  Branch (865:9): [True: 1.15k, False: 0]
  ------------------
  866|  1.15k|        *method = r->method.method;
  867|  1.15k|        res = 1;
  868|  1.15k|    }
  869|  1.15k|err:
  870|  1.15k|    ossl_property_unlock(store);
  871|  1.15k|    return res;
  872|  1.15k|}
ossl_method_store_cache_set:
  878|      3|{
  879|      3|    QUERY elem, *old, *p = NULL;
  880|      3|    ALGORITHM *alg;
  881|      3|    size_t len;
  882|      3|    int res = 1;
  883|       |
  884|      3|    if (nid <= 0 || store == NULL || prop_query == NULL)
  ------------------
  |  Branch (884:9): [True: 0, False: 3]
  |  Branch (884:21): [True: 0, False: 3]
  |  Branch (884:38): [True: 0, False: 3]
  ------------------
  885|      0|        return 0;
  886|       |
  887|      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 (887:9): [True: 0, False: 3]
  ------------------
  888|      0|        return 0;
  889|       |
  890|      3|    if (!ossl_property_write_lock(store))
  ------------------
  |  Branch (890:9): [True: 0, False: 3]
  ------------------
  891|      0|        return 0;
  892|      3|    if (store->cache_need_flush)
  ------------------
  |  Branch (892:9): [True: 0, False: 3]
  ------------------
  893|      0|        ossl_method_cache_flush_some(store);
  894|      3|    alg = ossl_method_store_retrieve(store, nid);
  895|      3|    if (alg == NULL)
  ------------------
  |  Branch (895:9): [True: 0, False: 3]
  ------------------
  896|      0|        goto err;
  897|       |
  898|      3|    if (method == NULL) {
  ------------------
  |  Branch (898:9): [True: 0, False: 3]
  ------------------
  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|      3|    p = OPENSSL_malloc(sizeof(*p) + (len = strlen(prop_query)));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  908|      3|    if (p != NULL) {
  ------------------
  |  Branch (908:9): [True: 3, False: 0]
  ------------------
  909|      3|        p->query = p->body;
  910|      3|        p->provider = prov;
  911|      3|        p->method.method = method;
  912|      3|        p->method.up_ref = method_up_ref;
  913|      3|        p->method.free = method_destruct;
  914|      3|        if (!ossl_method_up_ref(&p->method))
  ------------------
  |  Branch (914:13): [True: 0, False: 3]
  ------------------
  915|      0|            goto err;
  916|      3|        memcpy((char *)p->query, prop_query, len + 1);
  917|      3|        if ((old = lh_QUERY_insert(alg->cache, p)) != NULL) {
  ------------------
  |  Branch (917:13): [True: 0, False: 3]
  ------------------
  918|      0|            impl_cache_free(old);
  919|      0|            goto end;
  920|      0|        }
  921|      3|        if (!lh_QUERY_error(alg->cache)) {
  ------------------
  |  Branch (921:13): [True: 3, False: 0]
  ------------------
  922|      3|            if (++store->cache_nelem >= IMPL_CACHE_FLUSH_THRESHOLD)
  ------------------
  |  |   34|      3|#define IMPL_CACHE_FLUSH_THRESHOLD  500
  ------------------
  |  Branch (922:17): [True: 0, False: 3]
  ------------------
  923|      0|                store->cache_need_flush = 1;
  924|      3|            goto end;
  925|      3|        }
  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|      3|end:
  932|      3|    ossl_property_unlock(store);
  933|      3|    return res;
  934|      0|}
property.c:alg_cleanup:
  226|    136|{
  227|    136|    OSSL_METHOD_STORE *store = arg;
  228|       |
  229|    136|    if (a != NULL) {
  ------------------
  |  Branch (229:9): [True: 136, False: 0]
  ------------------
  230|    136|        sk_IMPLEMENTATION_pop_free(a->impls, &impl_free);
  231|    136|        lh_QUERY_doall(a->cache, &impl_cache_free);
  232|    136|        lh_QUERY_free(a->cache);
  233|    136|        OPENSSL_free(a);
  ------------------
  |  |  115|    136|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    136|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    136|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|    136|    }
  235|    136|    if (store != NULL)
  ------------------
  |  Branch (235:9): [True: 136, False: 0]
  ------------------
  236|    136|        ossl_sa_ALGORITHM_set(store->algs, idx, NULL);
  237|    136|}
property.c:ossl_method_up_ref:
  163|  1.29k|{
  164|  1.29k|    return (*method->up_ref)(method->method);
  165|  1.29k|}
property.c:ossl_property_write_lock:
  178|    147|{
  179|    147|    return p != NULL ? CRYPTO_THREAD_write_lock(p->lock) : 0;
  ------------------
  |  Branch (179:12): [True: 147, False: 0]
  ------------------
  180|    147|}
property.c:impl_free:
  204|    136|{
  205|    136|    if (impl != NULL) {
  ------------------
  |  Branch (205:9): [True: 136, False: 0]
  ------------------
  206|    136|        ossl_method_free(&impl->method);
  207|    136|        OPENSSL_free(impl);
  ------------------
  |  |  115|    136|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    136|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    136|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  208|    136|    }
  209|    136|}
property.c:ossl_method_store_retrieve:
  283|  1.43k|{
  284|  1.43k|    return ossl_sa_ALGORITHM_get(store->algs, nid);
  285|  1.43k|}
property.c:query_hash:
  188|  1.15k|{
  189|  1.15k|    return OPENSSL_LH_strhash(a->query);
  190|  1.15k|}
property.c:query_cmp:
  193|  1.15k|{
  194|  1.15k|    int res = strcmp(a->query, b->query);
  195|       |
  196|  1.15k|    if (res == 0 && a->provider != NULL && b->provider != NULL)
  ------------------
  |  Branch (196:9): [True: 1.15k, False: 0]
  |  Branch (196:21): [True: 1.15k, False: 0]
  |  Branch (196:44): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    return res;
  201|  1.15k|}
property.c:ossl_method_store_insert:
  288|    136|{
  289|    136|    return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg);
  290|    136|}
property.c:ossl_property_unlock:
  183|  1.30k|{
  184|  1.30k|    return p != 0 ? CRYPTO_THREAD_unlock(p->lock) : 0;
  ------------------
  |  Branch (184:12): [True: 1.30k, False: 0]
  ------------------
  185|  1.30k|}
property.c:ossl_property_read_lock:
  173|  1.15k|{
  174|  1.15k|    return p != NULL ? CRYPTO_THREAD_read_lock(p->lock) : 0;
  ------------------
  |  Branch (174:12): [True: 1.15k, False: 0]
  ------------------
  175|  1.15k|}
property.c:ossl_method_cache_flush:
  753|    136|{
  754|    136|    ALGORITHM *alg = ossl_method_store_retrieve(store, nid);
  755|       |
  756|    136|    if (alg != NULL)
  ------------------
  |  Branch (756:9): [True: 0, False: 136]
  ------------------
  757|      0|        ossl_method_cache_flush_alg(store, alg);
  758|    136|}
property.c:impl_cache_free:
  212|      3|{
  213|      3|    if (elem != NULL) {
  ------------------
  |  Branch (213:9): [True: 3, False: 0]
  ------------------
  214|      3|        ossl_method_free(&elem->method);
  215|      3|        OPENSSL_free(elem);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  216|      3|    }
  217|      3|}
property.c:ossl_method_free:
  168|    139|{
  169|    139|    (*method->free)(method->method);
  170|    139|}

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|      3|{
  407|      3|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|      3|# define STACK_OF(type) struct stack_st_##type
  ------------------
  408|      3|    OSSL_PROPERTY_LIST *res = NULL;
  409|      3|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  410|      3|    int done;
  411|       |
  412|      3|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 3]
  |  Branch (412:22): [True: 0, False: 3]
  ------------------
  413|      0|        return NULL;
  414|       |
  415|      3|    s = skip_space(s);
  416|      3|    done = *s == '\0';
  417|      3|    while (!done) {
  ------------------
  |  Branch (417:12): [True: 0, False: 3]
  ------------------
  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|      3|    if (*s != '\0') {
  ------------------
  |  Branch (454:9): [True: 0, False: 3]
  ------------------
  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|      3|    res = stack_to_property_list(ctx, sk);
  460|       |
  461|      3|err:
  462|      3|    OPENSSL_free(prop);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  463|      3|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  464|      3|    return res;
  465|      3|}
ossl_property_match_count:
  473|      3|{
  474|      3|    const OSSL_PROPERTY_DEFINITION *const q = query->properties;
  475|      3|    const OSSL_PROPERTY_DEFINITION *const d = defn->properties;
  476|      3|    int i = 0, j = 0, matches = 0;
  477|      3|    OSSL_PROPERTY_OPER oper;
  478|       |
  479|      3|    while (i < query->num_properties) {
  ------------------
  |  Branch (479:12): [True: 0, False: 3]
  ------------------
  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|      3|    return matches;
  527|      3|}
ossl_property_free:
  530|      7|{
  531|      7|    OPENSSL_free(p);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  532|      7|}
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|     11|{
   27|     11|    while (ossl_isspace(*s))
  ------------------
  |  |   82|     11|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|     11|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 0, False: 11]
  |  |  ------------------
  ------------------
   28|      0|        s++;
   29|     11|    return s;
   30|     11|}
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|      5|{
  315|      5|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  316|      5|    OSSL_PROPERTY_LIST *r;
  317|      5|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  318|      5|    int i;
  319|       |
  320|      5|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |  102|     10|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (102:23): [True: 3, False: 2]
  |  |  ------------------
  ------------------
  321|      5|                       + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  322|      5|    if (r != NULL) {
  ------------------
  |  Branch (322:9): [True: 5, False: 0]
  ------------------
  323|      5|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  324|       |
  325|      5|        r->has_optional = 0;
  326|      7|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (326:21): [True: 2, False: 5]
  ------------------
  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|      5|        r->num_properties = n;
  341|      5|    }
  342|      5|    return r;
  343|      5|}
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|      3|{
   64|      3|    return query->has_optional ? 1 : 0;
  ------------------
  |  Branch (64:12): [True: 0, False: 3]
  ------------------
   65|      3|}

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_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_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|    138|{
  478|    138|    int ref = 0;
  479|       |
  480|    138|    if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0)
  ------------------
  |  Branch (480:9): [True: 0, False: 138]
  ------------------
  481|      0|        return 0;
  482|       |
  483|    138|#ifndef FIPS_MODULE
  484|    138|    if (prov->ischild) {
  ------------------
  |  Branch (484:9): [True: 0, False: 138]
  ------------------
  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|    138|#endif
  491|       |
  492|    138|    return ref;
  493|    138|}
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|    139|{
  726|    139|    if (prov != NULL) {
  ------------------
  |  Branch (726:9): [True: 139, False: 0]
  ------------------
  727|    139|        int ref = 0;
  728|       |
  729|    139|        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|    139|        if (ref == 0) {
  ------------------
  |  Branch (739:13): [True: 1, False: 138]
  ------------------
  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|    138|#ifndef FIPS_MODULE
  776|    138|        else if (prov->ischild) {
  ------------------
  |  Branch (776:18): [True: 0, False: 138]
  ------------------
  777|      0|            ossl_provider_free_parent(prov, 0);
  778|      0|        }
  779|    139|#endif
  780|    139|    }
  781|    139|}
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|  1.28k|{
 1428|  1.28k|    return prov != NULL ? prov->provctx : NULL;
  ------------------
  |  Branch (1428:12): [True: 1.28k, False: 0]
  ------------------
 1429|  1.28k|}
ossl_provider_doall_activated:
 1528|      3|{
 1529|      3|    int ret = 0, curr, max, ref = 0;
 1530|      3|    struct provider_store_st *store = get_provider_store(ctx);
 1531|      3|    STACK_OF(OSSL_PROVIDER) *provs = NULL;
  ------------------
  |  |   31|      3|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1532|       |
 1533|      3|#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|      3|    if (ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (1538:9): [True: 3, False: 0]
  ------------------
 1539|      3|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|      3|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
 1540|      3|#endif
 1541|       |
 1542|      3|    if (store == NULL)
  ------------------
  |  Branch (1542:9): [True: 0, False: 3]
  ------------------
 1543|      0|        return 1;
 1544|      3|    if (!provider_activate_fallbacks(store))
  ------------------
  |  Branch (1544:9): [True: 0, False: 3]
  ------------------
 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|      3|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1551:9): [True: 0, False: 3]
  ------------------
 1552|      0|        return 0;
 1553|      3|    provs = sk_OSSL_PROVIDER_dup(store->providers);
 1554|      3|    if (provs == NULL) {
  ------------------
  |  Branch (1554:9): [True: 0, False: 3]
  ------------------
 1555|      0|        CRYPTO_THREAD_unlock(store->lock);
 1556|      0|        return 0;
 1557|      0|    }
 1558|      3|    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|      9|    for (curr = max - 1; curr >= 0; curr--) {
  ------------------
  |  Branch (1563:26): [True: 6, False: 3]
  ------------------
 1564|      6|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1565|       |
 1566|      6|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1566:13): [True: 0, False: 6]
  ------------------
 1567|      0|            goto err_unlock;
 1568|      6|        if (prov->flag_activated) {
  ------------------
  |  Branch (1568:13): [True: 6, 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|      6|            if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0) {
  ------------------
  |  Branch (1574:17): [True: 0, False: 6]
  ------------------
 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|      6|            if (!CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1584:17): [True: 0, False: 6]
  ------------------
 1585|      6|                                   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|      6|        } else {
 1591|      0|            sk_OSSL_PROVIDER_delete(provs, curr);
 1592|      0|            max--;
 1593|      0|        }
 1594|      6|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1595|      6|    }
 1596|      3|    CRYPTO_THREAD_unlock(store->lock);
 1597|       |
 1598|       |    /*
 1599|       |     * Now, we sweep through all providers not under lock
 1600|       |     */
 1601|      9|    for (curr = 0; curr < max; curr++) {
  ------------------
  |  Branch (1601:20): [True: 6, False: 3]
  ------------------
 1602|      6|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1603|       |
 1604|      6|        if (!cb(prov, cbdata)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 6]
  ------------------
 1605|      0|            curr = -1;
 1606|      0|            goto finish;
 1607|      0|        }
 1608|      6|    }
 1609|      3|    curr = -1;
 1610|       |
 1611|      3|    ret = 1;
 1612|      3|    goto finish;
 1613|       |
 1614|      0| err_unlock:
 1615|      0|    CRYPTO_THREAD_unlock(store->lock);
 1616|      3| 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|      9|    for (curr++; curr < max; curr++) {
  ------------------
  |  Branch (1622:18): [True: 6, False: 3]
  ------------------
 1623|      6|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1624|       |
 1625|      6|        if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &ref,
  ------------------
  |  Branch (1625:13): [True: 0, False: 6]
  ------------------
 1626|      6|                               prov->activatecnt_lock)) {
 1627|      0|            ret = 0;
 1628|      0|            continue;
 1629|      0|        }
 1630|      6|        if (ref < 1) {
  ------------------
  |  Branch (1630:13): [True: 0, False: 6]
  ------------------
 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|      6|        if (!CRYPTO_DOWN_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1647:13): [True: 0, False: 6]
  ------------------
 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|      6|        assert(ref > 0);
 1656|      6|    }
 1657|      3|    sk_OSSL_PROVIDER_free(provs);
 1658|      3|    return ret;
 1659|      3|}
ossl_provider_name:
 1683|      2|{
 1684|      2|    return prov->name;
 1685|      2|}
ossl_provider_libctx:
 1720|    266|{
 1721|    266|    return prov != NULL ? prov->libctx : NULL;
  ------------------
  |  Branch (1721:12): [True: 266, False: 0]
  ------------------
 1722|    266|}
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_query_operation:
 1936|      6|{
 1937|      6|    const OSSL_ALGORITHM *res;
 1938|       |
 1939|      6|    if (prov->query_operation == NULL) {
  ------------------
  |  Branch (1939:9): [True: 0, False: 6]
  ------------------
 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|      6|    res = prov->query_operation(prov->provctx, operation_id, no_cache);
 1950|      6|#ifndef FIPS_MODULE
 1951|      6|    OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      6|    do {                                        \
  |  |  221|      6|        BIO *trc_out = NULL;                    \
  |  |  222|      6|        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|      6|    } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      6|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1972|      6|#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|      6|    return res;
 1980|      6|}
ossl_provider_unquery_operation:
 1999|      6|{
 2000|      6|    if (prov->unquery_operation != NULL) {
  ------------------
  |  Branch (2000:9): [True: 0, False: 6]
  ------------------
 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|      6|}
ossl_provider_set_operation_bit:
 2015|      4|{
 2016|      4|    size_t byte = bitnum / 8;
 2017|      4|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2018|       |
 2019|      4|    if (!CRYPTO_THREAD_write_lock(provider->opbits_lock))
  ------------------
  |  Branch (2019:9): [True: 0, False: 4]
  ------------------
 2020|      0|        return 0;
 2021|      4|    if (provider->operation_bits_sz <= byte) {
  ------------------
  |  Branch (2021:9): [True: 2, False: 2]
  ------------------
 2022|      2|        unsigned char *tmp = OPENSSL_realloc(provider->operation_bits,
  ------------------
  |  |  109|      2|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2023|      2|                                             byte + 1);
 2024|       |
 2025|      2|        if (tmp == NULL) {
  ------------------
  |  Branch (2025:13): [True: 0, False: 2]
  ------------------
 2026|      0|            CRYPTO_THREAD_unlock(provider->opbits_lock);
 2027|      0|            return 0;
 2028|      0|        }
 2029|      2|        provider->operation_bits = tmp;
 2030|      2|        memset(provider->operation_bits + provider->operation_bits_sz,
 2031|      2|               '\0', byte + 1 - provider->operation_bits_sz);
 2032|      2|        provider->operation_bits_sz = byte + 1;
 2033|      2|    }
 2034|      4|    provider->operation_bits[byte] |= bit;
 2035|      4|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2036|      4|    return 1;
 2037|      4|}
ossl_provider_test_operation_bit:
 2041|      6|{
 2042|      6|    size_t byte = bitnum / 8;
 2043|      6|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2044|       |
 2045|      6|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|      6|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      6|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2045:9): [True: 0, False: 6]
  ------------------
 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|      6|    *result = 0;
 2051|      6|    if (!CRYPTO_THREAD_read_lock(provider->opbits_lock))
  ------------------
  |  Branch (2051:9): [True: 0, False: 6]
  ------------------
 2052|      0|        return 0;
 2053|      6|    if (provider->operation_bits_sz > byte)
  ------------------
  |  Branch (2053:9): [True: 4, False: 2]
  ------------------
 2054|      4|        *result = ((provider->operation_bits[byte] & bit) != 0);
 2055|      6|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2056|      6|    return 1;
 2057|      6|}
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|     19|{
  331|     19|    struct provider_store_st *store = NULL;
  332|       |
  333|     19|    store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX);
  ------------------
  |  |   99|     19|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  334|     19|    if (store == NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 19]
  ------------------
  335|     19|        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|     19|    return store;
  337|     19|}
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|      3|{
 1438|      3|    int use_fallbacks;
 1439|      3|    int activated_fallback_count = 0;
 1440|      3|    int ret = 0;
 1441|      3|    const OSSL_PROVIDER_INFO *p;
 1442|       |
 1443|      3|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1443:9): [True: 0, False: 3]
  ------------------
 1444|      0|        return 0;
 1445|      3|    use_fallbacks = store->use_fallbacks;
 1446|      3|    CRYPTO_THREAD_unlock(store->lock);
 1447|      3|    if (!use_fallbacks)
  ------------------
  |  Branch (1447:9): [True: 2, False: 1]
  ------------------
 1448|      2|        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|  1.15k|{
  287|  1.15k|    const RAND_METHOD *tmp_meth = NULL;
  288|       |
  289|  1.15k|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|  1.15k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.15k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (289:9): [True: 0, False: 1.15k]
  ------------------
  290|      0|        return NULL;
  291|       |
  292|  1.15k|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 1.15k]
  ------------------
  293|      0|        return NULL;
  294|       |
  295|  1.15k|    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
  ------------------
  |  Branch (295:9): [True: 0, False: 1.15k]
  ------------------
  296|      0|        return NULL;
  297|  1.15k|    tmp_meth = default_RAND_meth;
  298|  1.15k|    CRYPTO_THREAD_unlock(rand_meth_lock);
  299|  1.15k|    if (tmp_meth != NULL)
  ------------------
  |  Branch (299:9): [True: 1.15k, False: 1]
  ------------------
  300|  1.15k|        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|  1.15k|{
  439|  1.15k|    RAND_GLOBAL *dgbl;
  440|  1.15k|    EVP_RAND_CTX *rand;
  441|  1.15k|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  442|  1.15k|    const RAND_METHOD *meth = RAND_get_rand_method();
  443|       |
  444|  1.15k|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (444:9): [True: 1.15k, False: 0]
  |  Branch (444:25): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|#endif
  451|       |
  452|  1.15k|    dgbl = rand_get_global(ctx);
  453|  1.15k|    if (dgbl == NULL)
  ------------------
  |  Branch (453:9): [True: 0, False: 1.15k]
  ------------------
  454|      0|        return 0;
  455|  1.15k|#ifndef FIPS_MODULE
  456|  1.15k|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (456:9): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|#endif      /* !FIPS_MODULE */
  461|  1.15k|    rand = rand_get0_private(ctx, dgbl);
  462|  1.15k|    if (rand != NULL)
  ------------------
  |  Branch (462:9): [True: 1.15k, False: 0]
  ------------------
  463|  1.15k|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  464|       |
  465|      0|    return 0;
  466|  1.15k|}
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|  1.16k|{
  101|  1.16k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  103|  1.16k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  102|  1.16k|}
rand_lib.c:rand_get0_primary:
  760|      1|{
  761|      1|    EVP_RAND_CTX *ret, *seed, *newseed = NULL, *primary;
  762|       |
  763|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (763:9): [True: 0, False: 1]
  ------------------
  764|      0|        return NULL;
  765|       |
  766|      1|    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
  ------------------
  |  Branch (766:9): [True: 0, False: 1]
  ------------------
  767|      0|        return NULL;
  768|       |
  769|      1|    ret = dgbl->primary;
  770|      1|    seed = dgbl->seed;
  771|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  772|       |
  773|      1|    if (ret != NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 1]
  ------------------
  774|      0|        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|      2|{
  669|      2|    EVP_RAND *rand;
  670|      2|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  671|      2|    EVP_RAND_CTX *ctx;
  672|      2|    OSSL_PARAM params[9], *p = params;
  673|      2|    const OSSL_PARAM *settables;
  674|      2|    const char *prov_name;
  675|      2|    char *name, *cipher;
  676|      2|    int use_df = 1;
  677|       |
  678|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 2]
  ------------------
  679|      0|        return NULL;
  680|      2|    name = dgbl->rng_name != NULL ? dgbl->rng_name : "CTR-DRBG";
  ------------------
  |  Branch (680:12): [True: 2, False: 0]
  ------------------
  681|      2|    rand = EVP_RAND_fetch(libctx, name, dgbl->rng_propq);
  682|      2|    if (rand == NULL) {
  ------------------
  |  Branch (682:9): [True: 0, False: 2]
  ------------------
  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|      2|    prov_name = ossl_provider_name(EVP_RAND_get0_provider(rand));
  687|      2|    ctx = EVP_RAND_CTX_new(rand, parent);
  688|      2|    EVP_RAND_free(rand);
  689|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (689:9): [True: 0, False: 2]
  ------------------
  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|      2|    settables = EVP_RAND_CTX_settable_params(ctx);
  695|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_CIPHER)) {
  ------------------
  |  |  227|      2|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      2|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (695:9): [True: 0, False: 2]
  ------------------
  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|      2|    if (dgbl->rng_digest != NULL
  ------------------
  |  Branch (700:9): [True: 0, False: 2]
  ------------------
  701|      2|            && 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|      2|    if (prov_name != NULL)
  ------------------
  |  Branch (704:9): [True: 2, False: 0]
  ------------------
  705|      2|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_CORE_PROV_NAME,
  ------------------
  |  |  494|      2|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  706|      2|                                                (char *)prov_name, 0);
  707|      2|    if (dgbl->rng_propq != NULL)
  ------------------
  |  Branch (707:9): [True: 0, False: 2]
  ------------------
  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|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_ALG_PARAM_MAC))
  ------------------
  |  |  125|      2|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  |  Branch (710:9): [True: 0, False: 2]
  ------------------
  711|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_MAC, "HMAC", 0);
  ------------------
  |  |  125|      0|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  712|      2|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_USE_DF))
  ------------------
  |  |  249|      2|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (712:9): [True: 0, False: 2]
  ------------------
  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|      2|    *p++ = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS,
  ------------------
  |  |  245|      2|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  715|      2|                                     &reseed_interval);
  716|      2|    *p++ = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
  ------------------
  |  |  247|      2|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  717|      2|                                       &reseed_time_interval);
  718|      2|    *p = OSSL_PARAM_construct_end();
  719|      2|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, params)) {
  ------------------
  |  Branch (719:9): [True: 0, False: 2]
  ------------------
  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|      2|    return ctx;
  725|      2|}
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|  1.15k|{
  882|  1.15k|    EVP_RAND_CTX *rand, *primary;
  883|       |
  884|  1.15k|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  885|  1.15k|    if (rand == NULL) {
  ------------------
  |  Branch (885:9): [True: 1, False: 1.15k]
  ------------------
  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: 1, False: 0]
  ------------------
  899|      1|                && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (899:20): [True: 0, False: 1]
  ------------------
  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|  1.15k|    return rand;
  906|  1.15k|}
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|  1.15k|{
   64|  1.15k|    return &ossl_rand_meth;
   65|  1.15k|}

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|  1.43k|{
  158|  1.43k|    int level;
  159|  1.43k|    void **p, *r = NULL;
  160|       |
  161|  1.43k|    if (sa == NULL || sa->nelem == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 1.43k]
  |  Branch (161:23): [True: 2, False: 1.43k]
  ------------------
  162|      2|        return NULL;
  163|       |
  164|  1.43k|    if (n <= sa->top) {
  ------------------
  |  Branch (164:9): [True: 1.30k, False: 130]
  ------------------
  165|  1.30k|        p = sa->nodes;
  166|  5.05k|        for (level = sa->levels - 1; p != NULL && level > 0; level--)
  ------------------
  |  Branch (166:38): [True: 4.91k, False: 141]
  |  Branch (166:51): [True: 3.75k, False: 1.16k]
  ------------------
  167|  3.75k|            p = (void **)p[(n >> (OPENSSL_SA_BLOCK_BITS * level))
  ------------------
  |  |   34|  3.75k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  168|  3.75k|                           & SA_BLOCK_MASK];
  ------------------
  |  |   46|  3.75k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  3.75k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.75k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  1.30k|        r = p == NULL ? NULL : p[n & SA_BLOCK_MASK];
  ------------------
  |  |   46|  1.16k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.16k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.16k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (169:13): [True: 141, False: 1.16k]
  ------------------
  170|  1.30k|    }
  171|  1.43k|    return r;
  172|  1.43k|}
ossl_sa_set:
  180|    272|{
  181|    272|    int i, level = 1;
  182|    272|    ossl_uintmax_t n = posn;
  183|    272|    void **p;
  184|       |
  185|    272|    if (sa == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 272]
  ------------------
  186|      0|        return 0;
  187|       |
  188|  1.06k|    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)
  ------------------
  |  |   47|  1.06k|#define SA_BLOCK_MAX_LEVELS     (((int)sizeof(ossl_uintmax_t) * 8 \
  |  |   48|  1.06k|                                  + OPENSSL_SA_BLOCK_BITS - 1) \
  |  |  ------------------
  |  |  |  |   34|  1.06k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  |  |   49|  1.06k|                                 / OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  1.06k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (188:21): [True: 1.06k, False: 0]
  ------------------
  189|  1.06k|        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)
  ------------------
  |  |   34|  1.06k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  |  Branch (189:13): [True: 272, False: 790]
  ------------------
  190|    272|            break;
  191|       |
  192|    276|    for (;sa->levels < level; sa->levels++) {
  ------------------
  |  Branch (192:11): [True: 4, False: 272]
  ------------------
  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|    272|    if (sa->top < posn)
  ------------------
  |  Branch (199:9): [True: 66, False: 206]
  ------------------
  200|     66|        sa->top = posn;
  201|       |
  202|    272|    p = sa->nodes;
  203|  1.08k|    for (level = sa->levels - 1; level > 0; level--) {
  ------------------
  |  Branch (203:34): [True: 816, False: 272]
  ------------------
  204|    816|        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   34|    816|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
                      i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   46|    816|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    816|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    816|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|    816|        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)
  ------------------
  |  Branch (205:13): [True: 282, False: 534]
  |  Branch (205:29): [True: 0, False: 282]
  ------------------
  206|      0|            return 0;
  207|    816|        p = p[i];
  208|    816|    }
  209|    272|    p += posn & SA_BLOCK_MASK;
  ------------------
  |  |   46|    272|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    272|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    272|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|    272|    if (val == NULL && *p != NULL)
  ------------------
  |  Branch (210:9): [True: 136, False: 136]
  |  Branch (210:24): [True: 136, False: 0]
  ------------------
  211|    136|        sa->nelem--;
  212|    136|    else if (val != NULL && *p == NULL)
  ------------------
  |  Branch (212:14): [True: 136, False: 0]
  |  Branch (212:29): [True: 136, False: 0]
  ------------------
  213|    136|        sa->nelem++;
  214|    272|    *p = val;
  215|    272|    return 1;
  216|    272|}
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|  10.1k|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 10.0k, False: 24]
  ------------------
   76|  10.0k|        const int n = i[l];
   77|  10.0k|        void ** const p = nodes[l];
   78|       |
   79|  10.0k|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|  10.0k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  10.0k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 594, False: 9.50k]
  ------------------
   80|    594|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 572, False: 22]
  |  Branch (80:30): [True: 286, False: 286]
  ------------------
   81|    286|                (*node)(p);
   82|    594|            l--;
   83|    594|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|    594|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   84|  9.50k|        } else {
   85|  9.50k|            i[l] = n + 1;
   86|  9.50k|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 9.15k, False: 352]
  |  Branch (86:30): [True: 706, False: 8.44k]
  ------------------
   87|    706|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|    706|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    706|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    706|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|    706|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 570, False: 136]
  ------------------
   89|    570|                    i[++l] = 0;
   90|    570|                    nodes[l] = p[n];
   91|    570|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|    570|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   92|    570|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 136, False: 0]
  ------------------
   93|    136|                    (*leaf)(idx, p[n], arg);
   94|    136|                }
   95|    706|            }
   96|  9.50k|        }
   97|  10.0k|    }
   98|     24|}
sparse_array.c:sa_free_node:
  101|    286|{
  102|    286|    OPENSSL_free(p);
  ------------------
  |  |  115|    286|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    286|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    286|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    286|}
sparse_array.c:alloc_node:
  175|    286|{
  176|    286|    return OPENSSL_zalloc(SA_BLOCK_MAX * sizeof(void *));
  ------------------
  |  |  104|    286|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    286|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    286|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|    286|}

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_dup:
   49|    135|{
   50|    135|    OPENSSL_STACK *ret;
   51|       |
   52|    135|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|    135|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    135|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    135|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (52:9): [True: 0, False: 135]
  ------------------
   53|      0|        goto err;
   54|       |
   55|    135|    if (sk == NULL) {
  ------------------
  |  Branch (55:9): [True: 2, False: 133]
  ------------------
   56|      2|        ret->num = 0;
   57|      2|        ret->sorted = 0;
   58|      2|        ret->comp = NULL;
   59|    133|    } else {
   60|       |        /* direct structure assignment */
   61|    133|        *ret = *sk;
   62|    133|    }
   63|       |
   64|    135|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (64:9): [True: 2, False: 133]
  |  Branch (64:23): [True: 0, False: 133]
  ------------------
   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|    133|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |  102|    133|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    133|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    133|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|    133|    if (ret->data == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 133]
  ------------------
   74|      0|        goto err;
   75|    133|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   76|    133|    return ret;
   77|       |
   78|      0| err:
   79|      0|    OPENSSL_sk_free(ret);
   80|      0|    return NULL;
   81|    133|}
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|    340|{
  133|    340|    return OPENSSL_sk_new_reserve(NULL, 0);
  134|    340|}
OPENSSL_sk_new:
  137|     13|{
  138|     13|    return OPENSSL_sk_new_reserve(c, 0);
  139|     13|}
OPENSSL_sk_new_reserve:
  228|    353|{
  229|    353|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  104|    353|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    353|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    353|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|       |
  231|    353|    if (st == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 353]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|    353|    st->comp = c;
  235|       |
  236|    353|    if (n <= 0)
  ------------------
  |  Branch (236:9): [True: 353, False: 0]
  ------------------
  237|    353|        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|    205|{
  261|    205|    if (st != NULL)
  ------------------
  |  Branch (261:9): [True: 159, False: 46]
  ------------------
  262|    159|        st->free_thunk = f_thunk;
  263|       |
  264|    205|    return st;
  265|    205|}
OPENSSL_sk_insert:
  268|    723|{
  269|    723|    if (st == NULL) {
  ------------------
  |  Branch (269:9): [True: 0, False: 723]
  ------------------
  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|    723|    if (st->num == max_nodes) {
  ------------------
  |  Branch (273:9): [True: 0, False: 723]
  ------------------
  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|    723|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (278:9): [True: 0, False: 723]
  ------------------
  279|      0|        return 0;
  280|       |
  281|    723|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (281:9): [True: 723, False: 0]
  |  Branch (281:29): [True: 0, False: 0]
  ------------------
  282|    723|        st->data[st->num] = data;
  283|    723|    } 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|    723|    st->num++;
  289|    723|    st->sorted = 0;
  290|    723|    return st->num;
  291|    723|}
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|    723|{
  408|    723|    if (st == NULL)
  ------------------
  |  Branch (408:9): [True: 0, False: 723]
  ------------------
  409|      0|        return 0;
  410|    723|    return OPENSSL_sk_insert(st, data, st->num);
  411|    723|}
OPENSSL_sk_pop_free:
  441|    382|{
  442|    382|    int i;
  443|       |
  444|    382|    if (st == NULL)
  ------------------
  |  Branch (444:9): [True: 46, False: 336]
  ------------------
  445|     46|        return;
  446|       |
  447|  1.02k|    for (i = 0; i < st->num; i++) {
  ------------------
  |  Branch (447:17): [True: 687, False: 336]
  ------------------
  448|    687|        if (st->data[i] != NULL) {
  ------------------
  |  Branch (448:13): [True: 687, False: 0]
  ------------------
  449|    687|            if (st->free_thunk != NULL)
  ------------------
  |  Branch (449:17): [True: 325, False: 362]
  ------------------
  450|    325|                st->free_thunk(func, (void *)st->data[i]);
  451|    362|            else
  452|    362|                func((void *)st->data[i]);
  453|    687|        }
  454|    687|    }
  455|    336|    OPENSSL_sk_free(st);
  456|    336|}
OPENSSL_sk_free:
  459|    487|{
  460|    487|    if (st == NULL)
  ------------------
  |  Branch (460:9): [True: 10, False: 477]
  ------------------
  461|     10|        return;
  462|    477|    OPENSSL_free(st->data);
  ------------------
  |  |  115|    477|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    477|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    477|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|    477|    OPENSSL_free(st);
  ------------------
  |  |  115|    477|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    477|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    477|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  464|    477|}
OPENSSL_sk_num:
  467|    856|{
  468|    856|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (468:12): [True: 2, False: 854]
  ------------------
  469|    856|}
OPENSSL_sk_value:
  472|    576|{
  473|    576|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (473:9): [True: 0, False: 576]
  |  Branch (473:23): [True: 0, False: 576]
  |  Branch (473:32): [True: 0, False: 576]
  ------------------
  474|      0|        return NULL;
  475|    576|    return (void *)st->data[i];
  476|    576|}
OPENSSL_sk_sort:
  495|      7|{
  496|      7|    if (st != NULL && !st->sorted && st->comp != NULL) {
  ------------------
  |  Branch (496:9): [True: 7, False: 0]
  |  Branch (496:23): [True: 7, False: 0]
  |  Branch (496:38): [True: 7, False: 0]
  ------------------
  497|      7|        if (st->num > 1)
  ------------------
  |  Branch (497:13): [True: 0, False: 7]
  ------------------
  498|      0|            qsort(st->data, st->num, sizeof(void *), st->comp);
  499|      7|        st->sorted = 1; /* empty or single-element stack is considered sorted */
  500|      7|    }
  501|      7|}
stack.c:sk_reserve:
  179|    723|{
  180|    723|    const void **tmpdata;
  181|    723|    int num_alloc;
  182|       |
  183|       |    /* Check to see the reservation isn't exceeding the hard limit */
  184|    723|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (184:9): [True: 0, False: 723]
  ------------------
  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|    723|    num_alloc = st->num + n;
  191|    723|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (191:9): [True: 512, False: 211]
  ------------------
  192|    512|        num_alloc = min_nodes;
  193|       |
  194|       |    /* If |st->data| allocation was postponed */
  195|    723|    if (st->data == NULL) {
  ------------------
  |  Branch (195:9): [True: 335, False: 388]
  ------------------
  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|    335|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |  104|    335|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    335|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    335|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (200:13): [True: 0, False: 335]
  ------------------
  201|      0|            return 0;
  202|    335|        st->num_alloc = num_alloc;
  203|    335|        return 1;
  204|    335|    }
  205|       |
  206|    388|    if (!exact) {
  ------------------
  |  Branch (206:9): [True: 388, False: 0]
  ------------------
  207|    388|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (207:13): [True: 372, False: 16]
  ------------------
  208|    372|            return 1;
  209|     16|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  210|     16|        if (num_alloc == 0) {
  ------------------
  |  Branch (210:13): [True: 0, False: 16]
  ------------------
  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|     16|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (214:16): [True: 0, False: 0]
  ------------------
  215|      0|        return 1;
  216|      0|    }
  217|       |
  218|     16|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  109|     16|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|     16|    if (tmpdata == NULL)
  ------------------
  |  Branch (219:9): [True: 0, False: 16]
  ------------------
  220|      0|        return 0;
  221|       |
  222|     16|    st->data = tmpdata;
  223|     16|    st->num_alloc = num_alloc;
  224|     16|    return 1;
  225|     16|}
stack.c:compute_growth:
  161|     16|{
  162|     16|    int err = 0;
  163|       |
  164|     32|    while (current < target) {
  ------------------
  |  Branch (164:12): [True: 16, False: 16]
  ------------------
  165|     16|        if (current >= max_nodes)
  ------------------
  |  Branch (165:13): [True: 0, False: 16]
  ------------------
  166|      0|            return 0;
  167|       |
  168|     16|        current = safe_muldiv_int(current, 8, 5, &err);
  169|     16|        if (err != 0)
  ------------------
  |  Branch (169:13): [True: 0, False: 16]
  ------------------
  170|      0|            return 0;
  171|     16|        if (current >= max_nodes)
  ------------------
  |  Branch (171:13): [True: 0, False: 16]
  ------------------
  172|      0|            current = max_nodes;
  173|     16|    }
  174|     16|    return current;
  175|     16|}
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|      4|{
   98|      4|    pthread_mutex_t *mutex;
   99|       |
  100|      4|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == 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 (100:9): [True: 0, False: 4]
  ------------------
  101|      0|        return NULL;
  102|      4|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 4]
  ------------------
  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|      4|    return (CRYPTO_MUTEX *)mutex;
  107|      4|}
ossl_crypto_mutex_free:
  142|      2|{
  143|      2|    pthread_mutex_t **mutex_p;
  144|       |
  145|      2|    if (mutex == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 2]
  ------------------
  146|      0|        return;
  147|       |
  148|      2|    mutex_p = (pthread_mutex_t **)mutex;
  149|      2|    if (*mutex_p != NULL)
  ------------------
  |  Branch (149:9): [True: 2, False: 0]
  ------------------
  150|      2|        pthread_mutex_destroy(*mutex_p);
  151|      2|    OPENSSL_free(*mutex_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__
  |  |  ------------------
  ------------------
  152|      2|    *mutex = NULL;
  153|      2|}
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|  5.32k|{
  522|  5.32k|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|  5.32k|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  523|  5.32k|}
ossl_rcu_assign_uptr:
  526|    368|{
  527|    368|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |   98|    368|#  define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  528|    368|}
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|     99|{
  581|     99|# ifdef USE_RWLOCK
  582|     99|    CRYPTO_RWLOCK *lock;
  583|       |
  584|     99|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  104|     99|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     99|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     99|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (584:9): [True: 0, False: 99]
  ------------------
  585|       |        /* Don't set error, to avoid recursion blowup. */
  586|      0|        return NULL;
  587|       |
  588|     99|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (588:9): [True: 0, False: 99]
  ------------------
  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|     99|    return lock;
  622|     99|}
CRYPTO_THREAD_read_lock:
  625|  3.26k|{
  626|  3.26k|# ifdef USE_RWLOCK
  627|  3.26k|    if (!ossl_assert(pthread_rwlock_rdlock(lock) == 0))
  ------------------
  |  |   52|  3.26k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  3.26k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (627:9): [True: 0, False: 3.26k]
  ------------------
  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|  3.26k|    return 1;
  637|  3.26k|}
CRYPTO_THREAD_write_lock:
  640|  2.54k|{
  641|  2.54k|# ifdef USE_RWLOCK
  642|  2.54k|    if (!ossl_assert(pthread_rwlock_wrlock(lock) == 0))
  ------------------
  |  |   52|  2.54k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.54k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (642:9): [True: 0, False: 2.54k]
  ------------------
  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|  2.54k|    return 1;
  652|  2.54k|}
CRYPTO_THREAD_unlock:
  655|  5.81k|{
  656|  5.81k|# ifdef USE_RWLOCK
  657|  5.81k|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 5.81k]
  ------------------
  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|  5.81k|    return 1;
  667|  5.81k|}
CRYPTO_THREAD_lock_free:
  670|     69|{
  671|     69|    if (lock == NULL)
  ------------------
  |  Branch (671:9): [True: 14, False: 55]
  ------------------
  672|     14|        return;
  673|       |
  674|     55|# ifdef USE_RWLOCK
  675|     55|    pthread_rwlock_destroy(lock);
  676|       |# else
  677|       |    pthread_mutex_destroy(lock);
  678|       |# endif
  679|     55|    OPENSSL_free(lock);
  ------------------
  |  |  115|     55|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     55|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     55|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  680|       |
  681|     55|    return;
  682|     69|}
CRYPTO_THREAD_run_once:
  685|  7.03k|{
  686|  7.03k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (686:9): [True: 0, False: 7.03k]
  ------------------
  687|      0|        return 0;
  688|       |
  689|  7.03k|    return 1;
  690|  7.03k|}
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|  4.99k|{
  702|  4.99k|    return pthread_getspecific(*key);
  703|  4.99k|}
CRYPTO_THREAD_set_local:
  706|     19|{
  707|     19|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (707:9): [True: 0, False: 19]
  ------------------
  708|      0|        return 0;
  709|       |
  710|     19|    return 1;
  711|     19|}
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|     18|{
  733|     18|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  734|     18|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (734:9): [Folded - Ignored]
  ------------------
  735|     18|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
  736|     18|        return 1;
  737|     18|    }
  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|  3.25k|{
  837|  3.25k|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  838|  3.25k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (838:9): [Folded - Ignored]
  ------------------
  839|  3.25k|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  840|  3.25k|        return 1;
  841|  3.25k|    }
  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|    362|{
  860|    362|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  861|    362|    if (__atomic_is_lock_free(sizeof(*dst), dst)) {
  ------------------
  |  Branch (861:9): [Folded - Ignored]
  ------------------
  862|    362|        __atomic_store(dst, &val, __ATOMIC_RELEASE);
  863|    362|        return 1;
  864|    362|    }
  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_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|}

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

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|      3|{
  129|      3|    *no_cache = 0;
  130|      3|    switch (operation_id) {
  ------------------
  |  Branch (130:13): [True: 1, False: 2]
  ------------------
  131|      2|    case OSSL_OP_RAND:
  ------------------
  |  |  314|      2|# define OSSL_OP_RAND                                5
  ------------------
  |  Branch (131:5): [True: 2, False: 1]
  ------------------
  132|      2|        return fuzz_rand_rand;
  133|      3|    }
  134|      1|    return NULL;
  135|      3|}
fuzz_rand.c:fuzz_rand_newctx:
   27|      2|{
   28|      2|    int *st = OPENSSL_malloc(sizeof(*st));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   29|       |
   30|      2|    if (st != NULL)
  ------------------
  |  Branch (30:9): [True: 2, False: 0]
  ------------------
   31|      2|        *st = EVP_RAND_STATE_UNINITIALISED;
  ------------------
  |  | 1347|      2|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
   32|      2|    return st;
   33|      2|}
fuzz_rand.c:fuzz_rand_freectx:
   36|      2|{
   37|      2|    OPENSSL_free(vrng);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   38|      2|}
fuzz_rand.c:fuzz_rand_instantiate:
   46|      2|{
   47|      2|    *(int *)vrng = EVP_RAND_STATE_READY;
  ------------------
  |  | 1348|      2|# define EVP_RAND_STATE_READY            1
  ------------------
   48|      2|    return 1;
   49|      2|}
fuzz_rand.c:fuzz_rand_generate:
   63|  1.15k|{
   64|  1.15k|    unsigned char val = 1;
   65|  1.15k|    size_t i;
   66|       |
   67|  19.6k|    for (i = 0; i < outlen; i++)
  ------------------
  |  Branch (67:17): [True: 18.4k, False: 1.15k]
  ------------------
   68|  18.4k|        out[i] = val++;
   69|  1.15k|    return 1;
   70|  1.15k|}
fuzz_rand.c:fuzz_rand_enable_locking:
   73|      1|{
   74|      1|    return 1;
   75|      1|}
fuzz_rand.c:fuzz_rand_get_ctx_params:
   78|  1.15k|{
   79|  1.15k|    OSSL_PARAM *p;
   80|       |
   81|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  533|  1.15k|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
   82|  1.15k|    if (p != NULL && !OSSL_PARAM_set_int(p, *(int *)vrng))
  ------------------
  |  Branch (82:9): [True: 0, False: 1.15k]
  |  Branch (82:22): [True: 0, False: 0]
  ------------------
   83|      0|        return 0;
   84|       |
   85|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  534|  1.15k|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
   86|  1.15k|    if (p != NULL && !OSSL_PARAM_set_int(p, 500))
  ------------------
  |  Branch (86:9): [True: 0, False: 1.15k]
  |  Branch (86:22): [True: 0, False: 0]
  ------------------
   87|      0|        return 0;
   88|       |
   89|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  532|  1.15k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
   90|  1.15k|    if (p != NULL && !OSSL_PARAM_set_size_t(p, INT_MAX))
  ------------------
  |  Branch (90:9): [True: 1.15k, False: 0]
  |  Branch (90:22): [True: 0, False: 1.15k]
  ------------------
   91|      0|        return 0;
   92|  1.15k|    return 1;
   93|  1.15k|}

FuzzerInitialize:
   18|      2|{
   19|      2|    FuzzerSetRand();
   20|      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
  ------------------
   21|      2|    OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
  ------------------
  |  | 2807|      2|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
   22|      2|    ERR_clear_error();
   23|      2|    return 1;
   24|      2|}
FuzzerTestOneInput:
   46|  1.15k|{
   47|  1.15k|    int rc = 0;
   48|  1.15k|    QUIC_SRTM *srtm = NULL;
   49|  1.15k|    PACKET pkt;
   50|  1.15k|    unsigned int cmd;
   51|  1.15k|    uint64_t arg_opaque, arg_seq_num, arg_idx;
   52|  1.15k|    QUIC_STATELESS_RESET_TOKEN arg_token;
   53|  1.15k|    size_t limit = 0;
   54|       |
   55|  1.15k|    if ((srtm = ossl_quic_srtm_new(NULL, NULL)) == NULL) {
  ------------------
  |  Branch (55:9): [True: 0, False: 1.15k]
  ------------------
   56|      0|        rc = -1;
   57|      0|        goto err;
   58|      0|    }
   59|       |
   60|  1.15k|    if (!PACKET_buf_init(&pkt, buf, len))
  ------------------
  |  Branch (60:9): [True: 0, False: 1.15k]
  ------------------
   61|      0|        goto err;
   62|       |
   63|   628k|    while (PACKET_remaining(&pkt) > 0) {
  ------------------
  |  Branch (63:12): [True: 627k, False: 1.12k]
  ------------------
   64|   627k|        if (!PACKET_get_1(&pkt, &cmd))
  ------------------
  |  Branch (64:13): [True: 0, False: 627k]
  ------------------
   65|      0|            goto err;
   66|       |
   67|   627k|        if (++limit > MAX_CMDS) {
  ------------------
  |  |   43|   627k|#define MAX_CMDS 10000
  ------------------
  |  Branch (67:13): [True: 29, False: 627k]
  ------------------
   68|     29|            rc = 0;
   69|     29|            goto err;
   70|     29|        }
   71|       |
   72|   627k|        switch (cmd % CMD_MAX) {
   73|   310k|        case CMD_ADD:
  ------------------
  |  Branch (73:9): [True: 310k, False: 317k]
  ------------------
   74|   310k|            if (!PACKET_get_net_8(&pkt, &arg_opaque)
  ------------------
  |  Branch (74:17): [True: 375, False: 309k]
  ------------------
   75|   310k|                || !PACKET_get_net_8(&pkt, &arg_seq_num)
  ------------------
  |  Branch (75:20): [True: 47, False: 309k]
  ------------------
   76|   310k|                || !PACKET_copy_bytes(&pkt, arg_token.token,
  ------------------
  |  Branch (76:20): [True: 59, False: 309k]
  ------------------
   77|   309k|                                      sizeof(arg_token.token)))
   78|    481|                continue; /* just stop */
   79|       |
   80|   309k|            ossl_quic_srtm_add(srtm, (void *)(uintptr_t)arg_opaque,
   81|   309k|                               arg_seq_num, &arg_token);
   82|   309k|            ossl_quic_srtm_check(srtm);
   83|   309k|            break;
   84|       |
   85|  67.4k|        case CMD_REMOVE:
  ------------------
  |  Branch (85:9): [True: 67.4k, False: 559k]
  ------------------
   86|  67.4k|            if (!PACKET_get_net_8(&pkt, &arg_opaque)
  ------------------
  |  Branch (86:17): [True: 119, False: 67.3k]
  ------------------
   87|  67.4k|                || !PACKET_get_net_8(&pkt, &arg_seq_num))
  ------------------
  |  Branch (87:20): [True: 19, False: 67.3k]
  ------------------
   88|    138|                continue; /* just stop */
   89|       |
   90|  67.3k|            ossl_quic_srtm_remove(srtm, (void *)(uintptr_t)arg_opaque,
   91|  67.3k|                                  arg_seq_num);
   92|  67.3k|            ossl_quic_srtm_check(srtm);
   93|  67.3k|            break;
   94|       |
   95|   192k|        case CMD_CULL:
  ------------------
  |  Branch (95:9): [True: 192k, False: 434k]
  ------------------
   96|   192k|            if (!PACKET_get_net_8(&pkt, &arg_opaque))
  ------------------
  |  Branch (96:17): [True: 228, False: 192k]
  ------------------
   97|    228|                continue; /* just stop */
   98|       |
   99|   192k|            ossl_quic_srtm_cull(srtm, (void *)(uintptr_t)arg_opaque);
  100|   192k|            ossl_quic_srtm_check(srtm);
  101|   192k|            break;
  102|       |
  103|  57.1k|        case CMD_LOOKUP:
  ------------------
  |  Branch (103:9): [True: 57.1k, False: 570k]
  ------------------
  104|  57.1k|            if (!PACKET_copy_bytes(&pkt, arg_token.token,
  ------------------
  |  Branch (104:17): [True: 280, False: 56.9k]
  ------------------
  105|  57.1k|                                   sizeof(arg_token.token))
  106|  57.1k|                || !PACKET_get_net_8(&pkt, &arg_idx))
  ------------------
  |  Branch (106:20): [True: 24, False: 56.8k]
  ------------------
  107|    304|                continue; /* just stop */
  108|       |
  109|  56.8k|            ossl_quic_srtm_lookup(srtm, &arg_token, (size_t)arg_idx,
  110|  56.8k|                                  NULL, NULL);
  111|  56.8k|            ossl_quic_srtm_check(srtm);
  112|  56.8k|            break;
  113|       |
  114|      0|        default:
  ------------------
  |  Branch (114:9): [True: 0, False: 627k]
  ------------------
  115|       |            /* Other bytes are treated as no-ops */
  116|      0|            continue;
  117|   627k|        }
  118|   627k|    }
  119|       |
  120|  1.12k|    rc = 0;
  121|  1.15k|err:
  122|  1.15k|    ossl_quic_srtm_free(srtm);
  123|  1.15k|    return rc;
  124|  1.12k|}

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|    272|    { \
   69|    272|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
   70|    272|    } \
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|  1.43k|    { \
   63|  1.43k|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
   64|  1.43k|    } \
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|    } \

quic_srtm.c:ossl_assert_int:
   45|   207k|{
   46|   207k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 207k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   207k|    return expr;
   50|   207k|}
bio_print.c:ossl_assert_int:
   45|  10.8k|{
   46|  10.8k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 10.8k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  10.8k|    return expr;
   50|  10.8k|}
evp_enc.c:ossl_assert_int:
   45|  1.15k|{
   46|  1.15k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.15k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.15k|    return expr;
   50|  1.15k|}
evp_fetch.c:ossl_assert_int:
   45|  3.75k|{
   46|  3.75k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 3.75k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  3.75k|    return expr;
   50|  3.75k|}
core_fetch.c:ossl_assert_int:
   45|     10|{
   46|     10|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 10]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     10|    return expr;
   50|     10|}
core_namemap.c:ossl_assert_int:
   45|    676|{
   46|    676|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 676]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    676|    return expr;
   50|    676|}
provider_core.c:ossl_assert_int:
   45|     12|{
   46|     12|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 12]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     12|    return expr;
   50|     12|}
threads_pthread.c:ossl_assert_int:
   45|  5.81k|{
   46|  5.81k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 5.81k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  5.81k|    return expr;
   50|  5.81k|}
defn_cache.c:ossl_assert_int:
   45|    272|{
   46|    272|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 272]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    272|    return expr;
   50|    272|}
property.c:ossl_assert_int:
   45|    139|{
   46|    139|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 139]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    139|    return expr;
   50|    139|}

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

quic-srtm.c:PACKET_buf_init:
   72|  1.15k|{
   73|       |    /* Sanity check for negative values. */
   74|  1.15k|    if (len > (size_t)(SIZE_MAX / 2))
  ------------------
  |  Branch (74:9): [True: 0, False: 1.15k]
  ------------------
   75|      0|        return 0;
   76|       |
   77|  1.15k|    pkt->curr = buf;
   78|  1.15k|    pkt->remaining = len;
   79|  1.15k|    return 1;
   80|  1.15k|}
quic-srtm.c:PACKET_remaining:
   40|  2.62M|{
   41|  2.62M|    return pkt->remaining;
   42|  2.62M|}
quic-srtm.c:PACKET_get_1:
  302|   627k|{
  303|   627k|    if (!PACKET_peek_1(pkt, data))
  ------------------
  |  Branch (303:9): [True: 0, False: 627k]
  ------------------
  304|      0|        return 0;
  305|       |
  306|   627k|    packet_forward(pkt, 1);
  307|       |
  308|   627k|    return 1;
  309|   627k|}
quic-srtm.c:PACKET_peek_1:
  291|   627k|{
  292|   627k|    if (!PACKET_remaining(pkt))
  ------------------
  |  Branch (292:9): [True: 0, False: 627k]
  ------------------
  293|      0|        return 0;
  294|       |
  295|   627k|    *data = *pkt->curr;
  296|       |
  297|   627k|    return 1;
  298|   627k|}
quic-srtm.c:packet_forward:
   31|  1.99M|{
   32|  1.99M|    pkt->curr += len;
   33|  1.99M|    pkt->remaining -= len;
   34|  1.99M|}
quic-srtm.c:PACKET_get_net_8:
  279|  1.00M|{
  280|  1.00M|    if (!PACKET_peek_net_8(pkt, data))
  ------------------
  |  Branch (280:9): [True: 812, False: 1.00M]
  ------------------
  281|    812|        return 0;
  282|       |
  283|  1.00M|    packet_forward(pkt, 8);
  284|       |
  285|  1.00M|    return 1;
  286|  1.00M|}
quic-srtm.c:PACKET_peek_net_8:
  237|  1.00M|{
  238|  1.00M|    if (PACKET_remaining(pkt) < 8)
  ------------------
  |  Branch (238:9): [True: 812, False: 1.00M]
  ------------------
  239|    812|        return 0;
  240|       |
  241|  1.00M|    *data = ((uint64_t)(*pkt->curr)) << 56;
  242|  1.00M|    *data |= ((uint64_t)(*(pkt->curr + 1))) << 48;
  243|  1.00M|    *data |= ((uint64_t)(*(pkt->curr + 2))) << 40;
  244|  1.00M|    *data |= ((uint64_t)(*(pkt->curr + 3))) << 32;
  245|  1.00M|    *data |= ((uint64_t)(*(pkt->curr + 4))) << 24;
  246|  1.00M|    *data |= ((uint64_t)(*(pkt->curr + 5))) << 16;
  247|  1.00M|    *data |= ((uint64_t)(*(pkt->curr + 6))) << 8;
  248|  1.00M|    *data |= *(pkt->curr + 7);
  249|       |
  250|  1.00M|    return 1;
  251|  1.00M|}
quic-srtm.c:PACKET_copy_bytes:
  411|   367k|{
  412|   367k|    if (!PACKET_peek_copy_bytes(pkt, data, len))
  ------------------
  |  Branch (412:9): [True: 339, False: 366k]
  ------------------
  413|    339|        return 0;
  414|       |
  415|   366k|    packet_forward(pkt, len);
  416|       |
  417|   366k|    return 1;
  418|   367k|}
quic-srtm.c:PACKET_peek_copy_bytes:
  396|   367k|{
  397|   367k|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (397:9): [True: 339, False: 366k]
  ------------------
  398|    339|        return 0;
  399|       |
  400|   366k|    memcpy(data, pkt->curr, len);
  401|       |
  402|   366k|    return 1;
  403|   367k|}

bio_lib.c:CRYPTO_FREE_REF:
  285|      2|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      2|{
  287|      2|}
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|  2.43k|{
   41|  2.43k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  2.43k|    return 1;
   43|  2.43k|}
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|  2.56k|{
   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.56k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.56k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 130, False: 2.43k]
  ------------------
   66|    130|        atomic_thread_fence(memory_order_acquire);
   67|  2.56k|#   endif
   68|  2.56k|    return 1;
   69|  2.56k|}
provider_core.c:CRYPTO_UP_REF:
   40|    144|{
   41|    144|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    144|    return 1;
   43|    144|}
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|    145|{
   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|    145|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    145|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 1, False: 144]
  ------------------
   66|      1|        atomic_thread_fence(memory_order_acquire);
   67|    145|#   endif
   68|    145|    return 1;
   69|    145|}
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|}
evp_rand.c:CRYPTO_UP_REF:
   40|     16|{
   41|     16|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     16|    return 1;
   43|     16|}
evp_rand.c:CRYPTO_NEW_REF:
  280|      9|{
  281|      9|    refcnt->val = n;
  282|      9|    return 1;
  283|      9|}
evp_rand.c:CRYPTO_FREE_REF:
  285|      9|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      9|{
  287|      9|}
evp_rand.c:CRYPTO_DOWN_REF:
   56|     25|{
   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|     25|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     25|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 9, False: 16]
  ------------------
   66|      9|        atomic_thread_fence(memory_order_acquire);
   67|     25|#   endif
   68|     25|    return 1;
   69|     25|}

stack.c:safe_muldiv_int:
  324|     16|    {                                                                        \
  325|     16|        int e2 = 0;                                                          \
  326|     16|        type q, r, x, y;                                                     \
  327|     16|                                                                             \
  328|     16|        if (c == 0) {                                                        \
  ------------------
  |  Branch (328:13): [True: 0, False: 16]
  ------------------
  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|     16|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  333|     16|        if (!e2)                                                             \
  ------------------
  |  Branch (333:13): [True: 16, False: 0]
  ------------------
  334|     16|            return safe_div_ ## type_name(x, c, err);                        \
  335|     16|        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|     16|    }
stack.c:safe_mul_int:
  138|     16|    {                                                                        \
  139|     16|        type r;                                                              \
  140|     16|                                                                             \
  141|     16|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (141:13): [True: 16, False: 0]
  ------------------
  142|     16|            return r;                                                        \
  143|     16|        *err |= 1;                                                           \
  144|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (144:16): [True: 0, False: 0]
  ------------------
  145|     16|    }
stack.c:safe_div_int:
  201|     16|    {                                                                        \
  202|     16|        if (b == 0) {                                                        \
  ------------------
  |  Branch (202:13): [True: 0, False: 16]
  ------------------
  203|      0|            *err |= 1;                                                       \
  204|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (204:20): [True: 0, False: 0]
  ------------------
  205|      0|        }                                                                    \
  206|     16|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (206:13): [True: 0, False: 16]
  |  Branch (206:24): [True: 0, False: 0]
  ------------------
  207|      0|            *err |= 1;                                                       \
  208|      0|            return max;                                                      \
  209|      0|        }                                                                    \
  210|     16|        return a / b;                                                        \
  211|     16|    }

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|    }                                           \
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|    }                                           \
rand_lib.c:do_rand_init_ossl_:
   73|      1|    {                                           \
   74|      1|        init##_ossl_ret_ = init();              \
   75|      1|    }                                           \

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|    }
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|    }

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|}

quic_srtm.c:lh_SRTM_ITEM_new:
  317|  2.30k|    { \
  318|  2.30k|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|  2.30k|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|  2.30k|                                lh_##type##_doall_thunk, \
  321|  2.30k|                                lh_##type##_doall_arg_thunk); \
  322|  2.30k|    } \
quic_srtm.c:lh_SRTM_ITEM_hfn_thunk:
  243|  1.12M|    { \
  244|  1.12M|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.12M|        return hfn_conv((const type *)data); \
  246|  1.12M|    } \
quic_srtm.c:lh_SRTM_ITEM_cfn_thunk:
  248|   338k|    { \
  249|   338k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|   338k|        return cfn_conv((const type *)da, (const type *)db); \
  251|   338k|    } \
quic_srtm.c:lh_SRTM_ITEM_doall_thunk:
  299|   102k|    { \
  300|   102k|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|   102k|        doall_conv((type *)node); \
  302|   102k|    } \
quic_srtm.c:lh_SRTM_ITEM_doall_arg_thunk:
  305|   899M|    { \
  306|   899M|        void (*doall_conv)(type *, void *) = (void (*)(type *, void *))doall; \
  307|   899M|        doall_conv((type *)node, arg); \
  308|   899M|    } \
quic_srtm.c:lh_SRTM_ITEM_free:
  254|  2.30k|    { \
  255|  2.30k|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|  2.30k|    } \
quic_srtm.c:lh_SRTM_ITEM_doall:
  311|  1.15k|    { \
  312|  1.15k|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|  1.15k|    } \
quic_srtm.c:lh_SRTM_ITEM_insert:
  264|   259k|    { \
  265|   259k|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|   259k|    } \
quic_srtm.c:lh_SRTM_ITEM_error:
  279|   259k|    { \
  280|   259k|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|   259k|    } \
quic_srtm.c:lh_SRTM_ITEM_retrieve:
  274|   819k|    { \
  275|   819k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|   819k|    } \
quic_srtm.c:lh_SRTM_ITEM_delete:
  269|  41.4k|    { \
  270|  41.4k|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  271|  41.4k|    } \
quic_srtm.c:lh_SRTM_ITEM_doall_arg:
  326|  2.50M|    { \
  327|  2.50M|        OPENSSL_LH_doall_arg((OPENSSL_LHASH *)lh, \
  328|  2.50M|                             (OPENSSL_LH_DOALL_FUNCARG)doallarg, arg); \
  329|  2.50M|    } \
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.90k|    { \
  244|  1.90k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.90k|        return hfn_conv((const type *)data); \
  246|  1.90k|    } \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  248|  1.31k|    { \
  249|  1.31k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  1.31k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  1.31k|    } \
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|    576|    { \
  275|    576|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    576|    } \
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|    140|    { \
  244|    140|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    140|        return hfn_conv((const type *)data); \
  246|    140|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  248|    134|    { \
  249|    134|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    134|        return cfn_conv((const type *)da, (const type *)db); \
  251|    134|    } \
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|    138|    { \
  275|    138|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    138|    } \
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|    136|    { \
  312|    136|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|    136|    } \
property.c:lh_QUERY_free:
  254|    136|    { \
  255|    136|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|    136|    } \
property.c:lh_QUERY_new:
  317|    136|    { \
  318|    136|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|    136|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|    136|                                lh_##type##_doall_thunk, \
  321|    136|                                lh_##type##_doall_arg_thunk); \
  322|    136|    } \
property.c:lh_QUERY_hfn_thunk:
  243|  1.15k|    { \
  244|  1.15k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.15k|        return hfn_conv((const type *)data); \
  246|  1.15k|    } \
property.c:lh_QUERY_cfn_thunk:
  248|  1.15k|    { \
  249|  1.15k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  1.15k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  1.15k|    } \
property.c:lh_QUERY_doall_thunk:
  299|      3|    { \
  300|      3|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|      3|        doall_conv((type *)node); \
  302|      3|    } \
property.c:lh_QUERY_retrieve:
  274|  1.15k|    { \
  275|  1.15k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  1.15k|    } \
property.c:lh_QUERY_insert:
  264|      3|    { \
  265|      3|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|      3|    } \
property.c:lh_QUERY_error:
  279|      3|    { \
  280|      3|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|      3|    } \
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|    } \

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|    } \
core_namemap.c:sk_NAMES_value:
   84|    308|    { \
   85|    308|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|    308|    } \
core_namemap.c:ossl_check_const_OPENSSL_STRING_sk_type:
   49|    746|    { \
   50|    746|        return (const OPENSSL_STACK *)sk; \
   51|    746|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_sk_type:
   53|    676|    { \
   54|    676|        return (OPENSSL_STACK *)sk; \
   55|    676|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_type:
   45|    362|    { \
   46|    362|        return ptr; \
   47|    362|    } \
core_namemap.c:sk_NAMES_push:
  129|    184|    { \
  130|    184|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    184|    } \
core_namemap.c:sk_NAMES_num:
   80|    184|    { \
   81|    184|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    184|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_freefunc_type:
   65|    184|    { \
   66|    184|        return (OPENSSL_sk_freefunc)fr; \
   67|    184|    }
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|    184|    { \
   76|    184|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    184|        freefunc((t3 *)ptr);\
   78|    184|    } \
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|    } \
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|     18|    { \
   85|     18|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|     18|    } \
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|      3|    { \
  183|      3|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_num:
   80|      3|    { \
   81|      3|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_free:
  112|      3|    { \
  113|      3|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      3|    } \
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|    136|    { \
  146|    136|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    136|        \
  148|    136|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    136|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    136|        \
  151|    136|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    136|    } \
property.c:sk_IMPLEMENTATION_freefunc_thunk:
   75|    136|    { \
   76|    136|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    136|        freefunc((t3 *)ptr);\
   78|    136|    } \
property.c:sk_IMPLEMENTATION_new_null:
   96|    136|    { \
   97|    136|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    136|    } \
property.c:sk_IMPLEMENTATION_num:
   80|    275|    { \
   81|    275|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    275|    } \
property.c:sk_IMPLEMENTATION_value:
   84|      3|    { \
   85|      3|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      3|    } \
property.c:sk_IMPLEMENTATION_push:
  129|    136|    { \
  130|    136|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    136|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
   88|      5|    { \
   89|      5|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|      5|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|      5|        \
   92|      5|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|      5|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|      5|    } \
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|      5|    { \
   81|      5|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      5|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  174|      5|    { \
  175|      5|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|      5|    } \
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|      5|    { \
  146|      5|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      5|        \
  148|      5|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      5|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      5|        \
  151|      5|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      5|    } \
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|    } \
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|}

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

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|  1.15k|{
   53|  1.15k|    if (ctx == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 1.15k]
  ------------------
   54|      0|        return NULL;
   55|  1.15k|    return ctx->libctx;
   56|  1.15k|}
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|      3|{
  687|      3|    *no_cache = 0;
  688|      3|    switch (operation_id) {
  ------------------
  |  Branch (688:13): [True: 0, False: 3]
  ------------------
  689|      0|    case OSSL_OP_DIGEST:
  ------------------
  |  |  310|      0|# define OSSL_OP_DIGEST                              1
  ------------------
  |  Branch (689:5): [True: 0, False: 3]
  ------------------
  690|      0|        return deflt_digests;
  691|      1|    case OSSL_OP_CIPHER:
  ------------------
  |  |  311|      1|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
  |  Branch (691:5): [True: 1, False: 2]
  ------------------
  692|      1|        return exported_ciphers;
  693|      0|    case OSSL_OP_MAC:
  ------------------
  |  |  312|      0|# define OSSL_OP_MAC                                 3
  ------------------
  |  Branch (693:5): [True: 0, False: 3]
  ------------------
  694|      0|        return deflt_macs;
  695|      0|    case OSSL_OP_KDF:
  ------------------
  |  |  313|      0|# define OSSL_OP_KDF                                 4
  ------------------
  |  Branch (695:5): [True: 0, False: 3]
  ------------------
  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]
  ------------------
  698|      2|        return deflt_rands;
  699|      0|    case OSSL_OP_KEYMGMT:
  ------------------
  |  |  315|      0|# define OSSL_OP_KEYMGMT                            10
  ------------------
  |  Branch (699:5): [True: 0, False: 3]
  ------------------
  700|      0|        return deflt_keymgmt;
  701|      0|    case OSSL_OP_KEYEXCH:
  ------------------
  |  |  316|      0|# define OSSL_OP_KEYEXCH                            11
  ------------------
  |  Branch (701:5): [True: 0, False: 3]
  ------------------
  702|      0|        return deflt_keyexch;
  703|      0|    case OSSL_OP_SIGNATURE:
  ------------------
  |  |  317|      0|# define OSSL_OP_SIGNATURE                          12
  ------------------
  |  Branch (703:5): [True: 0, False: 3]
  ------------------
  704|      0|        return deflt_signature;
  705|      0|    case OSSL_OP_ASYM_CIPHER:
  ------------------
  |  |  318|      0|# define OSSL_OP_ASYM_CIPHER                        13
  ------------------
  |  Branch (705:5): [True: 0, False: 3]
  ------------------
  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: 3]
  ------------------
  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: 3]
  ------------------
  710|      0|        return deflt_encoder;
  711|      0|    case OSSL_OP_DECODER:
  ------------------
  |  |  323|      0|# define OSSL_OP_DECODER                            21
  ------------------
  |  Branch (711:5): [True: 0, False: 3]
  ------------------
  712|      0|        return deflt_decoder;
  713|      0|    case OSSL_OP_STORE:
  ------------------
  |  |  324|      0|# define OSSL_OP_STORE                              22
  ------------------
  |  Branch (713:5): [True: 0, False: 3]
  ------------------
  714|      0|        return deflt_store;
  715|      0|    case OSSL_OP_SKEYMGMT:
  ------------------
  |  |  320|      0|# define OSSL_OP_SKEYMGMT                           15
  ------------------
  |  Branch (715:5): [True: 0, False: 3]
  ------------------
  716|      0|        return deflt_skeymgmt;
  717|      3|    }
  718|      0|    return NULL;
  719|      3|}

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

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

cipher_aes_hw.c:cipher_hw_aesni_initkey:
   23|  1.15k|{
   24|  1.15k|    int ret;
   25|  1.15k|    PROV_AES_CTX *adat = (PROV_AES_CTX *)dat;
   26|  1.15k|    AES_KEY *ks = &adat->ks.ks;
   27|       |
   28|  1.15k|    dat->ks = ks;
   29|       |
   30|  1.15k|    if ((dat->mode == EVP_CIPH_ECB_MODE || dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  322|  2.30k|# 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: 1.15k, False: 0]
  |  Branch (30:44): [True: 0, False: 0]
  ------------------
   31|  1.15k|        && !dat->enc) {
  ------------------
  |  Branch (31:12): [True: 0, False: 1.15k]
  ------------------
   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|  1.15k|    } else {
   37|  1.15k|        ret = aesni_set_encrypt_key(key, keylen * 8, ks);
   38|  1.15k|        dat->block = (block128_f) aesni_encrypt;
   39|  1.15k|        if (dat->mode == EVP_CIPH_CBC_MODE)
  ------------------
  |  |  323|  1.15k|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (39:13): [True: 0, False: 1.15k]
  ------------------
   40|      0|            dat->stream.cbc = (cbc128_f) aesni_cbc_encrypt;
   41|  1.15k|        else if (dat->mode == EVP_CIPH_CTR_MODE)
  ------------------
  |  |  326|  1.15k|# define         EVP_CIPH_CTR_MODE               0x5
  ------------------
  |  Branch (41:18): [True: 0, False: 1.15k]
  ------------------
   42|      0|            dat->stream.ctr = (ctr128_f) aesni_ctr32_encrypt_blocks;
   43|  1.15k|        else
   44|  1.15k|            dat->stream.cbc = NULL;
   45|  1.15k|    }
   46|       |
   47|  1.15k|    if (ret < 0) {
  ------------------
  |  Branch (47:9): [True: 0, False: 1.15k]
  ------------------
   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|  1.15k|    return 1;
   53|  1.15k|}
cipher_aes_hw.c:cipher_hw_aesni_ecb:
   67|   207k|{
   68|   207k|    if (len < ctx->blocksize)
  ------------------
  |  Branch (68:9): [True: 0, False: 207k]
  ------------------
   69|      0|        return 1;
   70|       |
   71|   207k|    aesni_ecb_encrypt(in, out, len, ctx->ks, ctx->enc);
   72|       |
   73|   207k|    return 1;
   74|   207k|}

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|      1|{
   98|      1|    return ossl_cipher_generic_get_params(params, 0, CHACHA20_POLY1305_FLAGS,
  ------------------
  |  |   24|      1|#define CHACHA20_POLY1305_FLAGS (PROV_CIPHER_FLAG_AEAD                         \
  |  |  ------------------
  |  |  |  |   39|      1|# define PROV_CIPHER_FLAG_AEAD             0x0001
  |  |  ------------------
  |  |   25|      1|                                 | PROV_CIPHER_FLAG_CUSTOM_IV)
  |  |  ------------------
  |  |  |  |   40|      1|# define PROV_CIPHER_FLAG_CUSTOM_IV        0x0002
  |  |  ------------------
  ------------------
   99|      1|                                          CHACHA20_POLY1305_KEYLEN * 8,
  ------------------
  |  |   20|      1|#define CHACHA20_POLY1305_KEYLEN CHACHA_KEY_SIZE
  |  |  ------------------
  |  |  |  |   45|      1|#define CHACHA_KEY_SIZE         32
  |  |  ------------------
  ------------------
  100|      1|                                          CHACHA20_POLY1305_BLKLEN * 8,
  ------------------
  |  |   21|      1|#define CHACHA20_POLY1305_BLKLEN 1
  ------------------
  101|      1|                                          CHACHA20_POLY1305_IVLEN * 8);
  ------------------
  |  |   16|      1|#define CHACHA20_POLY1305_IVLEN 12
  ------------------
  102|      1|}
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|      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_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|     10|{
  191|       |#ifdef FIPS_MODULE
  192|       |    const int decrypt_only = 1;
  193|       |#else
  194|     10|    const int decrypt_only = 0;
  195|     10|#endif
  196|     10|    OSSL_PARAM *p;
  197|       |
  198|     10|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_DECRYPT_ONLY);
  ------------------
  |  |  187|     10|# define OSSL_CIPHER_PARAM_DECRYPT_ONLY "decrypt-only"
  ------------------
  199|     10|    if (p != NULL && !OSSL_PARAM_set_int(p, decrypt_only)) {
  ------------------
  |  Branch (199:9): [True: 0, False: 10]
  |  Branch (199:22): [True: 0, False: 0]
  ------------------
  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|     10|    return ossl_cipher_generic_get_params(params, md, flags,
  205|     10|                                          kbits, blkbits, ivbits);
  206|     10|}

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|    130|{
   51|    130|    OSSL_PARAM *p;
   52|       |
   53|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_MODE);
  ------------------
  |  |  195|    130|# define OSSL_CIPHER_PARAM_MODE "mode"
  ------------------
   54|    130|    if (p != NULL && !OSSL_PARAM_set_uint(p, md)) {
  ------------------
  |  Branch (54:9): [True: 130, False: 0]
  |  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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_AEAD);
  ------------------
  |  |  169|    130|# define OSSL_CIPHER_PARAM_AEAD "aead"
  ------------------
   59|    130|    if (p != NULL
  ------------------
  |  Branch (59:9): [True: 130, False: 0]
  ------------------
   60|    130|        && !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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CUSTOM_IV);
  ------------------
  |  |  186|    130|# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
  ------------------
   65|    130|    if (p != NULL
  ------------------
  |  Branch (65:9): [True: 130, False: 0]
  ------------------
   66|    130|        && !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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_CTS);
  ------------------
  |  |  184|    130|# define OSSL_CIPHER_PARAM_CTS "cts"
  ------------------
   71|    130|    if (p != NULL
  ------------------
  |  Branch (71:9): [True: 130, False: 0]
  ------------------
   72|    130|        && !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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK);
  ------------------
  |  |  203|    130|# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
  ------------------
   77|    130|    if (p != NULL
  ------------------
  |  Branch (77:9): [True: 130, False: 0]
  ------------------
   78|    130|        && !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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_HAS_RAND_KEY);
  ------------------
  |  |  191|    130|# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
  ------------------
   83|    130|    if (p != NULL
  ------------------
  |  Branch (83:9): [True: 130, False: 0]
  ------------------
   84|    130|        && !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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC);
  ------------------
  |  |  188|    130|# define OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC "encrypt-then-mac"
  ------------------
   89|    130|    if (p != NULL
  ------------------
  |  Branch (89:9): [True: 130, False: 0]
  ------------------
   90|    130|        && !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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  194|    130|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
   95|    130|    if (p != NULL && !OSSL_PARAM_set_size_t(p, kbits / 8)) {
  ------------------
  |  Branch (95:9): [True: 130, False: 0]
  |  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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_BLOCK_SIZE);
  ------------------
  |  |  183|    130|# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  100|    130|    if (p != NULL && !OSSL_PARAM_set_size_t(p, blkbits / 8)) {
  ------------------
  |  Branch (100:9): [True: 130, False: 0]
  |  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|    130|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  193|    130|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  105|    130|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ivbits / 8)) {
  ------------------
  |  Branch (105:9): [True: 130, False: 0]
  |  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|    130|    return 1;
  110|    130|}
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|  1.15k|{
  333|  1.15k|    if (ctx != NULL && ctx->alloced) {
  ------------------
  |  Branch (333:9): [True: 1.15k, False: 0]
  |  Branch (333:24): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|}
ossl_cipher_generic_einit:
  383|  1.15k|{
  384|  1.15k|    return cipher_generic_init_internal((PROV_CIPHER_CTX *)vctx, key, keylen,
  385|  1.15k|                                        iv, ivlen, params, 1);
  386|  1.15k|}
ossl_cipher_generic_block_update:
  424|   207k|{
  425|   207k|    size_t outlint = 0;
  426|   207k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  427|   207k|    size_t blksz = ctx->blocksize;
  428|   207k|    size_t nextblocks;
  429|       |
  430|   207k|    if (!ctx->key_set) {
  ------------------
  |  Branch (430:9): [True: 0, False: 207k]
  ------------------
  431|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_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)
  |  |  ------------------
  ------------------
  432|      0|        return 0;
  433|      0|    }
  434|       |
  435|   207k|    if (ctx->tlsversion > 0) {
  ------------------
  |  Branch (435:9): [True: 0, False: 207k]
  ------------------
  436|       |        /*
  437|       |         * Each update call corresponds to a TLS record and is individually
  438|       |         * padded
  439|       |         */
  440|       |
  441|       |        /* Sanity check inputs */
  442|      0|        if (in == NULL
  ------------------
  |  Branch (442:13): [True: 0, False: 0]
  ------------------
  443|      0|                || in != out
  ------------------
  |  Branch (443:20): [True: 0, False: 0]
  ------------------
  444|      0|                || outsize < inl
  ------------------
  |  Branch (444:20): [True: 0, False: 0]
  ------------------
  445|      0|                || !ctx->pad) {
  ------------------
  |  Branch (445:20): [True: 0, False: 0]
  ------------------
  446|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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)
  |  |  ------------------
  ------------------
  447|      0|            return 0;
  448|      0|        }
  449|       |
  450|      0|        if (ctx->enc) {
  ------------------
  |  Branch (450:13): [True: 0, False: 0]
  ------------------
  451|      0|            unsigned char padval;
  452|      0|            size_t padnum, loop;
  453|       |
  454|       |            /* Add padding */
  455|       |
  456|      0|            padnum = blksz - (inl % blksz);
  457|       |
  458|      0|            if (outsize < inl + padnum) {
  ------------------
  |  Branch (458:17): [True: 0, False: 0]
  ------------------
  459|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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)
  |  |  ------------------
  ------------------
  460|      0|                return 0;
  461|      0|            }
  462|       |
  463|      0|            if (padnum > MAX_PADDING) {
  ------------------
  |  |  419|      0|#define MAX_PADDING 256
  ------------------
  |  Branch (463:17): [True: 0, False: 0]
  ------------------
  464|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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)
  |  |  ------------------
  ------------------
  465|      0|                return 0;
  466|      0|            }
  467|      0|            padval = (unsigned char)(padnum - 1);
  468|      0|            if (ctx->tlsversion == SSL3_VERSION) {
  ------------------
  |  |   23|      0|# define SSL3_VERSION                    0x0300
  ------------------
  |  Branch (468:17): [True: 0, False: 0]
  ------------------
  469|      0|                if (padnum > 1)
  ------------------
  |  Branch (469:21): [True: 0, False: 0]
  ------------------
  470|      0|                    memset(out + inl, 0, padnum - 1);
  471|      0|                *(out + inl + padnum - 1) = padval;
  472|      0|            } else {
  473|       |                /* we need to add 'padnum' padding bytes of value padval */
  474|      0|                for (loop = inl; loop < inl + padnum; loop++)
  ------------------
  |  Branch (474:34): [True: 0, False: 0]
  ------------------
  475|      0|                    out[loop] = padval;
  476|      0|            }
  477|      0|            inl += padnum;
  478|      0|        }
  479|       |
  480|      0|        if ((inl % blksz) != 0) {
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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)
  |  |  ------------------
  ------------------
  482|      0|            return 0;
  483|      0|        }
  484|       |
  485|       |
  486|       |        /* Shouldn't normally fail */
  487|      0|        if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 0]
  ------------------
  488|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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)
  |  |  ------------------
  ------------------
  489|      0|            return 0;
  490|      0|        }
  491|       |
  492|      0|        if (ctx->alloced) {
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      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__
  |  |  ------------------
  ------------------
  494|      0|            ctx->alloced = 0;
  495|      0|            ctx->tlsmac = NULL;
  496|      0|        }
  497|       |
  498|       |        /* This only fails if padding is publicly invalid */
  499|      0|        *outl = inl;
  500|      0|        if (!ctx->enc
  ------------------
  |  Branch (500:13): [True: 0, False: 0]
  ------------------
  501|      0|            && !ossl_cipher_tlsunpadblock(ctx->libctx, ctx->tlsversion,
  ------------------
  |  Branch (501:16): [True: 0, False: 0]
  ------------------
  502|      0|                                          out, outl,
  503|      0|                                          blksz, &ctx->tlsmac, &ctx->alloced,
  504|      0|                                          ctx->tlsmacsize, 0)) {
  505|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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)
  |  |  ------------------
  ------------------
  506|      0|            return 0;
  507|      0|        }
  508|      0|        return 1;
  509|      0|    }
  510|       |
  511|   207k|    if (ctx->bufsz != 0)
  ------------------
  |  Branch (511:9): [True: 0, False: 207k]
  ------------------
  512|      0|        nextblocks = ossl_cipher_fillblock(ctx->buf, &ctx->bufsz, blksz,
  513|      0|                                           &in, &inl);
  514|   207k|    else
  515|   207k|        nextblocks = inl & ~(blksz-1);
  516|       |
  517|       |    /*
  518|       |     * If we're decrypting and we end an update on a block boundary we hold
  519|       |     * the last block back in case this is the last update call and the last
  520|       |     * block is padded.
  521|       |     */
  522|   207k|    if (ctx->bufsz == blksz && (ctx->enc || inl > 0 || !ctx->pad)) {
  ------------------
  |  Branch (522:9): [True: 0, False: 207k]
  |  Branch (522:33): [True: 0, False: 0]
  |  Branch (522:45): [True: 0, False: 0]
  |  Branch (522:56): [True: 0, False: 0]
  ------------------
  523|      0|        if (outsize < blksz) {
  ------------------
  |  Branch (523:13): [True: 0, False: 0]
  ------------------
  524|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_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)
  |  |  ------------------
  ------------------
  525|      0|            return 0;
  526|      0|        }
  527|      0|        if (!ctx->hw->cipher(ctx, out, ctx->buf, blksz)) {
  ------------------
  |  Branch (527:13): [True: 0, False: 0]
  ------------------
  528|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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)
  |  |  ------------------
  ------------------
  529|      0|            return 0;
  530|      0|        }
  531|      0|        ctx->bufsz = 0;
  532|      0|        outlint = blksz;
  533|      0|        out += blksz;
  534|      0|    }
  535|   207k|    if (nextblocks > 0) {
  ------------------
  |  Branch (535:9): [True: 207k, False: 0]
  ------------------
  536|   207k|        if (!ctx->enc && ctx->pad && nextblocks == inl) {
  ------------------
  |  Branch (536:13): [True: 0, False: 207k]
  |  Branch (536:26): [True: 0, False: 0]
  |  Branch (536:38): [True: 0, False: 0]
  ------------------
  537|      0|            if (!ossl_assert(inl >= blksz)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (537:17): [True: 0, False: 0]
  ------------------
  538|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_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)
  |  |  ------------------
  ------------------
  539|      0|                return 0;
  540|      0|            }
  541|      0|            nextblocks -= blksz;
  542|      0|        }
  543|   207k|        outlint += nextblocks;
  544|   207k|        if (outsize < outlint) {
  ------------------
  |  Branch (544:13): [True: 0, False: 207k]
  ------------------
  545|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_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)
  |  |  ------------------
  ------------------
  546|      0|            return 0;
  547|      0|        }
  548|   207k|    }
  549|   207k|    if (nextblocks > 0) {
  ------------------
  |  Branch (549:9): [True: 207k, False: 0]
  ------------------
  550|   207k|        if (!ctx->hw->cipher(ctx, out, in, nextblocks)) {
  ------------------
  |  Branch (550:13): [True: 0, False: 207k]
  ------------------
  551|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_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)
  |  |  ------------------
  ------------------
  552|      0|            return 0;
  553|      0|        }
  554|   207k|        in += nextblocks;
  555|   207k|        inl -= nextblocks;
  556|   207k|    }
  557|   207k|    if (inl != 0
  ------------------
  |  Branch (557:9): [True: 0, False: 207k]
  ------------------
  558|   207k|        && !ossl_cipher_trailingdata(ctx->buf, &ctx->bufsz, blksz, &in, &inl)) {
  ------------------
  |  Branch (558:12): [True: 0, False: 0]
  ------------------
  559|       |        /* ERR_raise already called */
  560|      0|        return 0;
  561|      0|    }
  562|       |
  563|   207k|    *outl = outlint;
  564|   207k|    return inl == 0;
  565|   207k|}
ossl_cipher_generic_get_ctx_params:
  749|  1.15k|{
  750|  1.15k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  751|  1.15k|    OSSL_PARAM *p;
  752|       |
  753|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  193|  1.15k|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  754|  1.15k|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->ivlen)) {
  ------------------
  |  Branch (754:9): [True: 0, False: 1.15k]
  |  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|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  197|  1.15k|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  759|  1.15k|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->pad)) {
  ------------------
  |  Branch (759:9): [True: 0, False: 1.15k]
  |  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|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
  ------------------
  |  |  192|  1.15k|# define OSSL_CIPHER_PARAM_IV "iv"
  ------------------
  764|  1.15k|    if (p != NULL
  ------------------
  |  Branch (764:9): [True: 0, False: 1.15k]
  ------------------
  765|  1.15k|        && !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|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
  ------------------
  |  |  215|  1.15k|# define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv"
  ------------------
  770|  1.15k|    if (p != NULL
  ------------------
  |  Branch (770:9): [True: 0, False: 1.15k]
  ------------------
  771|  1.15k|        && !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|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  196|  1.15k|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  776|  1.15k|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->num)) {
  ------------------
  |  Branch (776:9): [True: 0, False: 1.15k]
  |  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|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  194|  1.15k|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  781|  1.15k|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->keylen)) {
  ------------------
  |  Branch (781:9): [True: 1.15k, False: 0]
  |  Branch (781:22): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS_MAC);
  ------------------
  |  |  212|  1.15k|# define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac"
  ------------------
  786|  1.15k|    if (p != NULL
  ------------------
  |  Branch (786:9): [True: 0, False: 1.15k]
  ------------------
  787|  1.15k|        && !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|  1.15k|    return 1;
  792|  1.15k|}
ossl_cipher_generic_set_ctx_params:
  795|  1.15k|{
  796|  1.15k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  797|  1.15k|    const OSSL_PARAM *p;
  798|       |
  799|  1.15k|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (799:9): [True: 1.15k, False: 0]
  ------------------
  800|  1.15k|        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|  1.15k|{
  868|  1.15k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  869|       |
  870|  1.15k|    if ((flags & PROV_CIPHER_FLAG_INVERSE_CIPHER) != 0)
  ------------------
  |  |   46|  1.15k|# define PROV_CIPHER_FLAG_INVERSE_CIPHER   0x0200
  ------------------
  |  Branch (870:9): [True: 0, False: 1.15k]
  ------------------
  871|      0|        ctx->inverse_cipher = 1;
  872|  1.15k|    if ((flags & PROV_CIPHER_FLAG_VARIABLE_LENGTH) != 0)
  ------------------
  |  |   45|  1.15k|# define PROV_CIPHER_FLAG_VARIABLE_LENGTH  0x0100
  ------------------
  |  Branch (872:9): [True: 0, False: 1.15k]
  ------------------
  873|      0|        ctx->variable_keylength = 1;
  874|       |
  875|  1.15k|    ctx->pad = 1;
  876|  1.15k|    ctx->keylen = ((kbits) / 8);
  877|  1.15k|    ctx->ivlen = ((ivbits) / 8);
  878|  1.15k|    ctx->hw = hw;
  879|  1.15k|    ctx->mode = mode;
  880|  1.15k|    ctx->blocksize = blkbits / 8;
  881|  1.15k|    if (provctx != NULL)
  ------------------
  |  Branch (881:9): [True: 1.15k, False: 0]
  ------------------
  882|  1.15k|        ctx->libctx = PROV_LIBCTX_OF(provctx); /* used for rand */
  ------------------
  |  |   31|  1.15k|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  883|  1.15k|}
ciphercommon.c:cipher_generic_init_internal:
  344|  1.15k|{
  345|  1.15k|    ctx->num = 0;
  346|  1.15k|    ctx->bufsz = 0;
  347|  1.15k|    ctx->updated = 0;
  348|  1.15k|    ctx->enc = enc ? 1 : 0;
  ------------------
  |  Branch (348:16): [True: 1.15k, False: 0]
  ------------------
  349|       |
  350|  1.15k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (350:9): [True: 0, False: 1.15k]
  ------------------
  351|      0|        return 0;
  352|       |
  353|  1.15k|    if (iv != NULL && ctx->mode != EVP_CIPH_ECB_MODE) {
  ------------------
  |  |  322|      0|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (353:9): [True: 0, False: 1.15k]
  |  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|  1.15k|    if (iv == NULL && ctx->iv_set
  ------------------
  |  Branch (357:9): [True: 1.15k, False: 0]
  |  Branch (357:23): [True: 0, False: 1.15k]
  ------------------
  358|  1.15k|        && (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|  1.15k|    if (key != NULL) {
  ------------------
  |  Branch (364:9): [True: 1.15k, False: 0]
  ------------------
  365|  1.15k|        if (ctx->variable_keylength == 0) {
  ------------------
  |  Branch (365:13): [True: 1.15k, False: 0]
  ------------------
  366|  1.15k|            if (keylen != ctx->keylen) {
  ------------------
  |  Branch (366:17): [True: 0, False: 1.15k]
  ------------------
  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|  1.15k|        } else {
  371|      0|            ctx->keylen = keylen;
  372|      0|        }
  373|  1.15k|        if (!ctx->hw->init(ctx, key, ctx->keylen))
  ------------------
  |  Branch (373:13): [True: 0, False: 1.15k]
  ------------------
  374|      0|            return 0;
  375|  1.15k|        ctx->key_set = 1;
  376|  1.15k|    }
  377|  1.15k|    return ossl_cipher_generic_set_ctx_params(ctx, params);
  378|  1.15k|}

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|  1.15k|static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
  205|  1.15k|{                                                                              \
  206|  1.15k|     PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |  104|  1.15k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (206:32): [True: 1.15k, False: 0]
  ------------------
  207|  1.15k|                                                     : NULL;                   \
  208|  1.15k|     if (ctx != NULL) {                                                        \
  ------------------
  |  Branch (208:10): [True: 1.15k, False: 0]
  ------------------
  209|  1.15k|         ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits,              \
  210|  1.15k|                                     EVP_CIPH_##UCMODE##_MODE, flags,          \
  211|  1.15k|                                     ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\
  212|  1.15k|                                     provctx);                                 \
  213|  1.15k|     }                                                                         \
  214|  1.15k|     return ctx;                                                               \
  215|  1.15k|}                                                                              \
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|      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_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|      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_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|      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_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|      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_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|      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_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|      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:aes_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|}                                                                              \
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:aes_256_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_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|      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_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|      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_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|}                                                                              \

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|  2.30k|{
   21|  2.30k|    return 1;
   22|  2.30k|}

ossl_quic_srtm_new:
  111|  1.15k|{
  112|  1.15k|    QUIC_SRTM *srtm = NULL;
  113|  1.15k|    unsigned char key[16];
  114|  1.15k|    EVP_CIPHER *ecb = NULL;
  115|       |
  116|  1.15k|    if (RAND_priv_bytes_ex(libctx, key, sizeof(key), sizeof(key) * 8) != 1)
  ------------------
  |  Branch (116:9): [True: 0, False: 1.15k]
  ------------------
  117|      0|        goto err;
  118|       |
  119|  1.15k|    if ((srtm = OPENSSL_zalloc(sizeof(*srtm))) == NULL)
  ------------------
  |  |  104|  1.15k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 1.15k]
  ------------------
  120|      0|        return NULL;
  121|       |
  122|       |    /* Use AES-128-ECB as a permutation over 128-bit SRTs. */
  123|  1.15k|    if ((ecb = EVP_CIPHER_fetch(libctx, "AES-128-ECB", propq)) == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 1.15k]
  ------------------
  124|      0|        goto err;
  125|       |
  126|  1.15k|    if ((srtm->blind_ctx = EVP_CIPHER_CTX_new()) == NULL)
  ------------------
  |  Branch (126:9): [True: 0, False: 1.15k]
  ------------------
  127|      0|        goto err;
  128|       |
  129|  1.15k|    if (!EVP_EncryptInit_ex2(srtm->blind_ctx, ecb, key, NULL, NULL))
  ------------------
  |  Branch (129:9): [True: 0, False: 1.15k]
  ------------------
  130|      0|        goto err;
  131|       |
  132|  1.15k|    EVP_CIPHER_free(ecb);
  133|  1.15k|    ecb = NULL;
  134|       |
  135|       |    /* Create mappings. */
  136|  1.15k|    if ((srtm->items_fwd = lh_SRTM_ITEM_new(items_fwd_hash, items_fwd_cmp)) == NULL
  ------------------
  |  Branch (136:9): [True: 0, False: 1.15k]
  ------------------
  137|  1.15k|        || (srtm->items_rev = lh_SRTM_ITEM_new(items_rev_hash, items_rev_cmp)) == NULL)
  ------------------
  |  Branch (137:12): [True: 0, False: 1.15k]
  ------------------
  138|      0|        goto err;
  139|       |
  140|  1.15k|    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|  1.15k|}
ossl_quic_srtm_free:
  165|  1.15k|{
  166|  1.15k|    if (srtm == NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 1.15k]
  ------------------
  167|      0|        return;
  168|       |
  169|  1.15k|    lh_SRTM_ITEM_free(srtm->items_rev);
  170|  1.15k|    if (srtm->items_fwd != NULL) {
  ------------------
  |  Branch (170:9): [True: 1.15k, False: 0]
  ------------------
  171|  1.15k|        lh_SRTM_ITEM_doall(srtm->items_fwd, srtm_free_each);
  172|  1.15k|        lh_SRTM_ITEM_free(srtm->items_fwd);
  173|  1.15k|    }
  174|       |
  175|  1.15k|    EVP_CIPHER_CTX_free(srtm->blind_ctx);
  176|  1.15k|    OPENSSL_free(srtm);
  ------------------
  |  |  115|  1.15k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.15k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.15k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|  1.15k|}
ossl_quic_srtm_add:
  284|   309k|{
  285|   309k|    SRTM_ITEM *item = NULL, *head = NULL, *new_head, *r_item;
  286|       |
  287|   309k|    if (srtm->alloc_failed)
  ------------------
  |  Branch (287:9): [True: 0, False: 309k]
  ------------------
  288|      0|        return 0;
  289|       |
  290|       |    /* (opaque, seq_num) duplicates not allowed */
  291|   309k|    if ((item = srtm_find(srtm, opaque, seq_num, &head, NULL)) != NULL)
  ------------------
  |  Branch (291:9): [True: 159k, False: 150k]
  ------------------
  292|   159k|        return 0;
  293|       |
  294|   150k|    if ((item = OPENSSL_zalloc(sizeof(*item))) == NULL)
  ------------------
  |  |  104|   150k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   150k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   150k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (294:9): [True: 0, False: 150k]
  ------------------
  295|      0|        return 0;
  296|       |
  297|   150k|    item->opaque    = opaque;
  298|   150k|    item->seq_num   = seq_num;
  299|   150k|    item->srt       = *token;
  300|   150k|    if (!srtm_compute_blinded(srtm, item, &item->srt)) {
  ------------------
  |  Branch (300:9): [True: 0, False: 150k]
  ------------------
  301|      0|        OPENSSL_free(item);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  302|      0|        return 0;
  303|      0|    }
  304|       |
  305|       |    /* Add to forward mapping. */
  306|   150k|    if (head == NULL) {
  ------------------
  |  Branch (306:9): [True: 105k, False: 44.4k]
  ------------------
  307|       |        /* First item under this opaque */
  308|   105k|        lh_SRTM_ITEM_insert(srtm->items_fwd, item);
  309|   105k|        if (!srtm_check_lh(srtm, srtm->items_fwd)) {
  ------------------
  |  Branch (309:13): [True: 0, False: 105k]
  ------------------
  310|      0|            OPENSSL_free(item);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  311|      0|            return 0;
  312|      0|        }
  313|   105k|    } else {
  314|  44.4k|        sorted_insert_seq_num(head, item, &new_head);
  315|  44.4k|        if (new_head != head) { /* head changed, update in lhash */
  ------------------
  |  Branch (315:13): [True: 7.51k, False: 36.9k]
  ------------------
  316|  7.51k|            lh_SRTM_ITEM_insert(srtm->items_fwd, new_head);
  317|  7.51k|            if (!srtm_check_lh(srtm, srtm->items_fwd)) {
  ------------------
  |  Branch (317:17): [True: 0, False: 7.51k]
  ------------------
  318|      0|                OPENSSL_free(item);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  319|      0|                return 0;
  320|      0|            }
  321|  7.51k|        }
  322|  44.4k|    }
  323|       |
  324|       |    /* Add to reverse mapping. */
  325|   150k|    r_item = lh_SRTM_ITEM_retrieve(srtm->items_rev, item);
  326|   150k|    if (r_item == NULL) {
  ------------------
  |  Branch (326:9): [True: 139k, False: 10.6k]
  ------------------
  327|       |        /* First item under this blinded SRT */
  328|   139k|        lh_SRTM_ITEM_insert(srtm->items_rev, item);
  329|   139k|        if (!srtm_check_lh(srtm, srtm->items_rev))
  ------------------
  |  Branch (329:13): [True: 0, False: 139k]
  ------------------
  330|       |            /*
  331|       |             * Can't free the item now as we would have to undo the insertion
  332|       |             * into the forward mapping which would require an insert operation
  333|       |             * to restore the previous value. which might also fail. However,
  334|       |             * the item will be freed OK when we free the entire SRTM.
  335|       |             */
  336|      0|            return 0;
  337|   139k|    } else {
  338|  10.6k|        sorted_insert_srt(r_item, item, &new_head);
  339|  10.6k|        if (new_head != r_item) { /* head changed, update in lhash */
  ------------------
  |  Branch (339:13): [True: 4.41k, False: 6.25k]
  ------------------
  340|  4.41k|            lh_SRTM_ITEM_insert(srtm->items_rev, new_head);
  341|  4.41k|            if (!srtm_check_lh(srtm, srtm->items_rev))
  ------------------
  |  Branch (341:17): [True: 0, False: 4.41k]
  ------------------
  342|       |                /* As above. */
  343|      0|                return 0;
  344|  4.41k|        }
  345|  10.6k|    }
  346|       |
  347|   150k|    return 1;
  348|   150k|}
ossl_quic_srtm_remove:
  380|  67.3k|{
  381|  67.3k|    SRTM_ITEM *item, *prev = NULL;
  382|       |
  383|  67.3k|    if (srtm->alloc_failed)
  ------------------
  |  Branch (383:9): [True: 0, False: 67.3k]
  ------------------
  384|      0|        return 0;
  385|       |
  386|  67.3k|    if ((item = srtm_find(srtm, opaque, seq_num, NULL, &prev)) == NULL)
  ------------------
  |  Branch (386:9): [True: 64.2k, False: 3.05k]
  ------------------
  387|       |        /* No match */
  388|  64.2k|        return 0;
  389|       |
  390|       |    /* Remove from forward mapping. */
  391|  3.05k|    if (prev == NULL) {
  ------------------
  |  Branch (391:9): [True: 1.22k, False: 1.83k]
  ------------------
  392|       |        /*
  393|       |         * Change lhash to point to item after this one, or remove the entry if
  394|       |         * this is the last one.
  395|       |         */
  396|  1.22k|        if (item->next_by_seq_num != NULL) {
  ------------------
  |  Branch (396:13): [True: 226, False: 999]
  ------------------
  397|    226|            lh_SRTM_ITEM_insert(srtm->items_fwd, item->next_by_seq_num);
  398|    226|            if (!srtm_check_lh(srtm, srtm->items_fwd))
  ------------------
  |  Branch (398:17): [True: 0, False: 226]
  ------------------
  399|      0|                return 0;
  400|    999|        } else {
  401|    999|            lh_SRTM_ITEM_delete(srtm->items_fwd, item);
  402|    999|        }
  403|  1.83k|    } else {
  404|  1.83k|        prev->next_by_seq_num = item->next_by_seq_num;
  405|  1.83k|    }
  406|       |
  407|       |    /* Remove from reverse mapping. */
  408|  3.05k|    if (!srtm_remove_from_rev(srtm, item))
  ------------------
  |  Branch (408:9): [True: 0, False: 3.05k]
  ------------------
  409|      0|        return 0;
  410|       |
  411|  3.05k|    OPENSSL_free(item);
  ------------------
  |  |  115|  3.05k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  3.05k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  3.05k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  412|  3.05k|    return 1;
  413|  3.05k|}
ossl_quic_srtm_cull:
  416|   192k|{
  417|   192k|    SRTM_ITEM key, *item = NULL, *inext, *ihead;
  418|       |
  419|   192k|    key.opaque = opaque;
  420|       |
  421|   192k|    if (srtm->alloc_failed)
  ------------------
  |  Branch (421:9): [True: 0, False: 192k]
  ------------------
  422|      0|        return 0;
  423|       |
  424|   192k|    if ((ihead = lh_SRTM_ITEM_retrieve(srtm->items_fwd, &key)) == NULL)
  ------------------
  |  Branch (424:9): [True: 189k, False: 2.75k]
  ------------------
  425|   189k|        return 1; /* nothing removed is a success condition */
  426|       |
  427|  42.7k|    for (item = ihead; item != NULL; item = inext) {
  ------------------
  |  Branch (427:24): [True: 39.9k, False: 2.75k]
  ------------------
  428|  39.9k|        inext = item->next_by_seq_num;
  429|  39.9k|        if (item != ihead) {
  ------------------
  |  Branch (429:13): [True: 37.2k, False: 2.75k]
  ------------------
  430|  37.2k|            srtm_remove_from_rev(srtm, item);
  431|  37.2k|            OPENSSL_free(item);
  ------------------
  |  |  115|  37.2k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  37.2k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  37.2k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  432|  37.2k|        }
  433|  39.9k|    }
  434|       |
  435|  2.75k|    lh_SRTM_ITEM_delete(srtm->items_fwd, ihead);
  436|  2.75k|    srtm_remove_from_rev(srtm, ihead);
  437|  2.75k|    OPENSSL_free(ihead);
  ------------------
  |  |  115|  2.75k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  2.75k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  2.75k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  438|  2.75k|    return 1;
  439|   192k|}
ossl_quic_srtm_lookup:
  445|  56.8k|{
  446|  56.8k|    SRTM_ITEM key, *item;
  447|       |
  448|  56.8k|    if (srtm->alloc_failed)
  ------------------
  |  Branch (448:9): [True: 0, False: 56.8k]
  ------------------
  449|      0|        return 0;
  450|       |
  451|  56.8k|    if (!srtm_compute_blinded(srtm, &key, token))
  ------------------
  |  Branch (451:9): [True: 0, False: 56.8k]
  ------------------
  452|      0|        return 0;
  453|       |
  454|  56.8k|    item = lh_SRTM_ITEM_retrieve(srtm->items_rev, &key);
  455|  97.8k|    for (; idx > 0 && item != NULL; --idx, item = item->next_by_srt_blinded);
  ------------------
  |  Branch (455:12): [True: 95.8k, False: 2.01k]
  |  Branch (455:23): [True: 41.0k, False: 54.8k]
  ------------------
  456|  56.8k|    if (item == NULL)
  ------------------
  |  Branch (456:9): [True: 56.5k, False: 358]
  ------------------
  457|  56.5k|        return 0;
  458|       |
  459|    358|    if (opaque != NULL)
  ------------------
  |  Branch (459:9): [True: 0, False: 358]
  ------------------
  460|      0|        *opaque     = item->opaque;
  461|    358|    if (seq_num != NULL)
  ------------------
  |  Branch (461:9): [True: 0, False: 358]
  ------------------
  462|      0|        *seq_num    = item->seq_num;
  463|       |
  464|    358|    return 1;
  465|  56.8k|}
ossl_quic_srtm_check:
  528|   626k|{
  529|   626k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  530|   626k|    struct check_args args = {0};
  531|   626k|    size_t tokens_expected, tokens_expected_old;
  532|       |
  533|   626k|    args.token = token_next;
  534|   626k|    ++token_next;
  535|       |
  536|   626k|    assert(srtm != NULL);
  537|   626k|    assert(srtm->blind_ctx != NULL);
  538|   626k|    assert(srtm->items_fwd != NULL);
  539|   626k|    assert(srtm->items_rev != NULL);
  540|       |
  541|   626k|    tokens_seen = 0;
  542|   626k|    lh_SRTM_ITEM_doall_arg(srtm->items_fwd, check_mark, &args);
  543|       |
  544|   626k|    tokens_expected = tokens_seen;
  545|   626k|    tokens_seen = 0;
  546|   626k|    lh_SRTM_ITEM_doall_arg(srtm->items_rev, check_count, &args);
  547|       |
  548|   626k|    assert(tokens_seen == tokens_expected);
  549|   626k|    tokens_expected_old = tokens_expected;
  550|       |
  551|   626k|    args.token = token_next;
  552|   626k|    ++token_next;
  553|       |
  554|   626k|    args.mode = 1;
  555|   626k|    tokens_seen = 0;
  556|   626k|    lh_SRTM_ITEM_doall_arg(srtm->items_rev, check_mark, &args);
  557|       |
  558|   626k|    tokens_expected = tokens_seen;
  559|   626k|    tokens_seen = 0;
  560|   626k|    lh_SRTM_ITEM_doall_arg(srtm->items_fwd, check_count, &args);
  561|       |
  562|   626k|    assert(tokens_seen == tokens_expected);
  563|   626k|    assert(tokens_seen == tokens_expected_old);
  564|   626k|#endif
  565|   626k|}
quic_srtm.c:items_fwd_hash:
   70|   686k|{
   71|   686k|    return (unsigned long)(uintptr_t)item->opaque;
   72|   686k|}
quic_srtm.c:items_fwd_cmp:
   75|   227k|{
   76|   227k|    return a->opaque != b->opaque;
   77|   227k|}
quic_srtm.c:items_rev_hash:
   80|   433k|{
   81|       |    /*
   82|       |     * srt_blinded has already been through a crypto-grade hash function, so we
   83|       |     * can just use bits from that.
   84|       |     */
   85|   433k|    unsigned long l;
   86|       |
   87|   433k|    memcpy(&l, item->srt_blinded, sizeof(l));
   88|   433k|    return l;
   89|   433k|}
quic_srtm.c:items_rev_cmp:
   92|   110k|{
   93|       |    /*
   94|       |     * We don't need to use CRYPTO_memcmp here as the relationship of
   95|       |     * srt_blinded to srt is already cryptographically obfuscated.
   96|       |     */
   97|   110k|    return memcmp(a->srt_blinded, b->srt_blinded, sizeof(a->srt_blinded));
   98|   110k|}
quic_srtm.c:srtm_free_each:
  153|   102k|{
  154|   102k|    SRTM_ITEM *inext, *item = ihead;
  155|       |
  156|   107k|    for (item = item->next_by_seq_num; item != NULL; item = inext) {
  ------------------
  |  Branch (156:40): [True: 5.22k, False: 102k]
  ------------------
  157|  5.22k|        inext = item->next_by_seq_num;
  158|  5.22k|        OPENSSL_free(item);
  ------------------
  |  |  115|  5.22k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  5.22k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  5.22k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  159|  5.22k|    }
  160|       |
  161|   102k|    OPENSSL_free(ihead);
  ------------------
  |  |  115|   102k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   102k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   102k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  162|   102k|}
quic_srtm.c:srtm_find:
  188|   377k|{
  189|   377k|    SRTM_ITEM key, *item = NULL, *prev = NULL;
  190|       |
  191|   377k|    key.opaque  = opaque;
  192|       |
  193|   377k|    item = lh_SRTM_ITEM_retrieve(srtm->items_fwd, &key);
  194|   377k|    if (head_p != NULL)
  ------------------
  |  Branch (194:9): [True: 309k, False: 67.3k]
  ------------------
  195|   309k|        *head_p = item;
  196|       |
  197|  2.16M|    for (; item != NULL; prev = item, item = item->next_by_seq_num)
  ------------------
  |  Branch (197:12): [True: 1.99M, False: 172k]
  ------------------
  198|  1.99M|        if (item->seq_num == seq_num) {
  ------------------
  |  Branch (198:13): [True: 162k, False: 1.82M]
  ------------------
  199|   162k|            break;
  200|  1.82M|        } else if (item->seq_num < seq_num) {
  ------------------
  |  Branch (200:20): [True: 42.4k, False: 1.78M]
  ------------------
  201|       |            /*
  202|       |             * List is sorted in descending order so there can't be any match
  203|       |             * after this.
  204|       |             */
  205|  42.4k|            item = NULL;
  206|  42.4k|            break;
  207|  42.4k|        }
  208|       |
  209|   377k|    if (prev_p != NULL)
  ------------------
  |  Branch (209:9): [True: 67.3k, False: 309k]
  ------------------
  210|  67.3k|        *prev_p = prev;
  211|       |
  212|   377k|    return item;
  213|   377k|}
quic_srtm.c:srtm_compute_blinded:
  264|   207k|{
  265|   207k|    int outl = 0;
  266|       |
  267|       |    /*
  268|       |     * We use AES-128-ECB as a permutation using a random key to facilitate
  269|       |     * blinding for side-channel purposes. Encrypt the token as a single AES
  270|       |     * block.
  271|       |     */
  272|   207k|    if (!EVP_EncryptUpdate(srtm->blind_ctx, item->srt_blinded, &outl,
  ------------------
  |  Branch (272:9): [True: 0, False: 207k]
  ------------------
  273|   207k|                           (const unsigned char *)token, sizeof(*token)))
  274|      0|        return 0;
  275|       |
  276|   207k|    if (!ossl_assert(outl == sizeof(*token)))
  ------------------
  |  |   52|   207k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   207k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (276:9): [True: 0, False: 207k]
  ------------------
  277|      0|        return 0;
  278|       |
  279|   207k|    return 1;
  280|   207k|}
quic_srtm.c:srtm_check_lh:
  101|   259k|{
  102|   259k|    if (lh_SRTM_ITEM_error(lh)) {
  ------------------
  |  Branch (102:9): [True: 0, False: 259k]
  ------------------
  103|      0|        srtm->alloc_failed = 1;
  104|      0|        return 0;
  105|      0|    }
  106|       |
  107|   259k|    return 1;
  108|   259k|}
quic_srtm.c:sorted_insert_seq_num:
  221|  44.4k|{
  222|  44.4k|    uint64_t seq_num = item->seq_num;
  223|  44.4k|    SRTM_ITEM *cur = head, **fixup = new_head;
  224|       |
  225|  44.4k|    *new_head = head;
  226|       |
  227|   384k|    while (cur != NULL && cur->seq_num > seq_num) {
  ------------------
  |  Branch (227:12): [True: 378k, False: 5.29k]
  |  Branch (227:27): [True: 339k, False: 39.1k]
  ------------------
  228|   339k|        fixup = &cur->next_by_seq_num;
  229|   339k|        cur = cur->next_by_seq_num;
  230|   339k|    }
  231|       |
  232|  44.4k|    item->next_by_seq_num = *fixup;
  233|  44.4k|    *fixup = item;
  234|  44.4k|}
quic_srtm.c:sorted_insert_srt:
  242|  10.6k|{
  243|  10.6k|    uintptr_t opaque = (uintptr_t)item->opaque;
  244|  10.6k|    SRTM_ITEM *cur = head, **fixup = new_head;
  245|       |
  246|  10.6k|    *new_head = head;
  247|       |
  248|   120k|    while (cur != NULL && (uintptr_t)cur->opaque > opaque) {
  ------------------
  |  Branch (248:12): [True: 117k, False: 2.55k]
  |  Branch (248:27): [True: 109k, False: 8.12k]
  ------------------
  249|   109k|        fixup = &cur->next_by_srt_blinded;
  250|   109k|        cur = cur->next_by_srt_blinded;
  251|   109k|    }
  252|       |
  253|  10.6k|    item->next_by_srt_blinded = *fixup;
  254|  10.6k|    *fixup = item;
  255|  10.6k|}
quic_srtm.c:srtm_remove_from_rev:
  352|  43.0k|{
  353|  43.0k|    SRTM_ITEM *rh_item;
  354|       |
  355|  43.0k|    rh_item = lh_SRTM_ITEM_retrieve(srtm->items_rev, item);
  356|  43.0k|    assert(rh_item != NULL);
  357|  43.0k|    if (rh_item == item) {
  ------------------
  |  Branch (357:9): [True: 39.4k, False: 3.57k]
  ------------------
  358|       |        /*
  359|       |         * Change lhash to point to item after this one, or remove the entry if
  360|       |         * this is the last one.
  361|       |         */
  362|  39.4k|        if (item->next_by_srt_blinded != NULL) {
  ------------------
  |  Branch (362:13): [True: 1.72k, False: 37.7k]
  ------------------
  363|  1.72k|            lh_SRTM_ITEM_insert(srtm->items_rev, item->next_by_srt_blinded);
  364|  1.72k|            if (!srtm_check_lh(srtm, srtm->items_rev))
  ------------------
  |  Branch (364:17): [True: 0, False: 1.72k]
  ------------------
  365|      0|                return 0;
  366|  37.7k|        } else {
  367|  37.7k|            lh_SRTM_ITEM_delete(srtm->items_rev, item);
  368|  37.7k|        }
  369|  39.4k|    } else {
  370|       |        /* Find our entry in the SRT list */
  371|  29.6k|        for (; rh_item->next_by_srt_blinded != item;
  ------------------
  |  Branch (371:16): [True: 26.0k, False: 3.57k]
  ------------------
  372|  26.0k|               rh_item = rh_item->next_by_srt_blinded);
  373|  3.57k|        rh_item->next_by_srt_blinded = item->next_by_srt_blinded;
  374|  3.57k|    }
  375|       |
  376|  43.0k|    return 1;
  377|  43.0k|}
quic_srtm.c:check_mark:
  478|   449M|{
  479|   449M|    struct check_args *arg_ = arg;
  480|   449M|    uint32_t token = arg_->token;
  481|   449M|    uint64_t prev_seq_num = 0;
  482|   449M|    void *prev_opaque = NULL;
  483|   449M|    int have_prev = 0;
  484|       |
  485|   449M|    assert(item != NULL);
  486|       |
  487|   939M|    while (item != NULL) {
  ------------------
  |  Branch (487:12): [True: 489M, False: 449M]
  ------------------
  488|   489M|        if (have_prev) {
  ------------------
  |  Branch (488:13): [True: 39.6M, False: 449M]
  ------------------
  489|  39.6M|            assert(!(item->opaque == prev_opaque && item->seq_num == prev_seq_num));
  490|  39.6M|            if (!arg_->mode)
  ------------------
  |  Branch (490:17): [True: 17.3M, False: 22.2M]
  ------------------
  491|  17.3M|                assert(item->opaque != prev_opaque || item->seq_num < prev_seq_num);
  492|  39.6M|        }
  493|       |
  494|   489M|        ++tokens_seen;
  495|   489M|        item->debug_token = token;
  496|   489M|        prev_opaque  = item->opaque;
  497|   489M|        prev_seq_num = item->seq_num;
  498|   489M|        have_prev = 1;
  499|       |
  500|   489M|        if (arg_->mode)
  ------------------
  |  Branch (500:13): [True: 244M, False: 244M]
  ------------------
  501|   244M|            item = item->next_by_srt_blinded;
  502|   244M|        else
  503|   244M|            item = item->next_by_seq_num;
  504|   489M|    }
  505|   449M|}
quic_srtm.c:check_count:
  508|   449M|{
  509|   449M|    struct check_args *arg_ = arg;
  510|   449M|    uint32_t token = arg_->token;
  511|       |
  512|   449M|    assert(item != NULL);
  513|       |
  514|   939M|    while (item != NULL) {
  ------------------
  |  Branch (514:12): [True: 489M, False: 449M]
  ------------------
  515|   489M|        ++tokens_seen;
  516|   489M|        assert(item->debug_token == token);
  517|       |
  518|   489M|        if (arg_->mode)
  ------------------
  |  Branch (518:13): [True: 244M, False: 244M]
  ------------------
  519|   244M|            item = item->next_by_seq_num;
  520|   244M|        else
  521|   244M|            item = item->next_by_srt_blinded;
  522|   489M|    }
  523|   449M|}

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|}
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_COMP_get_compression_methods:
 1980|      2|{
 1981|      2|    STACK_OF(SSL_COMP) **rv;
  ------------------
  |  |   31|      2|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1982|       |
 1983|      2|    rv = (STACK_OF(SSL_COMP) **)OSSL_LIB_CTX_get_data(NULL,
 1984|      2|                                     OSSL_LIB_CTX_COMP_METHODS);
  ------------------
  |  |  121|      2|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
 1985|      2|    if (rv != NULL)
  ------------------
  |  Branch (1985:9): [True: 2, False: 0]
  ------------------
 1986|      2|        return *rv;
 1987|      0|    else
 1988|      0|        return NULL;
 1989|      2|}

OPENSSL_init_ssl:
   47|      2|{
   48|      2|    static int stoperrset = 0;
   49|       |
   50|      2|    if (stopped) {
  ------------------
  |  Branch (50:9): [True: 0, False: 2]
  ------------------
   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|      2|    opts |= OPENSSL_INIT_ADD_ALL_CIPHERS
  ------------------
  |  |  468|      2|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
   64|      2|         |  OPENSSL_INIT_ADD_ALL_DIGESTS;
  ------------------
  |  |  469|      2|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
   65|      2|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   66|      2|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG) == 0)
  ------------------
  |  |  473|      2|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (66:9): [True: 2, False: 0]
  ------------------
   67|      2|        opts |= OPENSSL_INIT_LOAD_CONFIG;
  ------------------
  |  |  472|      2|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   68|      2|#endif
   69|       |
   70|      2|    if (!OPENSSL_init_crypto(opts, settings))
  ------------------
  |  Branch (70:9): [True: 0, False: 2]
  ------------------
   71|      0|        return 0;
   72|       |
   73|      2|    if (!RUN_ONCE(&ssl_base, ossl_init_ssl_base))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (73:9): [True: 0, False: 2]
  ------------------
   74|      0|        return 0;
   75|       |
   76|      2|    return 1;
   77|      2|}
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|}

