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

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

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

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

bio_cleanup:
  947|      1|{
  948|      1|#ifndef OPENSSL_NO_SOCK
  949|      1|    bio_sock_cleanup_int();
  950|      1|    CRYPTO_THREAD_lock_free(bio_lookup_lock);
  951|      1|    bio_lookup_lock = NULL;
  952|      1|#endif
  953|      1|    CRYPTO_FREE_REF(&bio_type_count);
  954|      1|}

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.4k|    while (state != DP_S_DONE) {
  ------------------
  |  |   52|  12.4k|#define DP_S_DONE       7
  ------------------
  |  Branch (110:12): [True: 11.0k, False: 1.38k]
  ------------------
  111|  11.0k|        if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
  ------------------
  |  Branch (111:13): [True: 1.38k, False: 9.71k]
  |  Branch (111:28): [True: 9.71k, False: 0]
  |  Branch (111:46): [True: 0, False: 9.71k]
  ------------------
  112|  1.38k|            state = DP_S_DONE;
  ------------------
  |  |   52|  1.38k|#define DP_S_DONE       7
  ------------------
  113|       |
  114|  11.0k|        switch (state) {
  115|  2.78k|        case DP_S_DEFAULT:
  ------------------
  |  |   45|  2.78k|#define DP_S_DEFAULT    0
  ------------------
  |  Branch (115:9): [True: 2.78k, False: 8.31k]
  ------------------
  116|  2.78k|            if (ch == '%')
  ------------------
  |  Branch (116:17): [True: 1.38k, False: 1.39k]
  ------------------
  117|  1.38k|                state = DP_S_FLAGS;
  ------------------
  |  |   46|  1.38k|#define DP_S_FLAGS      1
  ------------------
  118|  1.39k|            else
  119|  1.39k|                if (!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
  ------------------
  |  Branch (119:21): [True: 0, False: 1.39k]
  ------------------
  120|      0|                    return 0;
  121|  2.78k|            ch = *format++;
  122|  2.78k|            break;
  123|  1.38k|        case DP_S_FLAGS:
  ------------------
  |  |   46|  1.38k|#define DP_S_FLAGS      1
  ------------------
  |  Branch (123:9): [True: 1.38k, False: 9.71k]
  ------------------
  124|  1.38k|            switch (ch) {
  125|      0|            case '-':
  ------------------
  |  Branch (125:13): [True: 0, False: 1.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  142|      0|                flags |= DP_F_ZERO;
  ------------------
  |  |   64|      0|#define DP_F_ZERO       (1 << 4)
  ------------------
  143|      0|                ch = *format++;
  144|      0|                break;
  145|  1.38k|            default:
  ------------------
  |  Branch (145:13): [True: 1.38k, False: 0]
  ------------------
  146|  1.38k|                state = DP_S_MIN;
  ------------------
  |  |   47|  1.38k|#define DP_S_MIN        2
  ------------------
  147|  1.38k|                break;
  148|  1.38k|            }
  149|  1.38k|            break;
  150|  1.38k|        case DP_S_MIN:
  ------------------
  |  |   47|  1.38k|#define DP_S_MIN        2
  ------------------
  |  Branch (150:9): [True: 1.38k, False: 9.71k]
  ------------------
  151|  1.38k|            if (ossl_isdigit(ch)) {
  ------------------
  |  Branch (151:17): [True: 0, False: 1.38k]
  ------------------
  152|      0|                min = 10 * min + char_to_int(ch);
  ------------------
  |  |   83|      0|#define char_to_int(p) (p - '0')
  ------------------
  153|      0|                ch = *format++;
  154|  1.38k|            } else if (ch == '*') {
  ------------------
  |  Branch (154:24): [True: 0, False: 1.38k]
  ------------------
  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.38k|                state = DP_S_DOT;
  ------------------
  |  |   48|  1.38k|#define DP_S_DOT        3
  ------------------
  160|  1.38k|            break;
  161|  1.38k|        case DP_S_DOT:
  ------------------
  |  |   48|  1.38k|#define DP_S_DOT        3
  ------------------
  |  Branch (161:9): [True: 1.38k, False: 9.71k]
  ------------------
  162|  1.38k|            if (ch == '.') {
  ------------------
  |  Branch (162:17): [True: 0, False: 1.38k]
  ------------------
  163|      0|                state = DP_S_MAX;
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  164|      0|                ch = *format++;
  165|      0|            } else
  166|  1.38k|                state = DP_S_MOD;
  ------------------
  |  |   50|  1.38k|#define DP_S_MOD        5
  ------------------
  167|  1.38k|            break;
  168|      0|        case DP_S_MAX:
  ------------------
  |  |   49|      0|#define DP_S_MAX        4
  ------------------
  |  Branch (168:9): [True: 0, False: 11.0k]
  ------------------
  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.38k|        case DP_S_MOD:
  ------------------
  |  |   50|  1.38k|#define DP_S_MOD        5
  ------------------
  |  Branch (181:9): [True: 1.38k, False: 9.71k]
  ------------------
  182|  1.38k|            switch (ch) {
  183|      0|            case 'h':
  ------------------
  |  Branch (183:13): [True: 0, False: 1.38k]
  ------------------
  184|      0|                cflags = DP_C_SHORT;
  ------------------
  |  |   71|      0|#define DP_C_SHORT      1
  ------------------
  185|      0|                ch = *format++;
  186|      0|                break;
  187|  1.38k|            case 'l':
  ------------------
  |  Branch (187:13): [True: 1.38k, False: 5]
  ------------------
  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.38k]
  ------------------
  196|      0|            case 'j':
  ------------------
  |  Branch (196:13): [True: 0, False: 1.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  205|      0|                cflags = DP_C_SIZE;
  ------------------
  |  |   75|      0|#define DP_C_SIZE       5
  ------------------
  206|      0|                ch = *format++;
  207|      0|                break;
  208|      5|            default:
  ------------------
  |  Branch (208:13): [True: 5, False: 1.38k]
  ------------------
  209|      5|                break;
  210|  1.38k|            }
  211|  1.38k|            state = DP_S_CONV;
  ------------------
  |  |   51|  1.38k|#define DP_S_CONV       6
  ------------------
  212|  1.38k|            break;
  213|  1.38k|        case DP_S_CONV:
  ------------------
  |  |   51|  1.38k|#define DP_S_CONV       6
  ------------------
  |  Branch (213:9): [True: 1.38k, False: 9.71k]
  ------------------
  214|  1.38k|            switch (ch) {
  215|      0|            case 'd':
  ------------------
  |  Branch (215:13): [True: 0, False: 1.38k]
  ------------------
  216|      0|            case 'i':
  ------------------
  |  Branch (216:13): [True: 0, False: 1.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  242|      0|            case 'o':
  ------------------
  |  Branch (242:13): [True: 0, False: 1.38k]
  ------------------
  243|  1.38k|            case 'u':
  ------------------
  |  Branch (243:13): [True: 1.38k, False: 5]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  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|      5|            case 's':
  ------------------
  |  Branch (316:13): [True: 5, False: 1.38k]
  ------------------
  317|      5|                strvalue = va_arg(args, char *);
  318|      5|                if (max < 0) {
  ------------------
  |  Branch (318:21): [True: 5, False: 0]
  ------------------
  319|      5|                    if (buffer)
  ------------------
  |  Branch (319:25): [True: 0, False: 5]
  ------------------
  320|      0|                        max = INT_MAX;
  321|      5|                    else
  322|      5|                        max = *maxlen;
  323|      5|                }
  324|      5|                if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
  ------------------
  |  Branch (324:21): [True: 0, False: 5]
  ------------------
  325|      5|                            flags, min, max))
  326|      0|                    return 0;
  327|      5|                break;
  328|      5|            case 'p':
  ------------------
  |  Branch (328:13): [True: 0, False: 1.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  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.38k]
  ------------------
  346|       |                /* not supported yet, treat as next char */
  347|      0|                format++;
  348|      0|                break;
  349|      0|            default:
  ------------------
  |  Branch (349:13): [True: 0, False: 1.38k]
  ------------------
  350|       |                /* unknown, skip */
  351|      0|                break;
  352|  1.38k|            }
  353|  1.38k|            ch = *format++;
  354|  1.38k|            state = DP_S_DEFAULT;
  ------------------
  |  |   45|  1.38k|#define DP_S_DEFAULT    0
  ------------------
  355|  1.38k|            flags = cflags = min = 0;
  356|  1.38k|            max = -1;
  357|  1.38k|            break;
  358|  1.38k|        case DP_S_DONE:
  ------------------
  |  |   52|  1.38k|#define DP_S_DONE       7
  ------------------
  |  Branch (358:9): [True: 1.38k, False: 9.71k]
  ------------------
  359|  1.38k|            break;
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 11.0k]
  ------------------
  361|      0|            break;
  362|  11.0k|        }
  363|  11.0k|    }
  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.35k|{
  841|       |    /* If we haven't at least one buffer, someone has done a big booboo */
  842|  5.35k|    if (!ossl_assert(*sbuffer != NULL || buffer != NULL))
  ------------------
  |  |   52|  5.35k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 5.35k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  5.35k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (842:9): [True: 0, False: 5.35k]
  ------------------
  843|      0|        return 0;
  844|       |
  845|       |    /* |currlen| must always be <= |*maxlen| */
  846|  5.35k|    if (!ossl_assert(*currlen <= *maxlen))
  ------------------
  |  |   52|  5.35k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  5.35k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (846:9): [True: 0, False: 5.35k]
  ------------------
  847|      0|        return 0;
  848|       |
  849|  5.35k|    if (buffer && *currlen == *maxlen) {
  ------------------
  |  Branch (849:9): [True: 0, False: 5.35k]
  |  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.35k|    if (*currlen < *maxlen) {
  ------------------
  |  Branch (873:9): [True: 5.35k, False: 0]
  ------------------
  874|  5.35k|        if (*sbuffer)
  ------------------
  |  Branch (874:13): [True: 5.35k, False: 0]
  ------------------
  875|  5.35k|            (*sbuffer)[(*currlen)++] = (char)c;
  876|      0|        else
  877|      0|            (*buffer)[(*currlen)++] = (char)c;
  878|  5.35k|    }
  879|       |
  880|  5.35k|    return 1;
  881|  5.35k|}
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|      5|{
  385|      5|    int padlen;
  386|      5|    size_t strln;
  387|      5|    int cnt = 0;
  388|       |
  389|      5|    if (value == 0)
  ------------------
  |  Branch (389:9): [True: 0, False: 5]
  ------------------
  390|      0|        value = "<NULL>";
  391|       |
  392|      5|    strln = OPENSSL_strnlen(value, max < 0 ? SIZE_MAX : (size_t)max);
  ------------------
  |  Branch (392:36): [True: 0, False: 5]
  ------------------
  393|       |
  394|      5|    padlen = min - strln;
  395|      5|    if (min < 0 || padlen < 0)
  ------------------
  |  Branch (395:9): [True: 0, False: 5]
  |  Branch (395:20): [True: 5, False: 0]
  ------------------
  396|      5|        padlen = 0;
  397|      5|    if (max >= 0) {
  ------------------
  |  Branch (397:9): [True: 5, False: 0]
  ------------------
  398|       |        /*
  399|       |         * Calculate the maximum output including padding.
  400|       |         * Make sure max doesn't overflow into negativity
  401|       |         */
  402|      5|        if (max < INT_MAX - padlen)
  ------------------
  |  Branch (402:13): [True: 5, False: 0]
  ------------------
  403|      5|            max += padlen;
  404|      0|        else
  405|      0|            max = INT_MAX;
  406|      5|    }
  407|      5|    if (flags & DP_F_MINUS)
  ------------------
  |  |   56|      5|#define DP_F_MINUS      (1 << 0)
  ------------------
  |  Branch (407:9): [True: 0, False: 5]
  ------------------
  408|      0|        padlen = -padlen;
  409|       |
  410|      5|    while ((padlen > 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (410:12): [True: 0, False: 5]
  |  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|     59|    while (strln > 0 && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (416:12): [True: 54, False: 5]
  |  Branch (416:26): [True: 0, False: 54]
  |  Branch (416:37): [True: 54, False: 0]
  ------------------
  417|     54|        if (!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++))
  ------------------
  |  Branch (417:13): [True: 0, False: 54]
  ------------------
  418|      0|            return 0;
  419|     54|        --strln;
  420|     54|        ++cnt;
  421|     54|    }
  422|      5|    while ((padlen < 0) && (max < 0 || cnt < max)) {
  ------------------
  |  Branch (422:12): [True: 0, False: 5]
  |  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|      5|    return 1;
  429|      5|}

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

ossl_bio_core_globals_free:
   26|      1|{
   27|      1|    OPENSSL_free(vbcg);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   28|      1|}
ossl_bio_core_globals_new:
   31|      1|{
   32|      1|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   33|      1|}

BIO_new_file:
   58|      1|{
   59|      1|    BIO  *ret;
   60|      1|    FILE *file = openssl_fopen(filename, mode);
   61|      1|    int fp_flags = BIO_CLOSE;
  ------------------
  |  |   83|      1|# define BIO_CLOSE               0x01
  ------------------
   62|       |
   63|      1|    if (strchr(mode, 'b') == NULL)
  ------------------
  |  Branch (63:9): [True: 0, False: 1]
  ------------------
   64|      0|        fp_flags |= BIO_FP_TEXT;
  ------------------
  |  |  218|      0|# define BIO_FP_TEXT             0x10
  ------------------
   65|       |
   66|      1|    if (file == NULL) {
  ------------------
  |  Branch (66:9): [True: 1, False: 0]
  ------------------
   67|      1|        ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      1|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   72|      1|# define ERR_LIB_SYS             2
  ------------------
                      ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(),
  ------------------
  |  |   30|      1|# define get_last_sys_error()    errno
  ------------------
   68|      1|                       "calling fopen(%s, %s)",
   69|      1|                       filename, mode);
   70|      1|        if (errno == ENOENT
  ------------------
  |  Branch (70:13): [True: 1, False: 0]
  ------------------
   71|      1|#ifdef ENXIO
   72|      1|            || errno == ENXIO
  ------------------
  |  Branch (72:16): [True: 0, False: 0]
  ------------------
   73|      1|#endif
   74|      1|            )
   75|      1|            ERR_raise(ERR_LIB_BIO, BIO_R_NO_SUCH_FILE);
  ------------------
  |  |  401|      1|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      1|    (ERR_new(),                                                 \
  |  |  |  |  404|      1|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      1|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      1|     ERR_set_error)
  |  |  ------------------
  ------------------
   76|      0|        else
   77|      1|            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|      1|        return NULL;
   79|      1|    }
   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|      1|{
   51|      1|#ifndef OPENSSL_NO_ERR
   52|      1|    if (ERR_reason_error_string(BN_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (52:9): [True: 1, False: 0]
  ------------------
   53|      1|        ERR_load_strings_const(BN_str_reasons);
   54|      1|#endif
   55|      1|    return 1;
   56|      1|}

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

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

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

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

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

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

ossl_comp_brotli_cleanup:
  353|      1|{
  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|      1|}

COMP_zlib:
  311|      1|{
  312|      1|    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|      1|    return meth;
  320|      1|}
ossl_comp_zlib_cleanup:
  336|      1|{
  337|       |#ifdef ZLIB_SHARED
  338|       |    DSO_free(zlib_dso);
  339|       |    zlib_dso = NULL;
  340|       |#endif
  341|      1|}

ossl_comp_zstd_cleanup:
  428|      1|{
  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|      1|}

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

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

ossl_load_builtin_compressions:
   29|      1|{
   30|      1|    STACK_OF(SSL_COMP) *comp_methods = NULL;
  ------------------
  |  |   31|      1|# define STACK_OF(type) struct stack_st_##type
  ------------------
   31|      1|#ifndef OPENSSL_NO_COMP
   32|      1|    SSL_COMP *comp = NULL;
   33|      1|    COMP_METHOD *method = COMP_zlib();
   34|       |
   35|      1|    comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
  ------------------
  |  |   69|      1|#define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)))
  ------------------
   36|       |
   37|      1|    if (COMP_get_type(method) != NID_undef && comp_methods != NULL) {
  ------------------
  |  |   18|      2|#define NID_undef                       0
  ------------------
  |  Branch (37:9): [True: 0, False: 1]
  |  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|      1|#endif
   48|      1|    return comp_methods;
   49|      1|}
ossl_free_compression_methods_int:
   57|      1|{
   58|      1|    sk_SSL_COMP_pop_free(methods, cmeth_free);
  ------------------
  |  |   81|      1|#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|      1|}

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

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

NCONF_new_ex:
  183|      1|{
  184|      1|    CONF *ret;
  185|       |
  186|      1|    if (meth == NULL)
  ------------------
  |  Branch (186:9): [True: 1, False: 0]
  ------------------
  187|      1|        meth = NCONF_default();
  188|       |
  189|      1|    ret = meth->create(meth);
  190|      1|    if (ret == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 1]
  ------------------
  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|      1|    ret->libctx = libctx;
  195|       |
  196|      1|    return ret;
  197|      1|}
NCONF_free:
  205|      1|{
  206|      1|    if (conf == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 1]
  ------------------
  207|      0|        return;
  208|      1|    conf->meth->destroy(conf);
  209|      1|}
NCONF_load:
  252|      1|{
  253|      1|    if (conf == NULL) {
  ------------------
  |  Branch (253:9): [True: 0, False: 1]
  ------------------
  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|      1|    return conf->meth->load(conf, file, eline);
  259|      1|}

CONF_modules_load_file_ex:
  193|      1|{
  194|      1|    char *file = NULL;
  195|      1|    CONF *conf = NULL;
  196|      1|    int ret = 0, diagnostics = OSSL_LIB_CTX_get_conf_diagnostics(libctx);
  197|       |
  198|      1|    ERR_set_mark();
  199|       |
  200|      1|    if (filename == NULL) {
  ------------------
  |  Branch (200:9): [True: 1, False: 0]
  ------------------
  201|      1|        file = CONF_get1_default_config_file();
  202|      1|        if (file == NULL)
  ------------------
  |  Branch (202:13): [True: 0, False: 1]
  ------------------
  203|      0|            goto err;
  204|      1|        if (*file == '\0') {
  ------------------
  |  Branch (204:13): [True: 0, False: 1]
  ------------------
  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|      1|    } else {
  210|      0|        file = (char *)filename;
  211|      0|    }
  212|       |
  213|      1|    conf = NCONF_new_ex(libctx, NULL);
  214|      1|    if (conf == NULL)
  ------------------
  |  Branch (214:9): [True: 0, False: 1]
  ------------------
  215|      0|        goto err;
  216|       |
  217|      1|    if (NCONF_load(conf, file, NULL) <= 0) {
  ------------------
  |  Branch (217:9): [True: 1, False: 0]
  ------------------
  218|      1|        if ((flags & CONF_MFLAGS_IGNORE_MISSING_FILE) &&
  ------------------
  |  |  110|      1|# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  ------------------
  |  Branch (218:13): [True: 1, False: 0]
  ------------------
  219|      1|            (ERR_GET_REASON(ERR_peek_last_error()) == CONF_R_NO_SUCH_FILE)) {
  ------------------
  |  |   36|      1|# define CONF_R_NO_SUCH_FILE                              114
  ------------------
  |  Branch (219:13): [True: 1, False: 0]
  ------------------
  220|      1|            ret = 1;
  221|      1|        }
  222|      1|        goto err;
  223|      1|    }
  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|      1| err:
  230|      1|    if (filename == NULL)
  ------------------
  |  Branch (230:9): [True: 1, False: 0]
  ------------------
  231|      1|        OPENSSL_free(file);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  232|      1|    NCONF_free(conf);
  233|       |
  234|      1|    if ((flags & CONF_MFLAGS_IGNORE_RETURN_CODES) != 0 && !diagnostics)
  ------------------
  |  |  107|      1|# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  ------------------
  |  Branch (234:9): [True: 1, False: 0]
  |  Branch (234:59): [True: 1, False: 0]
  ------------------
  235|      1|        ret = 1;
  236|       |
  237|      1|    if (ret > 0)
  ------------------
  |  Branch (237:9): [True: 1, False: 0]
  ------------------
  238|      1|        ERR_pop_to_mark();
  239|      0|    else
  240|      0|        ERR_clear_last_mark();
  241|       |
  242|      1|    return ret;
  243|      0|}
CONF_modules_unload:
  517|      1|{
  518|      1|    int i;
  519|      1|    CONF_MODULE *md;
  520|      1|    STACK_OF(CONF_MODULE) *old_modules;
  ------------------
  |  |   31|      1|# define STACK_OF(type) struct stack_st_##type
  ------------------
  521|      1|    STACK_OF(CONF_MODULE) *new_modules;
  ------------------
  |  |   31|      1|# define STACK_OF(type) struct stack_st_##type
  ------------------
  522|      1|    STACK_OF(CONF_MODULE) *to_delete;
  ------------------
  |  |   31|      1|# define STACK_OF(type) struct stack_st_##type
  ------------------
  523|       |
  524|      1|    if (!conf_modules_finish_int()) /* also inits module list lock */
  ------------------
  |  Branch (524:9): [True: 0, False: 1]
  ------------------
  525|      0|        return;
  526|       |
  527|      1|    ossl_rcu_write_lock(module_list_lock);
  528|       |
  529|      1|    old_modules = ossl_rcu_deref(&supported_modules);
  ------------------
  |  |   30|      1|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  530|      1|    new_modules = sk_CONF_MODULE_dup(old_modules);
  531|       |
  532|      1|    if (new_modules == NULL) {
  ------------------
  |  Branch (532:9): [True: 0, False: 1]
  ------------------
  533|      0|        ossl_rcu_write_unlock(module_list_lock);
  534|      0|        return;
  535|      0|    }
  536|       |
  537|      1|    to_delete = sk_CONF_MODULE_new_null();
  538|       |
  539|       |    /* unload modules in reverse order */
  540|      1|    for (i = sk_CONF_MODULE_num(new_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (540:51): [True: 0, False: 1]
  ------------------
  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|      1|    if (sk_CONF_MODULE_num(new_modules) == 0) {
  ------------------
  |  Branch (550:9): [True: 1, False: 0]
  ------------------
  551|      1|        sk_CONF_MODULE_free(new_modules);
  552|      1|        new_modules = NULL;
  553|      1|    }
  554|       |
  555|      1|    ossl_rcu_assign_ptr(&supported_modules, &new_modules);
  ------------------
  |  |   31|      1|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  556|      1|    ossl_rcu_write_unlock(module_list_lock);
  557|      1|    ossl_synchronize_rcu(module_list_lock);
  558|      1|    sk_CONF_MODULE_free(old_modules);
  559|      1|    sk_CONF_MODULE_pop_free(to_delete, module_free);
  560|       |
  561|      1|}
ossl_config_modules_free:
  632|      1|{
  633|      1|    CONF_modules_unload(1); /* calls CONF_modules_finish */
  634|      1|    module_lists_free();
  635|      1|}
CONF_get1_default_config_file:
  686|      1|{
  687|      1|    const char *t;
  688|      1|    char *file, *sep = "";
  689|      1|    size_t size;
  690|       |
  691|      1|    if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL)
  ------------------
  |  Branch (691:9): [True: 0, False: 1]
  ------------------
  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|      1|    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|      1|    if (t == NULL)
  ------------------
  |  Branch (704:9): [True: 0, False: 1]
  ------------------
  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|      1|#ifndef OPENSSL_SYS_VMS
  708|      1|    sep = "/";
  709|      1|#endif
  710|      1|    size = strlen(t) + strlen(sep) + strlen(OPENSSL_CONF) + 1;
  ------------------
  |  |   81|      1|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  711|      1|    file = OPENSSL_malloc(size);
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  712|       |
  713|      1|    if (file == NULL)
  ------------------
  |  Branch (713:9): [True: 0, False: 1]
  ------------------
  714|      0|        return NULL;
  715|      1|    BIO_snprintf(file, size, "%s%s%s", t, sep, OPENSSL_CONF);
  ------------------
  |  |   81|      1|# define OPENSSL_CONF             "openssl.cnf"
  ------------------
  716|       |
  717|      1|    return file;
  718|      1|}
conf_mod.c:do_init_module_list_lock:
  101|      1|{
  102|      1|    module_list_lock = ossl_rcu_lock_new(1, NULL);
  103|      1|    if (module_list_lock == NULL) {
  ------------------
  |  Branch (103:9): [True: 0, False: 1]
  ------------------
  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|      1|    return 1;
  109|      1|}
conf_mod.c:conf_modules_finish_int:
  574|      1|{
  575|      1|    CONF_IMODULE *imod;
  576|      1|    STACK_OF(CONF_IMODULE) *old_modules;
  ------------------
  |  |   31|      1|# define STACK_OF(type) struct stack_st_##type
  ------------------
  577|      1|    STACK_OF(CONF_IMODULE) *new_modules = NULL;
  ------------------
  |  |   31|      1|# define STACK_OF(type) struct stack_st_##type
  ------------------
  578|       |
  579|      1|    if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (579:9): [True: 0, False: 1]
  ------------------
  580|      0|        return 0;
  581|       |
  582|       |    /* If module_list_lock is NULL here it means we were already unloaded */
  583|      1|    if (module_list_lock == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 1]
  ------------------
  584|      0|        return 0;
  585|       |
  586|      1|    ossl_rcu_write_lock(module_list_lock);
  587|      1|    old_modules = ossl_rcu_deref(&initialized_modules);
  ------------------
  |  |   30|      1|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  588|      1|    ossl_rcu_assign_ptr(&initialized_modules, &new_modules);
  ------------------
  |  |   31|      1|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  589|      1|    ossl_rcu_write_unlock(module_list_lock);
  590|      1|    ossl_synchronize_rcu(module_list_lock);
  591|       |
  592|      1|    while (sk_CONF_IMODULE_num(old_modules) > 0) {
  ------------------
  |  Branch (592:12): [True: 0, False: 1]
  ------------------
  593|      0|        imod = sk_CONF_IMODULE_pop(old_modules);
  594|      0|        module_finish(imod);
  595|      0|    }
  596|      1|    sk_CONF_IMODULE_free(old_modules);
  597|       |
  598|      1|    return 1;
  599|      1|}
conf_mod.c:module_lists_free:
   89|      1|{
   90|      1|    ossl_rcu_lock_free(module_list_lock);
   91|      1|    module_list_lock = NULL;
   92|       |
   93|      1|    sk_CONF_MODULE_free(supported_modules);
   94|      1|    supported_modules = NULL;
   95|       |
   96|      1|    sk_CONF_IMODULE_free(initialized_modules);
   97|      1|    initialized_modules = NULL;
   98|      1|}

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

ossl_lib_ctx_write_lock:
   60|      1|{
   61|      1|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 1]
  ------------------
   62|      0|        return 0;
   63|      1|    return CRYPTO_THREAD_write_lock(ctx->lock);
   64|      1|}
ossl_lib_ctx_read_lock:
   67|    270|{
   68|    270|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 270]
  ------------------
   69|      0|        return 0;
   70|    270|    return CRYPTO_THREAD_read_lock(ctx->lock);
   71|    270|}
ossl_lib_ctx_unlock:
   74|    271|{
   75|    271|    if ((ctx = ossl_lib_ctx_get_concrete(ctx)) == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 271]
  ------------------
   76|      0|        return 0;
   77|    271|    return CRYPTO_THREAD_unlock(ctx->lock);
   78|    271|}
ossl_lib_ctx_default_deinit:
  412|      1|{
  413|      1|    if (!default_context_inited)
  ------------------
  |  Branch (413:9): [True: 0, False: 1]
  ------------------
  414|      0|        return;
  415|      1|    context_deinit(&default_context_int);
  416|      1|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  417|      1|    default_context_inited = 0;
  418|      1|}
OSSL_LIB_CTX_get0_global_default:
  512|      1|{
  513|      1|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (513:9): [True: 0, False: 1]
  ------------------
  514|      0|        return NULL;
  515|       |
  516|      1|    return &default_context_int;
  517|      1|}
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|  11.9k|{
  544|  11.9k|#ifndef FIPS_MODULE
  545|  11.9k|    if (ctx == NULL)
  ------------------
  |  Branch (545:9): [True: 3.33k, False: 8.58k]
  ------------------
  546|  3.33k|        return get_default_context();
  547|  8.58k|#endif
  548|  8.58k|    return ctx;
  549|  11.9k|}
ossl_lib_ctx_is_default:
  552|     62|{
  553|     62|#ifndef FIPS_MODULE
  554|     62|    if (ctx == NULL || ctx == get_default_context())
  ------------------
  |  Branch (554:9): [True: 24, False: 38]
  |  Branch (554:24): [True: 38, False: 0]
  ------------------
  555|     62|        return 1;
  556|      0|#endif
  557|      0|    return 0;
  558|     62|}
ossl_lib_ctx_get_data:
  570|  10.0k|{
  571|  10.0k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  572|  10.0k|    if (ctx == NULL)
  ------------------
  |  Branch (572:9): [True: 0, False: 10.0k]
  ------------------
  573|      0|        return NULL;
  574|       |
  575|  10.0k|    switch (index) {
  576|     10|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |  101|     10|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (576:5): [True: 10, False: 10.0k]
  ------------------
  577|     10|        return ctx->property_string_data;
  578|  3.38k|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   98|  3.38k|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (578:5): [True: 3.38k, False: 6.71k]
  ------------------
  579|  3.38k|        return ctx->evp_method_store;
  580|     35|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   99|     35|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (580:5): [True: 35, False: 10.0k]
  ------------------
  581|     35|        return ctx->provider_store;
  582|  5.04k|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  102|  5.04k|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (582:5): [True: 5.04k, False: 5.05k]
  ------------------
  583|  5.04k|        return ctx->namemap;
  584|    271|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |  100|    271|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (584:5): [True: 271, False: 9.82k]
  ------------------
  585|    271|        return ctx->property_defns;
  586|     32|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  114|     32|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (586:5): [True: 32, False: 10.0k]
  ------------------
  587|     32|        return ctx->global_properties;
  588|  1.32k|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  103|  1.32k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (588:5): [True: 1.32k, False: 8.77k]
  ------------------
  589|  1.32k|        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: 10.0k]
  ------------------
  591|      0|        return ctx->drbg_nonce;
  592|      0|#ifndef FIPS_MODULE
  593|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  116|      0|# define OSSL_LIB_CTX_PROVIDER_CONF_INDEX           16
  ------------------
  |  Branch (593:5): [True: 0, False: 10.0k]
  ------------------
  594|      0|        return ctx->provider_conf;
  595|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  117|      0|# define OSSL_LIB_CTX_BIO_CORE_INDEX                17
  ------------------
  |  Branch (595:5): [True: 0, False: 10.0k]
  ------------------
  596|      0|        return ctx->bio_core;
  597|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  118|      0|# define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX          18
  ------------------
  |  Branch (597:5): [True: 0, False: 10.0k]
  ------------------
  598|      0|        return ctx->child_provider;
  599|      0|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  111|      0|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (599:5): [True: 0, False: 10.0k]
  ------------------
  600|      0|        return ctx->decoder_store;
  601|      1|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  120|      1|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (601:5): [True: 1, False: 10.0k]
  ------------------
  602|      1|        return ctx->decoder_cache;
  603|      0|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  110|      0|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (603:5): [True: 0, False: 10.0k]
  ------------------
  604|      0|        return ctx->encoder_store;
  605|      0|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  115|      0|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (605:5): [True: 0, False: 10.0k]
  ------------------
  606|      0|        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: 10.0k]
  ------------------
  608|      0|        return ctx->self_test_cb;
  609|      0|    case OSSL_LIB_CTX_INDICATOR_CB_INDEX:
  ------------------
  |  |  122|      0|# define OSSL_LIB_CTX_INDICATOR_CB_INDEX            22
  ------------------
  |  Branch (609:5): [True: 0, False: 10.0k]
  ------------------
  610|      0|        return ctx->indicator_cb;
  611|      0|#endif
  612|      0|#ifndef OPENSSL_NO_THREAD_POOL
  613|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  119|      0|# define OSSL_LIB_CTX_THREAD_INDEX                  19
  ------------------
  |  Branch (613:5): [True: 0, False: 10.0k]
  ------------------
  614|      0|        return ctx->threads;
  615|      0|#endif
  616|       |
  617|       |#ifdef FIPS_MODULE
  618|       |    case OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX:
  619|       |        return ctx->thread_event_handler;
  620|       |
  621|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  622|       |        return ctx->fips_prov;
  623|       |#endif
  624|       |
  625|      0|    case OSSL_LIB_CTX_COMP_METHODS:
  ------------------
  |  |  121|      0|# define OSSL_LIB_CTX_COMP_METHODS                  21
  ------------------
  |  Branch (625:5): [True: 0, False: 10.0k]
  ------------------
  626|      0|        return (void *)&ctx->comp_methods;
  627|       |
  628|      0|    default:
  ------------------
  |  Branch (628:5): [True: 0, False: 10.0k]
  ------------------
  629|      0|        return NULL;
  630|  10.0k|    }
  631|  10.0k|}
ossl_lib_ctx_get_ex_data_global:
  639|  1.28k|{
  640|  1.28k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  641|  1.28k|    if (ctx == NULL)
  ------------------
  |  Branch (641:9): [True: 0, False: 1.28k]
  ------------------
  642|      0|        return NULL;
  643|  1.28k|    return &ctx->global;
  644|  1.28k|}
OSSL_LIB_CTX_get_conf_diagnostics:
  668|      1|{
  669|      1|    libctx = ossl_lib_ctx_get_concrete(libctx);
  670|      1|    if (libctx == NULL)
  ------------------
  |  Branch (670:9): [True: 0, False: 1]
  ------------------
  671|      0|        return 0;
  672|      1|    return libctx->conf_diagnostics;
  673|      1|}
context.c:context_deinit:
  370|      1|{
  371|      1|    if (ctx == NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 1]
  ------------------
  372|      0|        return 1;
  373|       |
  374|      1|    ossl_ctx_thread_stop(ctx);
  375|       |
  376|      1|    context_deinit_objs(ctx);
  377|       |
  378|      1|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  379|       |
  380|      1|    CRYPTO_THREAD_lock_free(ctx->lock);
  381|      1|    ctx->lock = NULL;
  382|      1|    CRYPTO_THREAD_cleanup_local(&ctx->rcu_local_key);
  383|      1|    return 1;
  384|      1|}
context.c:context_deinit_objs:
  235|      1|{
  236|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  237|      1|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (237:9): [True: 1, False: 0]
  ------------------
  238|      1|        ossl_method_store_free(ctx->evp_method_store);
  239|      1|        ctx->evp_method_store = NULL;
  240|      1|    }
  241|       |
  242|       |    /* P2. */
  243|      1|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (243:9): [True: 0, False: 1]
  ------------------
  244|      0|        ossl_rand_ctx_free(ctx->drbg);
  245|      0|        ctx->drbg = NULL;
  246|      0|    }
  247|       |
  248|      1|#ifndef FIPS_MODULE
  249|       |    /* P2. */
  250|      1|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (250:9): [True: 1, False: 0]
  ------------------
  251|      1|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  252|      1|        ctx->provider_conf = NULL;
  253|      1|    }
  254|       |
  255|       |    /*
  256|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  257|       |     * provider store
  258|       |     */
  259|      1|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (259:9): [True: 1, False: 0]
  ------------------
  260|      1|        ossl_method_store_free(ctx->decoder_store);
  261|      1|        ctx->decoder_store = NULL;
  262|      1|    }
  263|      1|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (263:9): [True: 1, False: 0]
  ------------------
  264|      1|        ossl_decoder_cache_free(ctx->decoder_cache);
  265|      1|        ctx->decoder_cache = NULL;
  266|      1|    }
  267|       |
  268|       |
  269|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  270|      1|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (270:9): [True: 1, False: 0]
  ------------------
  271|      1|        ossl_method_store_free(ctx->encoder_store);
  272|      1|        ctx->encoder_store = NULL;
  273|      1|    }
  274|       |
  275|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  276|      1|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (276:9): [True: 1, False: 0]
  ------------------
  277|      1|        ossl_method_store_free(ctx->store_loader_store);
  278|      1|        ctx->store_loader_store = NULL;
  279|      1|    }
  280|      1|#endif
  281|       |
  282|       |    /* P1. Needs to be freed before the child provider data is freed */
  283|      1|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (283:9): [True: 1, False: 0]
  ------------------
  284|      1|        ossl_provider_store_free(ctx->provider_store);
  285|      1|        ctx->provider_store = NULL;
  286|      1|    }
  287|       |
  288|       |    /* Default priority. */
  289|      1|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (289:9): [True: 1, False: 0]
  ------------------
  290|      1|        ossl_property_string_data_free(ctx->property_string_data);
  291|      1|        ctx->property_string_data = NULL;
  292|      1|    }
  293|       |
  294|      1|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (294:9): [True: 1, False: 0]
  ------------------
  295|      1|        ossl_stored_namemap_free(ctx->namemap);
  296|      1|        ctx->namemap = NULL;
  297|      1|    }
  298|       |
  299|      1|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (299:9): [True: 1, False: 0]
  ------------------
  300|      1|        ossl_property_defns_free(ctx->property_defns);
  301|      1|        ctx->property_defns = NULL;
  302|      1|    }
  303|       |
  304|      1|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (304:9): [True: 1, False: 0]
  ------------------
  305|      1|        ossl_ctx_global_properties_free(ctx->global_properties);
  306|      1|        ctx->global_properties = NULL;
  307|      1|    }
  308|       |
  309|      1|#ifndef FIPS_MODULE
  310|      1|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (310:9): [True: 1, False: 0]
  ------------------
  311|      1|        ossl_bio_core_globals_free(ctx->bio_core);
  312|      1|        ctx->bio_core = NULL;
  313|      1|    }
  314|      1|#endif
  315|       |
  316|      1|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (316:9): [True: 1, False: 0]
  ------------------
  317|      1|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  318|      1|        ctx->drbg_nonce = NULL;
  319|      1|    }
  320|       |
  321|      1|#ifndef FIPS_MODULE
  322|      1|    if (ctx->indicator_cb != NULL) {
  ------------------
  |  Branch (322:9): [True: 1, False: 0]
  ------------------
  323|      1|        ossl_indicator_set_callback_free(ctx->indicator_cb);
  324|      1|        ctx->indicator_cb = NULL;
  325|      1|    }
  326|       |
  327|      1|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (327:9): [True: 1, False: 0]
  ------------------
  328|      1|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  329|      1|        ctx->self_test_cb = NULL;
  330|      1|    }
  331|      1|#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|      1|#ifndef OPENSSL_NO_THREAD_POOL
  346|      1|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (346:9): [True: 1, False: 0]
  ------------------
  347|      1|        ossl_threads_ctx_free(ctx->threads);
  348|      1|        ctx->threads = NULL;
  349|      1|    }
  350|      1|#endif
  351|       |
  352|       |    /* Low priority. */
  353|      1|#ifndef FIPS_MODULE
  354|      1|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (354:9): [True: 1, False: 0]
  ------------------
  355|      1|        ossl_child_prov_ctx_free(ctx->child_provider);
  356|      1|        ctx->child_provider = NULL;
  357|      1|    }
  358|      1|#endif
  359|       |
  360|      1|#ifndef FIPS_MODULE
  361|      1|    if (ctx->comp_methods != NULL) {
  ------------------
  |  Branch (361:9): [True: 1, False: 0]
  ------------------
  362|      1|        ossl_free_compression_methods_int(ctx->comp_methods);
  363|      1|        ctx->comp_methods = NULL;
  364|      1|    }
  365|      1|#endif
  366|       |
  367|      1|}
context.c:context_init:
   92|      1|{
   93|      1|    int exdata_done = 0;
   94|       |
   95|      1|    if (!CRYPTO_THREAD_init_local(&ctx->rcu_local_key, NULL))
  ------------------
  |  Branch (95:9): [True: 0, False: 1]
  ------------------
   96|      0|        return 0;
   97|       |
   98|      1|    ctx->lock = CRYPTO_THREAD_lock_new();
   99|      1|    if (ctx->lock == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 1]
  ------------------
  100|      0|        goto err;
  101|       |
  102|       |    /* Initialize ex_data. */
  103|      1|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (103:9): [True: 0, False: 1]
  ------------------
  104|      0|        goto err;
  105|      1|    exdata_done = 1;
  106|       |
  107|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  108|      1|    ctx->evp_method_store = ossl_method_store_new(ctx);
  109|      1|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (109:9): [True: 0, False: 1]
  ------------------
  110|      0|        goto err;
  111|      1|    OSSL_TRACE1(QUERY, "context_init: allocating store %p\n", ctx->evp_method_store);
  ------------------
  |  |  291|      1|    OSSL_TRACEV(category, (trc_out, format, arg1))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  112|       |
  113|      1|#ifndef FIPS_MODULE
  114|       |    /* P2. Must be freed before the provider store is freed */
  115|      1|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  116|      1|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (116:9): [True: 0, False: 1]
  ------------------
  117|      0|        goto err;
  118|      1|#endif
  119|       |
  120|       |    /* P2. */
  121|      1|    ctx->drbg = ossl_rand_ctx_new(ctx);
  122|      1|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (122:9): [True: 0, False: 1]
  ------------------
  123|      0|        goto err;
  124|       |
  125|      1|#ifndef FIPS_MODULE
  126|       |    /*
  127|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  128|       |     * provider store
  129|       |     */
  130|      1|    ctx->decoder_store = ossl_method_store_new(ctx);
  131|      1|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 1]
  ------------------
  132|      0|        goto err;
  133|      1|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  134|      1|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 1]
  ------------------
  135|      0|        goto err;
  136|       |
  137|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  138|      1|    ctx->encoder_store = ossl_method_store_new(ctx);
  139|      1|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 1]
  ------------------
  140|      0|        goto err;
  141|       |
  142|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  143|      1|    ctx->store_loader_store = ossl_method_store_new(ctx);
  144|      1|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 1]
  ------------------
  145|      0|        goto err;
  146|      1|#endif
  147|       |
  148|       |    /* P1. Needs to be freed before the child provider data is freed */
  149|      1|    ctx->provider_store = ossl_provider_store_new(ctx);
  150|      1|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (150:9): [True: 0, False: 1]
  ------------------
  151|      0|        goto err;
  152|       |
  153|       |    /* Default priority. */
  154|      1|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  155|      1|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (155:9): [True: 0, False: 1]
  ------------------
  156|      0|        goto err;
  157|       |
  158|      1|    ctx->namemap = ossl_stored_namemap_new(ctx);
  159|      1|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 1]
  ------------------
  160|      0|        goto err;
  161|       |
  162|      1|    ctx->property_defns = ossl_property_defns_new(ctx);
  163|      1|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (163:9): [True: 0, False: 1]
  ------------------
  164|      0|        goto err;
  165|       |
  166|      1|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  167|      1|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (167:9): [True: 0, False: 1]
  ------------------
  168|      0|        goto err;
  169|       |
  170|      1|#ifndef FIPS_MODULE
  171|      1|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  172|      1|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (172:9): [True: 0, False: 1]
  ------------------
  173|      0|        goto err;
  174|      1|#endif
  175|       |
  176|      1|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  177|      1|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 1]
  ------------------
  178|      0|        goto err;
  179|       |
  180|      1|#ifndef FIPS_MODULE
  181|      1|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  182|      1|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (182:9): [True: 0, False: 1]
  ------------------
  183|      0|        goto err;
  184|      1|    ctx->indicator_cb = ossl_indicator_set_callback_new(ctx);
  185|      1|    if (ctx->indicator_cb == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 1]
  ------------------
  186|      0|        goto err;
  187|      1|#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|      1|#ifndef OPENSSL_NO_THREAD_POOL
  200|      1|    ctx->threads = ossl_threads_ctx_new(ctx);
  201|      1|    if (ctx->threads == NULL)
  ------------------
  |  Branch (201:9): [True: 0, False: 1]
  ------------------
  202|      0|        goto err;
  203|      1|#endif
  204|       |
  205|       |    /* Low priority. */
  206|      1|#ifndef FIPS_MODULE
  207|      1|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  208|      1|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (208:9): [True: 0, False: 1]
  ------------------
  209|      0|        goto err;
  210|      1|#endif
  211|       |
  212|       |    /* Everything depends on properties, so we also pre-initialise that */
  213|      1|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (213:9): [True: 0, False: 1]
  ------------------
  214|      0|        goto err;
  215|       |
  216|      1|#ifndef FIPS_MODULE
  217|      1|    ctx->comp_methods = ossl_load_builtin_compressions();
  218|      1|#endif
  219|       |
  220|      1|    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|      1|}
context.c:default_context_do_init:
  395|      1|{
  396|      1|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (396:9): [True: 0, False: 1]
  ------------------
  397|      0|        goto err;
  398|       |
  399|      1|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (399:9): [True: 0, False: 1]
  ------------------
  400|      0|        goto deinit_thread;
  401|       |
  402|      1|    default_context_inited = 1;
  403|      1|    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.37k|{
  430|  3.37k|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  431|       |
  432|  3.37k|    if (current_defctx == NULL && default_context_inited)
  ------------------
  |  Branch (432:9): [True: 3.37k, False: 0]
  |  Branch (432:35): [True: 3.37k, False: 0]
  ------------------
  433|  3.37k|        current_defctx = &default_context_int;
  434|  3.37k|    return current_defctx;
  435|  3.37k|}
context.c:get_thread_default_context:
  421|  3.37k|{
  422|  3.37k|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  3.37k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3.37k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (422:9): [True: 0, False: 3.37k]
  ------------------
  423|      0|        return NULL;
  424|       |
  425|  3.37k|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  426|  3.37k|}

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

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

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

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

OPENSSL_cpuid_setup:
   96|      1|{
   97|      1|    static int trigger = 0;
   98|      1|    IA32CAP OPENSSL_ia32_cpuid(unsigned int *);
   99|      1|    IA32CAP vec;
  100|      1|    const variant_char *env;
  101|      1|    int index = 2;
  102|       |
  103|      1|    if (trigger)
  ------------------
  |  Branch (103:9): [True: 0, False: 1]
  ------------------
  104|      0|        return;
  105|       |
  106|      1|    trigger = 1;
  107|      1|    if ((env = ossl_getenv("OPENSSL_ia32cap")) != NULL) {
  ------------------
  |  |   47|      1|#   define ossl_getenv getenv
  ------------------
  |  Branch (107:9): [True: 0, False: 1]
  ------------------
  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|      1|    } else {
  162|      1|        vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
  163|      1|    }
  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|      1|    OPENSSL_ia32cap_P[0] = (unsigned int)vec | (1 << 10);
  171|      1|    OPENSSL_ia32cap_P[1] = (unsigned int)(vec >> 32);
  172|      1|}

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

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

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

ossl_DER_w_precompiled:
   54|    639|{
   55|    639|    return int_start_context(pkt, tag)
  ------------------
  |  Branch (55:12): [True: 639, False: 0]
  ------------------
   56|    639|        && WPACKET_memcpy(pkt, precompiled, precompiled_n)
  ------------------
  |  Branch (56:12): [True: 639, False: 0]
  ------------------
   57|    639|        && int_end_context(pkt, tag);
  ------------------
  |  Branch (57:12): [True: 639, False: 0]
  ------------------
   58|    639|}
ossl_DER_w_begin_sequence:
  172|    639|{
  173|    639|    return int_start_context(pkt, tag)
  ------------------
  |  Branch (173:12): [True: 639, False: 0]
  ------------------
  174|    639|        && WPACKET_start_sub_packet(pkt);
  ------------------
  |  Branch (174:12): [True: 639, False: 0]
  ------------------
  175|    639|}
ossl_DER_w_end_sequence:
  178|    639|{
  179|       |    /*
  180|       |     * If someone set the flag WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH on this
  181|       |     * sub-packet and this sub-packet has nothing written to it, the DER length
  182|       |     * will not be written, and the total written size will be unchanged before
  183|       |     * and after WPACKET_close().  We use size1 and size2 to determine if
  184|       |     * anything was written, and only write our tag if it has.
  185|       |     *
  186|       |     * Because we know that int_end_context() needs to do the same check,
  187|       |     * we reproduce this flag if the written length was unchanged, or we will
  188|       |     * have an erroneous context tag.
  189|       |     */
  190|    639|    size_t size1, size2;
  191|       |
  192|    639|    return WPACKET_get_total_written(pkt, &size1)
  ------------------
  |  Branch (192:12): [True: 639, False: 0]
  ------------------
  193|    639|        && WPACKET_close(pkt)
  ------------------
  |  Branch (193:12): [True: 639, False: 0]
  ------------------
  194|    639|        && WPACKET_get_total_written(pkt, &size2)
  ------------------
  |  Branch (194:12): [True: 639, False: 0]
  ------------------
  195|    639|        && (size1 == size2
  ------------------
  |  Branch (195:12): [True: 639, False: 0]
  |  Branch (195:13): [True: 0, False: 639]
  ------------------
  196|    639|            ? WPACKET_set_flags(pkt, WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH)
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  197|    639|            : WPACKET_put_bytes_u8(pkt, DER_F_CONSTRUCTED | DER_P_SEQUENCE))
  ------------------
  |  |  878|    639|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  198|    639|        && int_end_context(pkt, tag);
  ------------------
  |  Branch (198:12): [True: 639, False: 0]
  ------------------
  199|    639|}
der_writer.c:int_start_context:
   17|  1.27k|{
   18|  1.27k|    if (tag < 0)
  ------------------
  |  Branch (18:9): [True: 1.27k, False: 0]
  ------------------
   19|  1.27k|        return 1;
   20|      0|    if (!ossl_assert(tag <= 30))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (20:9): [True: 0, False: 0]
  ------------------
   21|      0|        return 0;
   22|      0|    return WPACKET_start_sub_packet(pkt);
   23|      0|}
der_writer.c:int_end_context:
   26|  1.27k|{
   27|       |    /*
   28|       |     * If someone set the flag WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH on this
   29|       |     * sub-packet and this sub-packet has nothing written to it, the DER length
   30|       |     * will not be written, and the total written size will be unchanged before
   31|       |     * and after WPACKET_close().  We use size1 and size2 to determine if
   32|       |     * anything was written, and only write our tag if it has.
   33|       |     *
   34|       |     */
   35|  1.27k|    size_t size1, size2;
   36|       |
   37|  1.27k|    if (tag < 0)
  ------------------
  |  Branch (37:9): [True: 1.27k, False: 0]
  ------------------
   38|  1.27k|        return 1;
   39|      0|    if (!ossl_assert(tag <= 30))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (39:9): [True: 0, False: 0]
  ------------------
   40|      0|        return 0;
   41|       |
   42|       |    /* Context specific are normally (?) constructed */
   43|      0|    tag |= DER_F_CONSTRUCTED | DER_C_CONTEXT;
  ------------------
  |  |   58|      0|# define DER_F_CONSTRUCTED            0x20
  ------------------
                  tag |= DER_F_CONSTRUCTED | DER_C_CONTEXT;
  ------------------
  |  |   63|      0|# define DER_C_CONTEXT                0x80
  ------------------
   44|       |
   45|      0|    return WPACKET_get_total_written(pkt, &size1)
  ------------------
  |  Branch (45:12): [True: 0, False: 0]
  ------------------
   46|      0|        && WPACKET_close(pkt)
  ------------------
  |  Branch (46:12): [True: 0, False: 0]
  ------------------
   47|      0|        && WPACKET_get_total_written(pkt, &size2)
  ------------------
  |  Branch (47:12): [True: 0, False: 0]
  ------------------
   48|      0|        && (size1 == size2 || WPACKET_put_bytes_u8(pkt, tag));
  ------------------
  |  |  878|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  |  |  ------------------
  |  |  |  Branch (878:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (48:13): [True: 0, False: 0]
  ------------------
   49|      0|}

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

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

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

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

ossl_decoder_cache_new:
  703|      1|{
  704|      1|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  705|       |
  706|      1|    if (cache == NULL)
  ------------------
  |  Branch (706:9): [True: 0, False: 1]
  ------------------
  707|      0|        return NULL;
  708|       |
  709|      1|    cache->lock = CRYPTO_THREAD_lock_new();
  710|      1|    if (cache->lock == NULL) {
  ------------------
  |  Branch (710:9): [True: 0, False: 1]
  ------------------
  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|      1|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  715|      1|                                                  decoder_cache_entry_cmp);
  716|      1|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (716:9): [True: 0, False: 1]
  ------------------
  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|      1|    return cache;
  723|      1|}
ossl_decoder_cache_free:
  726|      1|{
  727|      1|    DECODER_CACHE *cache = (DECODER_CACHE *)vcache;
  728|       |
  729|      1|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  730|      1|    lh_DECODER_CACHE_ENTRY_free(cache->hashtable);
  731|      1|    CRYPTO_THREAD_lock_free(cache->lock);
  732|      1|    OPENSSL_free(cache);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  733|      1|}
ossl_decoder_cache_flush:
  740|      1|{
  741|      1|    DECODER_CACHE *cache
  742|      1|        = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DECODER_CACHE_INDEX);
  ------------------
  |  |  120|      1|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  743|       |
  744|      1|    if (cache == NULL)
  ------------------
  |  Branch (744:9): [True: 1, False: 0]
  ------------------
  745|      1|        return 0;
  746|       |
  747|       |
  748|      0|    if (!CRYPTO_THREAD_write_lock(cache->lock)) {
  ------------------
  |  Branch (748:9): [True: 0, False: 0]
  ------------------
  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|      0|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  754|      0|    lh_DECODER_CACHE_ENTRY_flush(cache->hashtable);
  755|       |
  756|      0|    CRYPTO_THREAD_unlock(cache->lock);
  757|      0|    return 1;
  758|      0|}

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

ENGINE_finish:
  107|   403M|{
  108|   403M|    int to_return = 1;
  109|       |
  110|   403M|    if (e == NULL)
  ------------------
  |  Branch (110:9): [True: 403M, False: 0]
  ------------------
  111|   403M|        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|      1|{
  177|      1|    if (int_cleanup_check(0)) {
  ------------------
  |  Branch (177:9): [True: 0, False: 1]
  ------------------
  178|      0|        sk_ENGINE_CLEANUP_ITEM_pop_free(cleanup_stack,
  179|      0|                                        engine_cleanup_cb_free);
  180|      0|        cleanup_stack = NULL;
  181|      0|    }
  182|      1|    CRYPTO_THREAD_lock_free(global_engine_lock);
  183|      1|    global_engine_lock = NULL;
  184|      1|}
eng_lib.c:do_engine_lock_init:
   22|      1|{
   23|      1|    global_engine_lock = CRYPTO_THREAD_lock_new();
   24|      1|    return global_engine_lock != NULL;
   25|      1|}
eng_lib.c:int_cleanup_check:
  119|      1|{
  120|      1|    if (cleanup_stack)
  ------------------
  |  Branch (120:9): [True: 0, False: 1]
  ------------------
  121|      0|        return 1;
  122|      1|    if (!create)
  ------------------
  |  Branch (122:9): [True: 1, False: 0]
  ------------------
  123|      1|        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|      1|}

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

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

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

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

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|      1|{
  203|      1|    int i;
  204|       |
  205|      1|    if (state == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 1]
  ------------------
  206|      0|        return;
  207|     17|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|     17|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (207:17): [True: 16, False: 1]
  ------------------
  208|     16|        err_clear(state, i, 1);
  209|     16|    }
  210|      1|    CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  ------------------
  211|      1|}
err_cleanup:
  233|      1|{
  234|      1|    if (set_err_thread_local != 0)
  ------------------
  |  Branch (234:9): [True: 1, False: 0]
  ------------------
  235|      1|        CRYPTO_THREAD_cleanup_local(&err_thread_local);
  236|      1|    CRYPTO_THREAD_lock_free(err_string_lock);
  237|      1|    err_string_lock = NULL;
  238|      1|#ifndef OPENSSL_NO_ERR
  239|      1|    lh_ERR_STRING_DATA_free(int_error_hash);
  ------------------
  |  |  376|      1|#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
  ------------------
  240|      1|    int_error_hash = NULL;
  241|      1|#endif
  242|      1|}
ossl_err_load_ERR_strings:
  272|     35|{
  273|     35|#ifndef OPENSSL_NO_ERR
  274|     35|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     35|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 35, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 35]
  ------------------
  275|      0|        return 0;
  276|       |
  277|     35|    err_load_strings(ERR_str_libraries);
  278|     35|    err_load_strings(ERR_str_reasons);
  279|     35|#endif
  280|     35|    return 1;
  281|     35|}
ERR_load_strings_const:
  297|     34|{
  298|     34|#ifndef OPENSSL_NO_ERR
  299|     34|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 34]
  ------------------
  300|      0|        return 0;
  301|     34|    err_load_strings(str);
  302|     34|#endif
  303|       |
  304|     34|    return 1;
  305|     34|}
ERR_peek_last_error:
  410|      2|{
  411|      2|    return get_error_values(EV_PEEK_LAST, NULL, NULL, NULL, NULL, NULL);
  412|      2|}
ERR_reason_error_string:
  613|     34|{
  614|     34|#ifndef OPENSSL_NO_ERR
  615|     34|    ERR_STRING_DATA d, *p = NULL;
  616|     34|    unsigned long l, r;
  617|       |
  618|     34|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     34|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 34, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 34]
  ------------------
  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|     34|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|     34|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     34|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 34]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|     34|    l = ERR_GET_LIB(e);
  631|     34|    r = ERR_GET_REASON(e);
  632|     34|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|     34|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     34|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     34|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     34|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     34|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|     34|    p = int_err_get_item(&d);
  634|     34|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 34, False: 0]
  ------------------
  635|     34|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|     34|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     34|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     34|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     34|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     34|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|     34|        p = int_err_get_item(&d);
  637|     34|    }
  638|     34|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 34, False: 0]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|     34|}
ossl_err_get_state_int:
  673|  9.91k|{
  674|  9.91k|    ERR_STATE *state;
  675|  9.91k|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  9.91k|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  9.91k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  9.91k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 9.91k]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  9.91k|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  9.91k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 9.91k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 9.91k]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  9.91k|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  9.91k|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 9.91k]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  9.91k|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 1, False: 9.91k]
  ------------------
  688|      1|        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (688:13): [True: 0, False: 1]
  ------------------
  689|      0|            return NULL;
  690|       |
  691|      1|        state = OSSL_ERR_STATE_new();
  692|      1|        if (state == NULL) {
  ------------------
  |  Branch (692:13): [True: 0, False: 1]
  ------------------
  693|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  694|      0|            return NULL;
  695|      0|        }
  696|       |
  697|      1|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (697:13): [True: 0, False: 1]
  ------------------
  698|      1|                || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
  ------------------
  |  Branch (698:20): [True: 0, False: 1]
  ------------------
  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|      1|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  467|      1|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      1|    }
  707|       |
  708|  9.91k|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  9.91k|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  9.91k|    return state;
  710|  9.91k|}
err_shelve_state:
  725|      1|{
  726|      1|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|      1|# 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|      1|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      1|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (740:9): [True: 0, False: 1]
  ------------------
  741|      0|        return 0;
  742|       |
  743|      1|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (743:9): [True: 0, False: 1]
  ------------------
  744|      0|        return 0;
  745|       |
  746|      1|    *state = CRYPTO_THREAD_get_local(&err_thread_local);
  747|      1|    if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (747:9): [True: 0, False: 1]
  ------------------
  748|      0|        return 0;
  749|       |
  750|      1|    set_sys_error(saveerrno);
  ------------------
  |  |   32|      1|# define set_sys_error(e)        errno=(e)
  ------------------
  751|      1|    return 1;
  752|      1|}
err_unshelve_state:
  759|      1|{
  760|      1|    if (state != (void*)-1)
  ------------------
  |  Branch (760:9): [True: 1, False: 0]
  ------------------
  761|      1|        CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)state);
  762|      1|}
ERR_get_next_error_library:
  765|      1|{
  766|      1|    int ret;
  767|       |
  768|      1|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (768:9): [True: 0, False: 1]
  ------------------
  769|      0|        return 0;
  770|       |
  771|      1|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (771:9): [True: 0, False: 1]
  ------------------
  772|      0|        return 0;
  773|      1|    ret = int_err_library_number++;
  774|      1|    CRYPTO_THREAD_unlock(err_string_lock);
  775|      1|    return ret;
  776|      1|}
err.c:do_err_strings_init:
  214|      1|{
  215|      1|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      1|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (215:9): [True: 0, False: 1]
  ------------------
  216|      0|        return 0;
  217|      1|    err_string_lock = CRYPTO_THREAD_lock_new();
  218|      1|    if (err_string_lock == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 1]
  ------------------
  219|      0|        return 0;
  220|      1|#ifndef OPENSSL_NO_ERR
  221|      1|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  375|      1|#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|      1|                                            err_string_data_cmp);
  223|      1|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 1]
  ------------------
  224|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  225|      0|        err_string_lock = NULL;
  226|      0|        return 0;
  227|      0|    }
  228|      1|#endif
  229|      1|    return 1;
  230|      1|}
err.c:err_string_data_hash:
  172|  4.37k|{
  173|  4.37k|    unsigned long ret, l;
  174|       |
  175|  4.37k|    l = a->error;
  176|  4.37k|    ret = l ^ ERR_GET_LIB(l);
  177|  4.37k|    return (ret ^ ret % 19 * 13);
  178|  4.37k|}
err.c:err_string_data_cmp:
  182|  2.94k|{
  183|  2.94k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 2.78k, False: 158]
  ------------------
  184|  2.78k|        return 0;
  185|    158|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 84, False: 74]
  ------------------
  186|  2.94k|}
err.c:err_load_strings:
  260|    104|{
  261|    104|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (261:9): [True: 0, False: 104]
  ------------------
  262|      0|        return 0;
  263|  4.41k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 4.31k, False: 104]
  ------------------
  264|  4.31k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  4.41k|#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|    104|                                       (ERR_STRING_DATA *)str);
  266|    104|    CRYPTO_THREAD_unlock(err_string_lock);
  267|    104|    return 1;
  268|    104|}
err.c:get_error_values:
  448|      2|{
  449|      2|    int i = 0;
  450|      2|    ERR_STATE *es;
  451|      2|    unsigned long ret;
  452|       |
  453|      2|    es = ossl_err_get_state_int();
  454|      2|    if (es == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 2]
  ------------------
  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|      2|    while (es->bottom != es->top) {
  ------------------
  |  Branch (461:12): [True: 2, False: 0]
  ------------------
  462|      2|        if (es->err_flags[es->top] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|      2|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (462:13): [True: 0, False: 2]
  ------------------
  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|      2|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      2|#  define ERR_NUM_ERRORS  16
  ------------------
  468|      2|        if (es->err_flags[i] & ERR_FLAG_CLEAR) {
  ------------------
  |  |   53|      2|#  define ERR_FLAG_CLEAR          0x02
  ------------------
  |  Branch (468:13): [True: 0, False: 2]
  ------------------
  469|      0|            es->bottom = i;
  470|      0|            err_clear(es, es->bottom, 0);
  471|      0|            continue;
  472|      0|        }
  473|      2|        break;
  474|      2|    }
  475|       |
  476|       |    /* If everything has been cleared, the stack is empty. */
  477|      2|    if (es->bottom == es->top)
  ------------------
  |  Branch (477:9): [True: 0, False: 2]
  ------------------
  478|      0|        return 0;
  479|       |
  480|       |    /* Which error, the top of stack (latest one) or the first one? */
  481|      2|    if (g == EV_PEEK_LAST)
  ------------------
  |  Branch (481:9): [True: 2, False: 0]
  ------------------
  482|      2|        i = es->top;
  483|      0|    else
  484|      0|        i = (es->bottom + 1) % ERR_NUM_ERRORS;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  485|       |
  486|      2|    ret = es->err_buffer[i];
  487|      2|    if (g == EV_POP) {
  ------------------
  |  Branch (487:9): [True: 0, False: 2]
  ------------------
  488|      0|        es->bottom = i;
  489|      0|        es->err_buffer[i] = 0;
  490|      0|    }
  491|       |
  492|      2|    if (file != NULL) {
  ------------------
  |  Branch (492:9): [True: 0, False: 2]
  ------------------
  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|      2|    if (line != NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 2]
  ------------------
  498|      0|        *line = es->err_line[i];
  499|      2|    if (func != NULL) {
  ------------------
  |  Branch (499:9): [True: 0, False: 2]
  ------------------
  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|      2|    if (flags != NULL)
  ------------------
  |  Branch (504:9): [True: 0, False: 2]
  ------------------
  505|      0|        *flags = es->err_data_flags[i];
  506|      2|    if (data == NULL) {
  ------------------
  |  Branch (506:9): [True: 2, False: 0]
  ------------------
  507|      2|        if (g == EV_POP) {
  ------------------
  |  Branch (507:13): [True: 0, False: 2]
  ------------------
  508|      0|            err_clear_data(es, i, 0);
  509|      0|        }
  510|      2|    } 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|      2|    return ret;
  519|      2|}
err.c:int_err_get_item:
  189|     68|{
  190|     68|    ERR_STRING_DATA *p = NULL;
  191|       |
  192|     68|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 68]
  ------------------
  193|      0|        return NULL;
  194|     68|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|     68|#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|     68|    CRYPTO_THREAD_unlock(err_string_lock);
  196|       |
  197|     68|    return p;
  198|     68|}
err.c:err_do_init:
  667|      1|{
  668|      1|    set_err_thread_local = 1;
  669|      1|    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
  670|      1|}
err.c:err_delete_thread_state:
  645|      1|{
  646|      1|    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
  647|      1|    if (state == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 1]
  ------------------
  648|      0|        return;
  649|       |
  650|      1|    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  651|      1|    OSSL_ERR_STATE_free(state);
  652|      1|}

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

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

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

ERR_set_mark:
   16|  2.06k|{
   17|  2.06k|    ERR_STATE *es;
   18|       |
   19|  2.06k|    es = ossl_err_get_state_int();
   20|  2.06k|    if (es == NULL)
  ------------------
  |  Branch (20:9): [True: 0, False: 2.06k]
  ------------------
   21|      0|        return 0;
   22|       |
   23|  2.06k|    if (es->bottom == es->top)
  ------------------
  |  Branch (23:9): [True: 31, False: 2.03k]
  ------------------
   24|     31|        return 0;
   25|  2.03k|    es->err_marks[es->top]++;
   26|  2.03k|    return 1;
   27|  2.06k|}
ERR_pop_to_mark:
   43|  2.06k|{
   44|  2.06k|    ERR_STATE *es;
   45|       |
   46|  2.06k|    es = ossl_err_get_state_int();
   47|  2.06k|    if (es == NULL)
  ------------------
  |  Branch (47:9): [True: 0, False: 2.06k]
  ------------------
   48|      0|        return 0;
   49|       |
   50|  3.92k|    while (es->bottom != es->top
  ------------------
  |  Branch (50:12): [True: 3.90k, False: 25]
  ------------------
   51|  3.92k|           && es->err_marks[es->top] == 0) {
  ------------------
  |  Branch (51:15): [True: 1.86k, False: 2.03k]
  ------------------
   52|  1.86k|        err_clear(es, es->top, 0);
   53|  1.86k|        es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|     24|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (53:19): [True: 1.83k, False: 24]
  ------------------
   54|  1.86k|    }
   55|       |
   56|  2.06k|    if (es->bottom == es->top)
  ------------------
  |  Branch (56:9): [True: 25, False: 2.03k]
  ------------------
   57|     25|        return 0;
   58|  2.03k|    es->err_marks[es->top]--;
   59|  2.03k|    return 1;
   60|  2.06k|}
ERR_clear_last_mark:
   82|      6|{
   83|      6|    ERR_STATE *es;
   84|      6|    int top;
   85|       |
   86|      6|    es = ossl_err_get_state_int();
   87|      6|    if (es == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 6]
  ------------------
   88|      0|        return 0;
   89|       |
   90|      6|    top = es->top;
   91|      6|    while (es->bottom != top
  ------------------
  |  Branch (91:12): [True: 0, False: 6]
  ------------------
   92|      6|           && es->err_marks[top] == 0) {
  ------------------
  |  Branch (92:15): [True: 0, False: 0]
  ------------------
   93|      0|        top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
  ------------------
  |  |   55|      0|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (93:15): [True: 0, False: 0]
  ------------------
   94|      0|    }
   95|       |
   96|      6|    if (es->bottom == top)
  ------------------
  |  Branch (96:9): [True: 6, False: 0]
  ------------------
   97|      6|        return 0;
   98|      0|    es->err_marks[top]--;
   99|      0|    return 1;
  100|      6|}

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

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

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

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

evp_md_ctx_clear_digest:
   45|  6.60k|{
   46|  6.60k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (46:9): [True: 2.57k, False: 4.02k]
  ------------------
   47|  2.57k|        if (ctx->digest != NULL && ctx->digest->freectx != NULL)
  ------------------
  |  Branch (47:13): [True: 2.57k, False: 0]
  |  Branch (47:36): [True: 2.57k, False: 0]
  ------------------
   48|  2.57k|            ctx->digest->freectx(ctx->algctx);
   49|  2.57k|        ctx->algctx = NULL;
   50|  2.57k|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  222|  2.57k|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
   51|  2.57k|    }
   52|       |
   53|       |    /* Code below to be removed when legacy support is dropped. */
   54|       |
   55|       |    /*
   56|       |     * Don't assume ctx->md_data was cleaned in EVP_Digest_Final, because
   57|       |     * sometimes only copies of the context are ever finalised.
   58|       |     */
   59|  6.60k|    cleanup_old_md_data(ctx, force);
   60|  6.60k|    if (force)
  ------------------
  |  Branch (60:9): [True: 0, False: 6.60k]
  ------------------
   61|      0|        ctx->digest = NULL;
   62|       |
   63|  6.60k|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   64|  6.60k|    ENGINE_finish(ctx->engine);
   65|  6.60k|    ctx->engine = NULL;
   66|  6.60k|#endif
   67|       |
   68|       |    /* Non legacy code, this has to be later than the ctx->digest cleaning */
   69|  6.60k|    if (!keep_fetched) {
  ------------------
  |  Branch (69:9): [True: 6.40k, False: 201]
  ------------------
   70|  6.40k|        EVP_MD_free(ctx->fetched_digest);
   71|  6.40k|        ctx->fetched_digest = NULL;
   72|  6.40k|        ctx->reqdigest = NULL;
   73|  6.40k|    }
   74|  6.60k|}
EVP_MD_CTX_reset:
   99|  8.61k|{
  100|  8.61k|    return evp_md_ctx_reset_ex(ctx, 0);
  101|  8.61k|}
EVP_MD_CTX_new:
  130|  4.19k|{
  131|  4.19k|    return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
  ------------------
  |  |  104|  4.19k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.19k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.19k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  132|  4.19k|}
EVP_MD_CTX_free:
  135|  4.58k|{
  136|  4.58k|    if (ctx == NULL)
  ------------------
  |  Branch (136:9): [True: 390, False: 4.19k]
  ------------------
  137|    390|        return;
  138|       |
  139|  4.19k|    EVP_MD_CTX_reset(ctx);
  140|  4.19k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  4.19k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  4.19k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  4.19k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  141|  4.19k|}
evp_md_ctx_free_algctx:
  144|  2.37k|{
  145|  2.37k|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (145:9): [True: 0, False: 2.37k]
  ------------------
  146|      0|        if (!ossl_assert(ctx->digest != NULL)) {
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (146:13): [True: 0, False: 0]
  ------------------
  147|      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)
  |  |  ------------------
  ------------------
  148|      0|            return 0;
  149|      0|        }
  150|      0|        if (ctx->digest->freectx != NULL)
  ------------------
  |  Branch (150:13): [True: 0, False: 0]
  ------------------
  151|      0|            ctx->digest->freectx(ctx->algctx);
  152|      0|        ctx->algctx = NULL;
  153|      0|    }
  154|  2.37k|    return 1;
  155|  2.37k|}
EVP_DigestInit_ex2:
  370|   403M|{
  371|   403M|    return evp_md_init_internal(ctx, type, params, NULL);
  372|   403M|}
EVP_DigestInit_ex:
  381|    938|{
  382|    938|    return evp_md_init_internal(ctx, type, NULL, impl);
  383|    938|}
EVP_DigestUpdate:
  386|  1.46G|{
  387|  1.46G|    if (count == 0)
  ------------------
  |  Branch (387:9): [True: 0, False: 1.46G]
  ------------------
  388|      0|        return 1;
  389|       |
  390|  1.46G|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|  1.46G|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (390:9): [True: 0, False: 1.46G]
  ------------------
  391|      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)
  |  |  ------------------
  ------------------
  392|      0|        return 0;
  393|      0|    }
  394|       |
  395|  1.46G|    if (ctx->pctx != NULL
  ------------------
  |  Branch (395:9): [True: 0, False: 1.46G]
  ------------------
  396|  1.46G|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  741|  1.46G|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|      0|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|      0|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|      0|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|      0|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  397|  1.46G|            && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (397:16): [True: 0, False: 0]
  ------------------
  398|      0|#ifndef FIPS_MODULE
  399|       |        /*
  400|       |         * Prior to OpenSSL 3.0 EVP_DigestSignUpdate() and
  401|       |         * EVP_DigestVerifyUpdate() were just macros for EVP_DigestUpdate().
  402|       |         * Some code calls EVP_DigestUpdate() directly even when initialised
  403|       |         * with EVP_DigestSignInit_ex() or
  404|       |         * EVP_DigestVerifyInit_ex(), so we detect that and redirect to
  405|       |         * the correct EVP_Digest*Update() function
  406|       |         */
  407|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  |  Branch (407:13): [True: 0, False: 0]
  ------------------
  408|      0|            return EVP_DigestSignUpdate(ctx, data, count);
  409|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
  ------------------
  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (409:13): [True: 0, False: 0]
  ------------------
  410|      0|            return EVP_DigestVerifyUpdate(ctx, data, count);
  411|      0|#endif
  412|      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)
  |  |  ------------------
  ------------------
  413|      0|        return 0;
  414|      0|    }
  415|       |
  416|  1.46G|    if (ctx->digest == NULL
  ------------------
  |  Branch (416:9): [True: 0, False: 1.46G]
  ------------------
  417|  1.46G|            || ctx->digest->prov == NULL
  ------------------
  |  Branch (417:16): [True: 0, False: 1.46G]
  ------------------
  418|  1.46G|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0)
  ------------------
  |  |  244|  1.46G|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (418:16): [True: 0, False: 1.46G]
  ------------------
  419|      0|        goto legacy;
  420|       |
  421|  1.46G|    if (ctx->digest->dupdate == NULL) {
  ------------------
  |  Branch (421:9): [True: 0, False: 1.46G]
  ------------------
  422|      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)
  |  |  ------------------
  ------------------
  423|      0|        return 0;
  424|      0|    }
  425|  1.46G|    return ctx->digest->dupdate(ctx->algctx, data, count);
  426|       |
  427|       |    /* Code below to be removed when legacy support is dropped. */
  428|      0| legacy:
  429|      0|    return ctx->update != NULL ? ctx->update(ctx, data, count) : 0;
  ------------------
  |  Branch (429:12): [True: 0, False: 0]
  ------------------
  430|  1.46G|}
EVP_DigestFinal_ex:
  443|   242M|{
  444|   242M|    int ret, sz;
  445|   242M|    size_t size = 0;
  446|   242M|    size_t mdsize = 0;
  447|       |
  448|   242M|    if (ctx->digest == NULL)
  ------------------
  |  Branch (448:9): [True: 0, False: 242M]
  ------------------
  449|      0|        return 0;
  450|       |
  451|   242M|    sz = EVP_MD_CTX_get_size(ctx);
  ------------------
  |  |  594|   242M|# define EVP_MD_CTX_get_size(e)        EVP_MD_CTX_get_size_ex(e)
  ------------------
  452|   242M|    if (sz < 0)
  ------------------
  |  Branch (452:9): [True: 0, False: 242M]
  ------------------
  453|      0|        return 0;
  454|   242M|    mdsize = sz;
  455|   242M|    if (ctx->digest->prov == NULL)
  ------------------
  |  Branch (455:9): [True: 0, False: 242M]
  ------------------
  456|      0|        goto legacy;
  457|       |
  458|   242M|    if (ctx->digest->dfinal == NULL) {
  ------------------
  |  Branch (458:9): [True: 0, False: 242M]
  ------------------
  459|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_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)
  |  |  ------------------
  ------------------
  460|      0|        return 0;
  461|      0|    }
  462|       |
  463|   242M|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|   242M|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (463:9): [True: 0, False: 242M]
  ------------------
  464|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_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)
  |  |  ------------------
  ------------------
  465|      0|        return 0;
  466|      0|    }
  467|       |
  468|   242M|    ret = ctx->digest->dfinal(ctx->algctx, md, &size, mdsize);
  469|       |
  470|   242M|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|   242M|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  471|       |
  472|   242M|    if (isize != NULL) {
  ------------------
  |  Branch (472:9): [True: 402, False: 242M]
  ------------------
  473|    402|        if (size <= UINT_MAX) {
  ------------------
  |  Branch (473:13): [True: 402, False: 0]
  ------------------
  474|    402|            *isize = (unsigned int)size;
  475|    402|        } else {
  476|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_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)
  |  |  ------------------
  ------------------
  477|      0|            ret = 0;
  478|      0|        }
  479|    402|    }
  480|       |
  481|   242M|    return ret;
  482|       |
  483|       |    /* Code below to be removed when legacy support is dropped. */
  484|      0| legacy:
  485|      0|    OPENSSL_assert(mdsize <= EVP_MAX_MD_SIZE);
  ------------------
  |  |  438|      0|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  486|      0|    ret = ctx->digest->final(ctx, md);
  487|      0|    if (isize != NULL)
  ------------------
  |  Branch (487:9): [True: 0, False: 0]
  ------------------
  488|      0|        *isize = mdsize;
  489|      0|    if (ctx->digest->cleanup) {
  ------------------
  |  Branch (489:9): [True: 0, False: 0]
  ------------------
  490|      0|        ctx->digest->cleanup(ctx);
  491|      0|        EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  222|      0|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  492|      0|    }
  493|      0|    OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
  494|      0|    return ret;
  495|   242M|}
EVP_DigestFinalXOF:
  499|   160M|{
  500|   160M|    int ret = 0;
  501|   160M|    OSSL_PARAM params[2];
  502|   160M|    size_t i = 0;
  503|       |
  504|   160M|    if (ctx->digest == NULL) {
  ------------------
  |  Branch (504:9): [True: 0, False: 160M]
  ------------------
  505|      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)
  |  |  ------------------
  ------------------
  506|      0|        return 0;
  507|      0|    }
  508|       |
  509|   160M|    if (ctx->digest->prov == NULL)
  ------------------
  |  Branch (509:9): [True: 0, False: 160M]
  ------------------
  510|      0|        goto legacy;
  511|       |
  512|   160M|    if (ctx->digest->dfinal == NULL) {
  ------------------
  |  Branch (512:9): [True: 0, False: 160M]
  ------------------
  513|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_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)
  |  |  ------------------
  ------------------
  514|      0|        return 0;
  515|      0|    }
  516|       |
  517|   160M|    if ((ctx->flags & EVP_MD_CTX_FLAG_FINALISED) != 0) {
  ------------------
  |  |   33|   160M|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  |  Branch (517:9): [True: 0, False: 160M]
  ------------------
  518|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_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)
  |  |  ------------------
  ------------------
  519|      0|        return 0;
  520|      0|    }
  521|       |
  522|       |    /*
  523|       |     * For backward compatibility we pass the XOFLEN via a param here so that
  524|       |     * older providers can use the supplied value. Ideally we should have just
  525|       |     * used the size passed into ctx->digest->dfinal().
  526|       |     */
  527|   160M|    params[i++] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN, &size);
  ------------------
  |  |  226|   160M|# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
  ------------------
  528|   160M|    params[i++] = OSSL_PARAM_construct_end();
  529|       |
  530|   160M|    if (EVP_MD_CTX_set_params(ctx, params) >= 0)
  ------------------
  |  Branch (530:9): [True: 160M, False: 0]
  ------------------
  531|   160M|        ret = ctx->digest->dfinal(ctx->algctx, md, &size, size);
  532|       |
  533|   160M|    ctx->flags |= EVP_MD_CTX_FLAG_FINALISED;
  ------------------
  |  |   33|   160M|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  534|       |
  535|   160M|    return ret;
  536|       |
  537|      0|legacy:
  538|      0|    if (EVP_MD_xof(ctx->digest)
  ------------------
  |  Branch (538:9): [True: 0, False: 0]
  ------------------
  539|      0|        && size <= INT_MAX
  ------------------
  |  Branch (539:12): [True: 0, False: 0]
  ------------------
  540|      0|        && ctx->digest->md_ctrl(ctx, EVP_MD_CTRL_XOF_LEN, (int)size, NULL)) {
  ------------------
  |  |  209|      0|#  define EVP_MD_CTRL_XOF_LEN                     0x3
  ------------------
  |  Branch (540:12): [True: 0, False: 0]
  ------------------
  541|      0|        ret = ctx->digest->final(ctx, md);
  542|      0|        if (ctx->digest->cleanup != NULL) {
  ------------------
  |  Branch (542:13): [True: 0, False: 0]
  ------------------
  543|      0|            ctx->digest->cleanup(ctx);
  544|      0|            EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
  ------------------
  |  |  222|      0|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  545|      0|        }
  546|      0|        OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size);
  547|      0|    } else {
  548|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NOT_XOF_OR_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)
  |  |  ------------------
  ------------------
  549|      0|    }
  550|       |
  551|      0|    return ret;
  552|   160M|}
EVP_MD_CTX_copy_ex:
  593|    402|{
  594|    402|    int digest_change = 0;
  595|    402|    unsigned char *tmp_buf;
  596|       |
  597|    402|    if (in == NULL) {
  ------------------
  |  Branch (597:9): [True: 0, False: 402]
  ------------------
  598|      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)
  |  |  ------------------
  ------------------
  599|      0|        return 0;
  600|      0|    }
  601|       |
  602|    402|    if (in->digest == NULL) {
  ------------------
  |  Branch (602:9): [True: 0, False: 402]
  ------------------
  603|       |        /* copying uninitialized digest context */
  604|      0|        EVP_MD_CTX_reset(out);
  605|      0|        if (out->fetched_digest != NULL)
  ------------------
  |  Branch (605:13): [True: 0, False: 0]
  ------------------
  606|      0|            EVP_MD_free(out->fetched_digest);
  607|      0|        *out = *in;
  608|      0|        goto clone_pkey;
  609|      0|    }
  610|       |
  611|    402|    if (in->digest->prov == NULL
  ------------------
  |  Branch (611:9): [True: 0, False: 402]
  ------------------
  612|    402|            || (in->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0)
  ------------------
  |  |  244|    402|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (612:16): [True: 0, False: 402]
  ------------------
  613|      0|        goto legacy;
  614|       |
  615|    402|    if (in->digest->dupctx == NULL) {
  ------------------
  |  Branch (615:9): [True: 0, False: 402]
  ------------------
  616|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_NOT_ABLE_TO_COPY_CTX);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  617|      0|        return 0;
  618|      0|    }
  619|       |
  620|    402|    if (out->digest == in->digest && in->digest->copyctx != NULL) {
  ------------------
  |  Branch (620:9): [True: 201, False: 201]
  |  Branch (620:38): [True: 201, False: 0]
  ------------------
  621|       |
  622|    201|        in->digest->copyctx(out->algctx, in->algctx);
  623|       |
  624|    201|        EVP_PKEY_CTX_free(out->pctx);
  625|    201|        out->pctx = NULL;
  626|    201|        cleanup_old_md_data(out, 0);
  627|       |
  628|    201|        out->flags = in->flags;
  629|    201|        out->update = in->update;
  630|    201|    } else {
  631|    201|        evp_md_ctx_reset_ex(out, 1);
  632|    201|        digest_change = (out->fetched_digest != in->fetched_digest);
  633|       |
  634|    201|        if (digest_change && in->fetched_digest != NULL
  ------------------
  |  Branch (634:13): [True: 201, False: 0]
  |  Branch (634:30): [True: 201, False: 0]
  ------------------
  635|    201|            && !EVP_MD_up_ref(in->fetched_digest))
  ------------------
  |  Branch (635:16): [True: 0, False: 201]
  ------------------
  636|      0|            return 0;
  637|    201|        if (digest_change && out->fetched_digest != NULL)
  ------------------
  |  Branch (637:13): [True: 201, False: 0]
  |  Branch (637:30): [True: 0, False: 201]
  ------------------
  638|      0|            EVP_MD_free(out->fetched_digest);
  639|    201|        *out = *in;
  640|       |        /* NULL out pointers in case of error */
  641|    201|        out->pctx = NULL;
  642|    201|        out->algctx = NULL;
  643|       |
  644|    201|        if (in->algctx != NULL) {
  ------------------
  |  Branch (644:13): [True: 201, False: 0]
  ------------------
  645|    201|            out->algctx = in->digest->dupctx(in->algctx);
  646|    201|            if (out->algctx == NULL) {
  ------------------
  |  Branch (646:17): [True: 0, False: 201]
  ------------------
  647|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_NOT_ABLE_TO_COPY_CTX);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  648|      0|                return 0;
  649|      0|            }
  650|    201|        }
  651|    201|    }
  652|       |
  653|    402| clone_pkey:
  654|       |    /* copied EVP_MD_CTX should free the copied EVP_PKEY_CTX */
  655|    402|    EVP_MD_CTX_clear_flags(out, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX);
  ------------------
  |  |   32|    402|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX   0x0400
  ------------------
  656|    402|#ifndef FIPS_MODULE
  657|    402|    if (in->pctx != NULL) {
  ------------------
  |  Branch (657:9): [True: 0, False: 402]
  ------------------
  658|      0|        out->pctx = EVP_PKEY_CTX_dup(in->pctx);
  659|      0|        if (out->pctx == NULL) {
  ------------------
  |  Branch (659:13): [True: 0, False: 0]
  ------------------
  660|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_NOT_ABLE_TO_COPY_CTX);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  661|      0|            EVP_MD_CTX_reset(out);
  662|      0|            return 0;
  663|      0|        }
  664|      0|    }
  665|    402|#endif
  666|       |
  667|    402|    return 1;
  668|       |
  669|       |    /* Code below to be removed when legacy support is dropped. */
  670|      0| legacy:
  671|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  672|       |    /* Make sure it's safe to copy a digest context using an ENGINE */
  673|      0|    if (in->engine && !ENGINE_init(in->engine)) {
  ------------------
  |  Branch (673:9): [True: 0, False: 0]
  |  Branch (673:23): [True: 0, False: 0]
  ------------------
  674|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_ENGINE_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  675|      0|        return 0;
  676|      0|    }
  677|      0|#endif
  678|       |
  679|      0|    if (out->digest == in->digest) {
  ------------------
  |  Branch (679:9): [True: 0, False: 0]
  ------------------
  680|      0|        tmp_buf = out->md_data;
  681|      0|        EVP_MD_CTX_set_flags(out, EVP_MD_CTX_FLAG_REUSE);
  ------------------
  |  |  224|      0|# define EVP_MD_CTX_FLAG_REUSE           0x0004/* Don't free up ctx->md_data
  ------------------
  682|      0|    } else
  683|      0|        tmp_buf = NULL;
  684|      0|    EVP_MD_CTX_reset(out);
  685|      0|    memcpy(out, in, sizeof(*out));
  686|       |
  687|       |    /* copied EVP_MD_CTX should free the copied EVP_PKEY_CTX */
  688|      0|    EVP_MD_CTX_clear_flags(out, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX);
  ------------------
  |  |   32|      0|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX   0x0400
  ------------------
  689|       |
  690|       |    /* Null these variables, since they are getting fixed up
  691|       |     * properly below.  Anything else may cause a memleak and/or
  692|       |     * double free if any of the memory allocations below fail
  693|       |     */
  694|      0|    out->md_data = NULL;
  695|      0|    out->pctx = NULL;
  696|       |
  697|      0|    if (in->md_data && out->digest->ctx_size) {
  ------------------
  |  Branch (697:9): [True: 0, False: 0]
  |  Branch (697:24): [True: 0, False: 0]
  ------------------
  698|      0|        if (tmp_buf)
  ------------------
  |  Branch (698:13): [True: 0, False: 0]
  ------------------
  699|      0|            out->md_data = tmp_buf;
  700|      0|        else {
  701|      0|            out->md_data = OPENSSL_malloc(out->digest->ctx_size);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  702|      0|            if (out->md_data == NULL)
  ------------------
  |  Branch (702:17): [True: 0, False: 0]
  ------------------
  703|      0|                return 0;
  704|      0|        }
  705|      0|        memcpy(out->md_data, in->md_data, out->digest->ctx_size);
  706|      0|    }
  707|       |
  708|      0|    out->update = in->update;
  709|       |
  710|      0|#ifndef FIPS_MODULE
  711|      0|    if (in->pctx) {
  ------------------
  |  Branch (711:9): [True: 0, False: 0]
  ------------------
  712|      0|        out->pctx = EVP_PKEY_CTX_dup(in->pctx);
  713|      0|        if (!out->pctx) {
  ------------------
  |  Branch (713:13): [True: 0, False: 0]
  ------------------
  714|      0|            EVP_MD_CTX_reset(out);
  715|      0|            return 0;
  716|      0|        }
  717|      0|    }
  718|      0|#endif
  719|       |
  720|      0|    if (out->digest->copy)
  ------------------
  |  Branch (720:9): [True: 0, False: 0]
  ------------------
  721|      0|        return out->digest->copy(out, in);
  722|       |
  723|      0|    return 1;
  724|      0|}
EVP_MD_CTX_set_params:
  777|   160M|{
  778|   160M|    EVP_PKEY_CTX *pctx = ctx->pctx;
  779|       |
  780|       |    /* If we have a pctx then we should try that first */
  781|   160M|    if (pctx != NULL
  ------------------
  |  Branch (781:9): [True: 0, False: 160M]
  ------------------
  782|   160M|            && (pctx->operation == EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (782:17): [True: 0, False: 0]
  ------------------
  783|      0|                || pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  |  Branch (783:20): [True: 0, False: 0]
  ------------------
  784|   160M|            && pctx->op.sig.algctx != NULL
  ------------------
  |  Branch (784:16): [True: 0, False: 0]
  ------------------
  785|   160M|            && pctx->op.sig.signature->set_ctx_md_params != NULL)
  ------------------
  |  Branch (785:16): [True: 0, False: 0]
  ------------------
  786|      0|        return pctx->op.sig.signature->set_ctx_md_params(pctx->op.sig.algctx,
  787|      0|                                                         params);
  788|       |
  789|   160M|    if (ctx->digest != NULL && ctx->digest->set_ctx_params != NULL)
  ------------------
  |  Branch (789:9): [True: 160M, False: 0]
  |  Branch (789:32): [True: 160M, False: 0]
  ------------------
  790|   160M|        return ctx->digest->set_ctx_params(ctx->algctx, params);
  791|       |
  792|      0|    return 0;
  793|   160M|}
EVP_MD_CTX_gettable_params:
  863|   242M|{
  864|   242M|    EVP_PKEY_CTX *pctx;
  865|   242M|    void *provctx;
  866|       |
  867|   242M|    if (ctx == NULL)
  ------------------
  |  Branch (867:9): [True: 0, False: 242M]
  ------------------
  868|      0|        return NULL;
  869|       |
  870|       |    /* If we have a pctx then we should try that first */
  871|   242M|    pctx = ctx->pctx;
  872|   242M|    if (pctx != NULL
  ------------------
  |  Branch (872:9): [True: 0, False: 242M]
  ------------------
  873|   242M|            && (pctx->operation == EVP_PKEY_OP_VERIFYCTX
  ------------------
  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (873:17): [True: 0, False: 0]
  ------------------
  874|      0|                || pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  |  Branch (874:20): [True: 0, False: 0]
  ------------------
  875|   242M|            && pctx->op.sig.algctx != NULL
  ------------------
  |  Branch (875:16): [True: 0, False: 0]
  ------------------
  876|   242M|            && pctx->op.sig.signature->gettable_ctx_md_params != NULL)
  ------------------
  |  Branch (876:16): [True: 0, False: 0]
  ------------------
  877|      0|        return pctx->op.sig.signature->gettable_ctx_md_params(
  878|      0|                    pctx->op.sig.algctx);
  879|       |
  880|   242M|    if (ctx->digest != NULL && ctx->digest->gettable_ctx_params != NULL) {
  ------------------
  |  Branch (880:9): [True: 242M, False: 0]
  |  Branch (880:32): [True: 0, False: 242M]
  ------------------
  881|      0|        provctx = ossl_provider_ctx(EVP_MD_get0_provider(ctx->digest));
  882|      0|        return ctx->digest->gettable_ctx_params(ctx->algctx, provctx);
  883|      0|    }
  884|   242M|    return NULL;
  885|   242M|}
evp_md_new:
  942|     27|{
  943|     27|    EVP_MD *md = OPENSSL_zalloc(sizeof(*md));
  ------------------
  |  |  104|     27|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  944|       |
  945|     27|    if (md != NULL && !CRYPTO_NEW_REF(&md->refcnt, 1)) {
  ------------------
  |  Branch (945:9): [True: 27, False: 0]
  |  Branch (945:23): [True: 0, False: 27]
  ------------------
  946|      0|        OPENSSL_free(md);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  947|      0|        return NULL;
  948|      0|    }
  949|     27|    return md;
  950|     27|}
EVP_MD_fetch:
 1164|  1.10k|{
 1165|  1.10k|    EVP_MD *md =
 1166|  1.10k|        evp_generic_fetch(ctx, OSSL_OP_DIGEST, algorithm, properties,
  ------------------
  |  |  310|  1.10k|# define OSSL_OP_DIGEST                              1
  ------------------
 1167|  1.10k|                          evp_md_from_algorithm, evp_md_up_ref, evp_md_free);
 1168|       |
 1169|  1.10k|    return md;
 1170|  1.10k|}
EVP_MD_up_ref:
 1173|  3.71k|{
 1174|  3.71k|    int ref = 0;
 1175|       |
 1176|  3.71k|    if (md->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  3.71k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1176:9): [True: 3.71k, False: 0]
  ------------------
 1177|  3.71k|        CRYPTO_UP_REF(&md->refcnt, &ref);
 1178|  3.71k|    return 1;
 1179|  3.71k|}
EVP_MD_free:
 1182|  10.9k|{
 1183|  10.9k|    int i;
 1184|       |
 1185|  10.9k|    if (md == NULL || md->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|  3.74k|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (1185:9): [True: 7.16k, False: 3.74k]
  |  Branch (1185:23): [True: 0, False: 3.74k]
  ------------------
 1186|  7.16k|        return;
 1187|       |
 1188|  3.74k|    CRYPTO_DOWN_REF(&md->refcnt, &i);
 1189|  3.74k|    if (i > 0)
  ------------------
  |  Branch (1189:9): [True: 3.71k, False: 27]
  ------------------
 1190|  3.71k|        return;
 1191|     27|    evp_md_free_int(md);
 1192|     27|}
digest.c:cleanup_old_md_data:
   30|   403M|{
   31|   403M|    if (ctx->digest != NULL) {
  ------------------
  |  Branch (31:9): [True: 403M, False: 6.40k]
  ------------------
   32|   403M|        if (ctx->digest->cleanup != NULL
  ------------------
  |  Branch (32:13): [True: 0, False: 403M]
  ------------------
   33|   403M|                && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_CLEANED))
  ------------------
  |  |  222|      0|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  |  Branch (33:20): [True: 0, False: 0]
  ------------------
   34|      0|            ctx->digest->cleanup(ctx);
   35|   403M|        if (ctx->md_data != NULL && ctx->digest->ctx_size > 0
  ------------------
  |  Branch (35:13): [True: 0, False: 403M]
  |  Branch (35:37): [True: 0, False: 0]
  ------------------
   36|   403M|                && (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)
  ------------------
  |  |  224|      0|# define EVP_MD_CTX_FLAG_REUSE           0x0004/* Don't free up ctx->md_data
  ------------------
  |  Branch (36:21): [True: 0, False: 0]
  ------------------
   37|      0|                    || force)) {
  ------------------
  |  Branch (37:24): [True: 0, False: 0]
  ------------------
   38|      0|            OPENSSL_clear_free(ctx->md_data, ctx->digest->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__
  |  |  ------------------
  ------------------
   39|      0|            ctx->md_data = NULL;
   40|      0|        }
   41|   403M|    }
   42|   403M|}
digest.c:evp_md_ctx_reset_ex:
   77|  8.81k|{
   78|  8.81k|    if (ctx == NULL)
  ------------------
  |  Branch (78:9): [True: 2.21k, False: 6.60k]
  ------------------
   79|  2.21k|        return 1;
   80|       |
   81|       |    /*
   82|       |     * pctx should be freed by the user of EVP_MD_CTX
   83|       |     * if EVP_MD_CTX_FLAG_KEEP_PKEY_CTX is set
   84|       |     */
   85|  6.60k|    if (!EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX)) {
  ------------------
  |  |   32|  6.60k|#define EVP_MD_CTX_FLAG_KEEP_PKEY_CTX   0x0400
  ------------------
  |  Branch (85:9): [True: 6.60k, False: 0]
  ------------------
   86|  6.60k|        EVP_PKEY_CTX_free(ctx->pctx);
   87|  6.60k|        ctx->pctx = NULL;
   88|  6.60k|    }
   89|       |
   90|  6.60k|    evp_md_ctx_clear_digest(ctx, 0, keep_fetched);
   91|  6.60k|    if (!keep_fetched)
  ------------------
  |  Branch (91:9): [True: 6.40k, False: 201]
  ------------------
   92|  6.40k|        OPENSSL_cleanse(ctx, sizeof(*ctx));
   93|       |
   94|  6.60k|    return 1;
   95|  8.81k|}
digest.c:evp_md_init_internal:
  159|   403M|{
  160|   403M|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  161|   403M|    ENGINE *tmpimpl = NULL;
  162|   403M|#endif
  163|       |
  164|   403M|#if !defined(FIPS_MODULE)
  165|   403M|    if (ctx->pctx != NULL
  ------------------
  |  Branch (165:9): [True: 0, False: 403M]
  ------------------
  166|   403M|            && EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  741|   403M|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|      0|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|      0|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|      0|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|      0|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (741:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  167|   403M|            && ctx->pctx->op.sig.algctx != NULL) {
  ------------------
  |  Branch (167:16): [True: 0, False: 0]
  ------------------
  168|       |        /*
  169|       |         * Prior to OpenSSL 3.0 calling EVP_DigestInit_ex() on an mdctx
  170|       |         * previously initialised with EVP_DigestSignInit() would retain
  171|       |         * information about the key, and re-initialise for another sign
  172|       |         * operation. So in that case we redirect to EVP_DigestSignInit()
  173|       |         */
  174|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_SIGNCTX)
  ------------------
  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  ------------------
  |  Branch (174:13): [True: 0, False: 0]
  ------------------
  175|      0|            return EVP_DigestSignInit(ctx, NULL, type, impl, NULL);
  176|      0|        if (ctx->pctx->operation == EVP_PKEY_OP_VERIFYCTX)
  ------------------
  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  ------------------
  |  Branch (176:13): [True: 0, False: 0]
  ------------------
  177|      0|            return EVP_DigestVerifyInit(ctx, NULL, type, impl, NULL);
  178|      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)
  |  |  ------------------
  ------------------
  179|      0|        return 0;
  180|      0|    }
  181|   403M|#endif
  182|       |
  183|   403M|    EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED
  ------------------
  |  |  222|   403M|# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been
  ------------------
  184|   403M|                                | EVP_MD_CTX_FLAG_FINALISED);
  ------------------
  |  |   33|   403M|#define EVP_MD_CTX_FLAG_FINALISED       0x0800
  ------------------
  185|       |
  186|   403M|    if (type != NULL) {
  ------------------
  |  Branch (186:9): [True: 2.51k, False: 403M]
  ------------------
  187|  2.51k|        ctx->reqdigest = type;
  188|   403M|    } else {
  189|   403M|        if (ctx->digest == NULL) {
  ------------------
  |  Branch (189:13): [True: 0, False: 403M]
  ------------------
  190|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_NO_DIGEST_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)
  |  |  ------------------
  ------------------
  191|      0|            return 0;
  192|      0|        }
  193|   403M|        type = ctx->digest;
  194|   403M|    }
  195|       |
  196|       |    /* Code below to be removed when legacy support is dropped. */
  197|   403M|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  198|       |    /*
  199|       |     * Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
  200|       |     * this context may already have an ENGINE! Try to avoid releasing the
  201|       |     * previous handle, re-querying for an ENGINE, and having a
  202|       |     * reinitialisation, when it may all be unnecessary.
  203|       |     */
  204|   403M|    if (ctx->engine != NULL
  ------------------
  |  Branch (204:9): [True: 0, False: 403M]
  ------------------
  205|   403M|            && ctx->digest != NULL
  ------------------
  |  Branch (205:16): [True: 0, False: 0]
  ------------------
  206|   403M|            && type->type == ctx->digest->type)
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|      0|        goto skip_to_init;
  208|       |
  209|       |    /*
  210|       |     * Ensure an ENGINE left lying around from last time is cleared (the
  211|       |     * previous check attempted to avoid this if the same ENGINE and
  212|       |     * EVP_MD could be used).
  213|       |     */
  214|   403M|    ENGINE_finish(ctx->engine);
  215|   403M|    ctx->engine = NULL;
  216|       |
  217|   403M|    if (impl == NULL)
  ------------------
  |  Branch (217:9): [True: 403M, False: 0]
  ------------------
  218|   403M|        tmpimpl = ENGINE_get_digest_engine(type->type);
  219|   403M|#endif
  220|       |
  221|       |    /*
  222|       |     * If there are engines involved or EVP_MD_CTX_FLAG_NO_INIT is set then we
  223|       |     * should use legacy handling for now.
  224|       |     */
  225|   403M|    if (impl != NULL
  ------------------
  |  Branch (225:9): [True: 0, False: 403M]
  ------------------
  226|   403M|#if !defined(OPENSSL_NO_ENGINE)
  227|   403M|            || ctx->engine != NULL
  ------------------
  |  Branch (227:16): [True: 0, False: 403M]
  ------------------
  228|   403M|# if !defined(FIPS_MODULE)
  229|   403M|            || tmpimpl != NULL
  ------------------
  |  Branch (229:16): [True: 0, False: 403M]
  ------------------
  230|   403M|# endif
  231|   403M|#endif
  232|   403M|            || (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) != 0
  ------------------
  |  |  244|   403M|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (232:16): [True: 0, False: 403M]
  ------------------
  233|   403M|            || (type != NULL && type->origin == EVP_ORIG_METH)
  ------------------
  |  |  254|   403M|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (233:17): [True: 403M, False: 0]
  |  Branch (233:33): [True: 0, False: 403M]
  ------------------
  234|   403M|            || (type == NULL && ctx->digest != NULL
  ------------------
  |  Branch (234:17): [True: 0, False: 403M]
  |  Branch (234:33): [True: 0, False: 0]
  ------------------
  235|   403M|                             && ctx->digest->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  254|      0|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (235:33): [True: 0, False: 0]
  ------------------
  236|       |        /* If we were using provided hash before, cleanup algctx */
  237|      0|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (237:13): [True: 0, False: 0]
  ------------------
  238|      0|            return 0;
  239|      0|        if (ctx->digest == ctx->fetched_digest)
  ------------------
  |  Branch (239:13): [True: 0, False: 0]
  ------------------
  240|      0|            ctx->digest = NULL;
  241|      0|        EVP_MD_free(ctx->fetched_digest);
  242|      0|        ctx->fetched_digest = NULL;
  243|      0|        goto legacy;
  244|      0|    }
  245|       |
  246|   403M|    cleanup_old_md_data(ctx, 1);
  247|       |
  248|       |    /* Start of non-legacy code below */
  249|   403M|    if (ctx->digest == type) {
  ------------------
  |  Branch (249:9): [True: 403M, False: 2.37k]
  ------------------
  250|   403M|        if (!ossl_assert(type->prov != NULL)) {
  ------------------
  |  |   52|   403M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   403M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (250:13): [True: 0, False: 403M]
  ------------------
  251|      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)
  |  |  ------------------
  ------------------
  252|      0|            return 0;
  253|      0|        }
  254|   403M|    } else {
  255|  2.37k|        if (!evp_md_ctx_free_algctx(ctx))
  ------------------
  |  Branch (255:13): [True: 0, False: 2.37k]
  ------------------
  256|      0|            return 0;
  257|  2.37k|    }
  258|       |
  259|   403M|    if (type->prov == NULL) {
  ------------------
  |  Branch (259:9): [True: 0, False: 403M]
  ------------------
  260|       |#ifdef FIPS_MODULE
  261|       |        /* We only do explicit fetches inside the FIPS module */
  262|       |        ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  263|       |        return 0;
  264|       |#else
  265|       |        /* The NULL digest is a special case */
  266|      0|        EVP_MD *provmd = EVP_MD_fetch(NULL,
  267|      0|                                      type->type != NID_undef ? OBJ_nid2sn(type->type)
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  |  Branch (267:39): [True: 0, False: 0]
  ------------------
  268|      0|                                                              : "NULL", "");
  269|       |
  270|      0|        if (provmd == NULL) {
  ------------------
  |  Branch (270:13): [True: 0, False: 0]
  ------------------
  271|      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)
  |  |  ------------------
  ------------------
  272|      0|            return 0;
  273|      0|        }
  274|      0|        type = provmd;
  275|      0|        EVP_MD_free(ctx->fetched_digest);
  276|      0|        ctx->fetched_digest = provmd;
  277|      0|#endif
  278|      0|    }
  279|       |
  280|   403M|    if (type->prov != NULL && ctx->fetched_digest != type) {
  ------------------
  |  Branch (280:9): [True: 403M, False: 0]
  |  Branch (280:31): [True: 2.37k, False: 403M]
  ------------------
  281|  2.37k|        if (!EVP_MD_up_ref((EVP_MD *)type)) {
  ------------------
  |  Branch (281:13): [True: 0, False: 2.37k]
  ------------------
  282|      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)
  |  |  ------------------
  ------------------
  283|      0|            return 0;
  284|      0|        }
  285|  2.37k|        EVP_MD_free(ctx->fetched_digest);
  286|  2.37k|        ctx->fetched_digest = (EVP_MD *)type;
  287|  2.37k|    }
  288|   403M|    ctx->digest = type;
  289|   403M|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (289:9): [True: 2.37k, False: 403M]
  ------------------
  290|  2.37k|        ctx->algctx = ctx->digest->newctx(ossl_provider_ctx(type->prov));
  291|  2.37k|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (291:13): [True: 0, False: 2.37k]
  ------------------
  292|      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)
  |  |  ------------------
  ------------------
  293|      0|            return 0;
  294|      0|        }
  295|  2.37k|    }
  296|       |
  297|   403M|    if (ctx->digest->dinit == NULL) {
  ------------------
  |  Branch (297:9): [True: 0, False: 403M]
  ------------------
  298|      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)
  |  |  ------------------
  ------------------
  299|      0|        return 0;
  300|      0|    }
  301|       |
  302|   403M|    return ctx->digest->dinit(ctx->algctx, params);
  303|       |
  304|       |    /* Code below to be removed when legacy support is dropped. */
  305|      0| legacy:
  306|       |
  307|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  308|      0|    if (type) {
  ------------------
  |  Branch (308:9): [True: 0, False: 0]
  ------------------
  309|      0|        if (impl != NULL) {
  ------------------
  |  Branch (309:13): [True: 0, False: 0]
  ------------------
  310|      0|            if (!ENGINE_init(impl)) {
  ------------------
  |  Branch (310:17): [True: 0, False: 0]
  ------------------
  311|      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)
  |  |  ------------------
  ------------------
  312|      0|                return 0;
  313|      0|            }
  314|      0|        } else {
  315|       |            /* Ask if an ENGINE is reserved for this job */
  316|      0|            impl = tmpimpl;
  317|      0|        }
  318|      0|        if (impl != NULL) {
  ------------------
  |  Branch (318:13): [True: 0, False: 0]
  ------------------
  319|       |            /* There's an ENGINE for this job ... (apparently) */
  320|      0|            const EVP_MD *d = ENGINE_get_digest(impl, type->type);
  321|       |
  322|      0|            if (d == NULL) {
  ------------------
  |  Branch (322:17): [True: 0, False: 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|                ENGINE_finish(impl);
  325|      0|                return 0;
  326|      0|            }
  327|       |            /* We'll use the ENGINE's private digest definition */
  328|      0|            type = d;
  329|       |            /*
  330|       |             * Store the ENGINE functional reference so we know 'type' came
  331|       |             * from an ENGINE and we need to release it when done.
  332|       |             */
  333|      0|            ctx->engine = impl;
  334|      0|        } else
  335|      0|            ctx->engine = NULL;
  336|      0|    }
  337|      0|#endif
  338|      0|    if (ctx->digest != type) {
  ------------------
  |  Branch (338:9): [True: 0, False: 0]
  ------------------
  339|      0|        cleanup_old_md_data(ctx, 1);
  340|       |
  341|      0|        ctx->digest = type;
  342|      0|        if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) {
  ------------------
  |  |  244|      0|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  |  Branch (342:56): [True: 0, False: 0]
  ------------------
  343|      0|            ctx->update = type->update;
  344|      0|            ctx->md_data = OPENSSL_zalloc(type->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__
  |  |  ------------------
  ------------------
  345|      0|            if (ctx->md_data == NULL)
  ------------------
  |  Branch (345:17): [True: 0, False: 0]
  ------------------
  346|      0|                return 0;
  347|      0|        }
  348|      0|    }
  349|      0|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  350|      0| skip_to_init:
  351|      0|#endif
  352|      0|#ifndef FIPS_MODULE
  353|      0|    if (ctx->pctx != NULL
  ------------------
  |  Branch (353:9): [True: 0, False: 0]
  ------------------
  354|      0|            && (!EVP_PKEY_CTX_IS_SIGNATURE_OP(ctx->pctx)
  ------------------
  |  |  741|      0|    (((ctx)->operation & EVP_PKEY_OP_TYPE_SIG) != 0)
  |  |  ------------------
  |  |  |  | 1764|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  |  |  ------------------
  |  |  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1758|      0|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  |  |  ------------------
  |  |  |  | 1765|      0|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1759|      0|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  |  |  ------------------
  |  |  |  | 1766|      0|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  |  |  ------------------
  |  |  |  | 1767|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  |  |  ------------------
  |  |  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (354:17): [True: 0, False: 0]
  ------------------
  355|      0|                 || ctx->pctx->op.sig.signature == NULL)) {
  ------------------
  |  Branch (355:21): [True: 0, False: 0]
  ------------------
  356|      0|        int r;
  357|      0|        r = EVP_PKEY_CTX_ctrl(ctx->pctx, -1, EVP_PKEY_OP_TYPE_SIG,
  ------------------
  |  | 1764|      0|    (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  ------------------
  |  |  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_SIGNMSG                             \
  |  |  ------------------
  |  |  |  | 1758|      0|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  |  |  ------------------
  |  | 1765|      0|     | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  ------------------
  |  |  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  |  |  ------------------
  |  |                    | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYMSG                       \
  |  |  ------------------
  |  |  |  | 1759|      0|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  |  |  ------------------
  |  | 1766|      0|     | EVP_PKEY_OP_VERIFYRECOVER                                        \
  |  |  ------------------
  |  |  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  |  |  ------------------
  |  | 1767|      0|     | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1751|      0|# define EVP_PKEY_OP_SIGNCTX             (1 << 7)
  |  |  ------------------
  |  |                    | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
  |  |  ------------------
  |  |  |  | 1752|      0|# define EVP_PKEY_OP_VERIFYCTX           (1 << 8)
  |  |  ------------------
  ------------------
  358|      0|                              EVP_PKEY_CTRL_DIGESTINIT, 0, ctx);
  ------------------
  |  | 1793|      0|# define EVP_PKEY_CTRL_DIGESTINIT        7
  ------------------
  359|      0|        if (r <= 0 && (r != -2))
  ------------------
  |  Branch (359:13): [True: 0, False: 0]
  |  Branch (359:23): [True: 0, False: 0]
  ------------------
  360|      0|            return 0;
  361|      0|    }
  362|      0|#endif
  363|      0|    if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT)
  ------------------
  |  |  244|      0|# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */
  ------------------
  |  Branch (363:9): [True: 0, False: 0]
  ------------------
  364|      0|        return 1;
  365|      0|    return ctx->digest->init(ctx);
  366|      0|}
digest.c:evp_md_from_algorithm:
 1018|     27|{
 1019|     27|    const OSSL_DISPATCH *fns = algodef->implementation;
 1020|     27|    EVP_MD *md = NULL;
 1021|     27|    int fncnt = 0;
 1022|       |
 1023|       |    /* EVP_MD_fetch() will set the legacy NID if available */
 1024|     27|    if ((md = evp_md_new()) == NULL) {
  ------------------
  |  Branch (1024:9): [True: 0, False: 27]
  ------------------
 1025|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1026|      0|        return NULL;
 1027|      0|    }
 1028|       |
 1029|     27|#ifndef FIPS_MODULE
 1030|     27|    md->type = NID_undef;
  ------------------
  |  |   18|     27|#define NID_undef                       0
  ------------------
 1031|     27|    if (!evp_names_do_all(prov, name_id, set_legacy_nid, &md->type)
  ------------------
  |  Branch (1031:9): [True: 0, False: 27]
  ------------------
 1032|     27|            || md->type == -1) {
  ------------------
  |  Branch (1032:16): [True: 0, False: 27]
  ------------------
 1033|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1034|      0|        goto err;
 1035|      0|    }
 1036|     27|#endif
 1037|       |
 1038|     27|    md->name_id = name_id;
 1039|     27|    if ((md->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (1039:9): [True: 0, False: 27]
  ------------------
 1040|      0|        goto err;
 1041|       |
 1042|     27|    md->description = algodef->algorithm_description;
 1043|       |
 1044|    302|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (1044:12): [True: 275, False: 27]
  ------------------
 1045|    275|        switch (fns->function_id) {
  ------------------
  |  Branch (1045:17): [True: 0, False: 275]
  ------------------
 1046|     27|        case OSSL_FUNC_DIGEST_NEWCTX:
  ------------------
  |  |  330|     27|# define OSSL_FUNC_DIGEST_NEWCTX                     1
  ------------------
  |  Branch (1046:9): [True: 27, False: 248]
  ------------------
 1047|     27|            if (md->newctx == NULL) {
  ------------------
  |  Branch (1047:17): [True: 27, False: 0]
  ------------------
 1048|     27|                md->newctx = OSSL_FUNC_digest_newctx(fns);
 1049|     27|                fncnt++;
 1050|     27|            }
 1051|     27|            break;
 1052|     27|        case OSSL_FUNC_DIGEST_INIT:
  ------------------
  |  |  331|     27|# define OSSL_FUNC_DIGEST_INIT                       2
  ------------------
  |  Branch (1052:9): [True: 27, False: 248]
  ------------------
 1053|     27|            if (md->dinit == NULL) {
  ------------------
  |  Branch (1053:17): [True: 27, False: 0]
  ------------------
 1054|     27|                md->dinit = OSSL_FUNC_digest_init(fns);
 1055|     27|                fncnt++;
 1056|     27|            }
 1057|     27|            break;
 1058|     27|        case OSSL_FUNC_DIGEST_UPDATE:
  ------------------
  |  |  332|     27|# define OSSL_FUNC_DIGEST_UPDATE                     3
  ------------------
  |  Branch (1058:9): [True: 27, False: 248]
  ------------------
 1059|     27|            if (md->dupdate == NULL) {
  ------------------
  |  Branch (1059:17): [True: 27, False: 0]
  ------------------
 1060|     27|                md->dupdate = OSSL_FUNC_digest_update(fns);
 1061|     27|                fncnt++;
 1062|     27|            }
 1063|     27|            break;
 1064|     27|        case OSSL_FUNC_DIGEST_FINAL:
  ------------------
  |  |  333|     27|# define OSSL_FUNC_DIGEST_FINAL                      4
  ------------------
  |  Branch (1064:9): [True: 27, False: 248]
  ------------------
 1065|     27|            if (md->dfinal == NULL) {
  ------------------
  |  Branch (1065:17): [True: 27, False: 0]
  ------------------
 1066|     27|                md->dfinal = OSSL_FUNC_digest_final(fns);
 1067|     27|                fncnt++;
 1068|     27|            }
 1069|     27|            break;
 1070|      4|        case OSSL_FUNC_DIGEST_SQUEEZE:
  ------------------
  |  |  343|      4|# define OSSL_FUNC_DIGEST_SQUEEZE                   14
  ------------------
  |  Branch (1070:9): [True: 4, False: 271]
  ------------------
 1071|      4|            if (md->dsqueeze == NULL) {
  ------------------
  |  Branch (1071:17): [True: 4, False: 0]
  ------------------
 1072|      4|                md->dsqueeze = OSSL_FUNC_digest_squeeze(fns);
 1073|      4|                fncnt++;
 1074|      4|            }
 1075|      4|            break;
 1076|      0|        case OSSL_FUNC_DIGEST_DIGEST:
  ------------------
  |  |  334|      0|# define OSSL_FUNC_DIGEST_DIGEST                     5
  ------------------
  |  Branch (1076:9): [True: 0, False: 275]
  ------------------
 1077|      0|            if (md->digest == NULL)
  ------------------
  |  Branch (1077:17): [True: 0, False: 0]
  ------------------
 1078|      0|                md->digest = OSSL_FUNC_digest_digest(fns);
 1079|       |            /* We don't increment fnct for this as it is stand alone */
 1080|      0|            break;
 1081|     27|        case OSSL_FUNC_DIGEST_FREECTX:
  ------------------
  |  |  335|     27|# define OSSL_FUNC_DIGEST_FREECTX                    6
  ------------------
  |  Branch (1081:9): [True: 27, False: 248]
  ------------------
 1082|     27|            if (md->freectx == NULL) {
  ------------------
  |  Branch (1082:17): [True: 27, False: 0]
  ------------------
 1083|     27|                md->freectx = OSSL_FUNC_digest_freectx(fns);
 1084|     27|                fncnt++;
 1085|     27|            }
 1086|     27|            break;
 1087|     27|        case OSSL_FUNC_DIGEST_DUPCTX:
  ------------------
  |  |  336|     27|# define OSSL_FUNC_DIGEST_DUPCTX                     7
  ------------------
  |  Branch (1087:9): [True: 27, False: 248]
  ------------------
 1088|     27|            if (md->dupctx == NULL)
  ------------------
  |  Branch (1088:17): [True: 27, False: 0]
  ------------------
 1089|     27|                md->dupctx = OSSL_FUNC_digest_dupctx(fns);
 1090|     27|            break;
 1091|     27|        case OSSL_FUNC_DIGEST_GET_PARAMS:
  ------------------
  |  |  337|     27|# define OSSL_FUNC_DIGEST_GET_PARAMS                 8
  ------------------
  |  Branch (1091:9): [True: 27, False: 248]
  ------------------
 1092|     27|            if (md->get_params == NULL)
  ------------------
  |  Branch (1092:17): [True: 27, False: 0]
  ------------------
 1093|     27|                md->get_params = OSSL_FUNC_digest_get_params(fns);
 1094|     27|            break;
 1095|      8|        case OSSL_FUNC_DIGEST_SET_CTX_PARAMS:
  ------------------
  |  |  338|      8|# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS             9
  ------------------
  |  Branch (1095:9): [True: 8, False: 267]
  ------------------
 1096|      8|            if (md->set_ctx_params == NULL)
  ------------------
  |  Branch (1096:17): [True: 8, False: 0]
  ------------------
 1097|      8|                md->set_ctx_params = OSSL_FUNC_digest_set_ctx_params(fns);
 1098|      8|            break;
 1099|      6|        case OSSL_FUNC_DIGEST_GET_CTX_PARAMS:
  ------------------
  |  |  339|      6|# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS            10
  ------------------
  |  Branch (1099:9): [True: 6, False: 269]
  ------------------
 1100|      6|            if (md->get_ctx_params == NULL)
  ------------------
  |  Branch (1100:17): [True: 6, False: 0]
  ------------------
 1101|      6|                md->get_ctx_params = OSSL_FUNC_digest_get_ctx_params(fns);
 1102|      6|            break;
 1103|     27|        case OSSL_FUNC_DIGEST_GETTABLE_PARAMS:
  ------------------
  |  |  340|     27|# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS           11
  ------------------
  |  Branch (1103:9): [True: 27, False: 248]
  ------------------
 1104|     27|            if (md->gettable_params == NULL)
  ------------------
  |  Branch (1104:17): [True: 27, False: 0]
  ------------------
 1105|     27|                md->gettable_params = OSSL_FUNC_digest_gettable_params(fns);
 1106|     27|            break;
 1107|      8|        case OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  341|      8|# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS       12
  ------------------
  |  Branch (1107:9): [True: 8, False: 267]
  ------------------
 1108|      8|            if (md->settable_ctx_params == NULL)
  ------------------
  |  Branch (1108:17): [True: 8, False: 0]
  ------------------
 1109|      8|                md->settable_ctx_params =
 1110|      8|                    OSSL_FUNC_digest_settable_ctx_params(fns);
 1111|      8|            break;
 1112|      6|        case OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  342|      6|# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS       13
  ------------------
  |  Branch (1112:9): [True: 6, False: 269]
  ------------------
 1113|      6|            if (md->gettable_ctx_params == NULL)
  ------------------
  |  Branch (1113:17): [True: 6, False: 0]
  ------------------
 1114|      6|                md->gettable_ctx_params =
 1115|      6|                    OSSL_FUNC_digest_gettable_ctx_params(fns);
 1116|      6|            break;
 1117|     27|        case OSSL_FUNC_DIGEST_COPYCTX:
  ------------------
  |  |  344|     27|# define OSSL_FUNC_DIGEST_COPYCTX                   15
  ------------------
  |  Branch (1117:9): [True: 27, False: 248]
  ------------------
 1118|     27|            if (md->copyctx == NULL)
  ------------------
  |  Branch (1118:17): [True: 27, False: 0]
  ------------------
 1119|     27|                md->copyctx =
 1120|     27|                    OSSL_FUNC_digest_copyctx(fns);
 1121|     27|            break;
 1122|    275|        }
 1123|    275|    }
 1124|     27|    if ((fncnt != 0 && fncnt != 5 && fncnt != 6)
  ------------------
  |  Branch (1124:10): [True: 27, False: 0]
  |  Branch (1124:24): [True: 4, False: 23]
  |  Branch (1124:38): [True: 0, False: 4]
  ------------------
 1125|     27|        || (fncnt == 0 && md->digest == NULL)) {
  ------------------
  |  Branch (1125:13): [True: 0, False: 27]
  |  Branch (1125:27): [True: 0, False: 0]
  ------------------
 1126|       |        /*
 1127|       |         * In order to be a consistent set of functions we either need the
 1128|       |         * whole set of init/update/final etc functions or none of them.
 1129|       |         * The "digest" function can standalone. We at least need one way to
 1130|       |         * generate digests.
 1131|       |         */
 1132|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1133|      0|        goto err;
 1134|      0|    }
 1135|     27|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (1135:9): [True: 27, False: 0]
  |  Branch (1135:25): [True: 0, False: 27]
  ------------------
 1136|      0|        goto err;
 1137|       |
 1138|     27|    md->prov = prov;
 1139|       |
 1140|     27|    if (!evp_md_cache_constants(md)) {
  ------------------
  |  Branch (1140:9): [True: 0, False: 27]
  ------------------
 1141|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1142|      0|        goto err;
 1143|      0|    }
 1144|       |
 1145|     27|    return md;
 1146|       |
 1147|      0|err:
 1148|      0|    EVP_MD_free(md);
 1149|      0|    return NULL;
 1150|     27|}
digest.c:set_legacy_nid:
  959|     71|{
  960|     71|    int nid;
  961|     71|    int *legacy_nid = vlegacy_nid;
  962|       |    /*
  963|       |     * We use lowest level function to get the associated method, because
  964|       |     * higher level functions such as EVP_get_digestbyname() have changed
  965|       |     * to look at providers too.
  966|       |     */
  967|     71|    const void *legacy_method = OBJ_NAME_get(name, OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|     71|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  968|       |
  969|     71|    if (*legacy_nid == -1)       /* We found a clash already */
  ------------------
  |  Branch (969:9): [True: 0, False: 71]
  ------------------
  970|      0|        return;
  971|       |
  972|     71|    if (legacy_method == NULL)
  ------------------
  |  Branch (972:9): [True: 48, False: 23]
  ------------------
  973|     48|        return;
  974|     23|    nid = EVP_MD_nid(legacy_method);
  ------------------
  |  |  559|     23|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  975|     23|    if (*legacy_nid != NID_undef && *legacy_nid != nid) {
  ------------------
  |  |   18|     46|#define NID_undef                       0
  ------------------
  |  Branch (975:9): [True: 4, False: 19]
  |  Branch (975:37): [True: 0, False: 4]
  ------------------
  976|      0|        *legacy_nid = -1;
  977|      0|        return;
  978|      0|    }
  979|     23|    *legacy_nid = nid;
  980|     23|}
digest.c:evp_md_cache_constants:
  984|     27|{
  985|     27|    int ok, xof = 0, algid_absent = 0;
  986|     27|    size_t blksz = 0;
  987|     27|    size_t mdsize = 0;
  988|     27|    OSSL_PARAM params[5];
  989|       |
  990|       |    /*
  991|       |     * Note that these parameters are 'constants' that are only set up
  992|       |     * during the EVP_MD_fetch(). For this reason the XOF functions set the
  993|       |     * md_size to 0, since the output size is unknown.
  994|       |     */
  995|     27|    params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_BLOCK_SIZE, &blksz);
  ------------------
  |  |  220|     27|# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
  ------------------
  996|     27|    params[1] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &mdsize);
  ------------------
  |  |  223|     27|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  997|     27|    params[2] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_XOF, &xof);
  ------------------
  |  |  225|     27|# define OSSL_DIGEST_PARAM_XOF "xof"
  ------------------
  998|     27|    params[3] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_ALGID_ABSENT,
  ------------------
  |  |  219|     27|# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
  ------------------
  999|     27|                                         &algid_absent);
 1000|     27|    params[4] = OSSL_PARAM_construct_end();
 1001|     27|    ok = evp_do_md_getparams(md, params) > 0;
 1002|     27|    if (mdsize > INT_MAX || blksz > INT_MAX)
  ------------------
  |  Branch (1002:9): [True: 0, False: 27]
  |  Branch (1002:29): [True: 0, False: 27]
  ------------------
 1003|      0|        ok = 0;
 1004|     27|    if (ok) {
  ------------------
  |  Branch (1004:9): [True: 27, False: 0]
  ------------------
 1005|     27|        md->block_size = (int)blksz;
 1006|     27|        md->md_size = (int)mdsize;
 1007|     27|        if (xof)
  ------------------
  |  Branch (1007:13): [True: 4, False: 23]
  ------------------
 1008|      4|            md->flags |= EVP_MD_FLAG_XOF;
  ------------------
  |  |  184|      4|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
 1009|     27|        if (algid_absent)
  ------------------
  |  Branch (1009:13): [True: 18, False: 9]
  ------------------
 1010|     18|            md->flags |= EVP_MD_FLAG_DIGALGID_ABSENT;
  ------------------
  |  |  196|     18|#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008
  ------------------
 1011|     27|    }
 1012|     27|    return ok;
 1013|     27|}
digest.c:evp_md_up_ref:
 1153|  1.13k|{
 1154|  1.13k|    return EVP_MD_up_ref(md);
 1155|  1.13k|}
digest.c:evp_md_free:
 1158|     57|{
 1159|     57|    EVP_MD_free(md);
 1160|     57|}

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

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

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

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

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

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

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

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

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

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

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

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

EVP_CIPHER_CTX_reset:
   34|      9|{
   35|      9|    if (ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 9]
  ------------------
   36|      0|        return 1;
   37|       |
   38|      9|    if (ctx->cipher == NULL || ctx->cipher->prov == NULL)
  ------------------
  |  Branch (38:9): [True: 0, False: 9]
  |  Branch (38:32): [True: 0, False: 9]
  ------------------
   39|      0|        goto legacy;
   40|       |
   41|      9|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (41:9): [True: 9, False: 0]
  ------------------
   42|      9|        if (ctx->cipher->freectx != NULL)
  ------------------
  |  Branch (42:13): [True: 9, False: 0]
  ------------------
   43|      9|            ctx->cipher->freectx(ctx->algctx);
   44|      9|        ctx->algctx = NULL;
   45|      9|    }
   46|      9|    if (ctx->fetched_cipher != NULL)
  ------------------
  |  Branch (46:9): [True: 9, False: 0]
  ------------------
   47|      9|        EVP_CIPHER_free(ctx->fetched_cipher);
   48|      9|    memset(ctx, 0, sizeof(*ctx));
   49|      9|    ctx->iv_len = -1;
   50|       |
   51|      9|    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|      9|{
   74|      9|    EVP_CIPHER_CTX *ctx;
   75|       |
   76|      9|    ctx = OPENSSL_zalloc(sizeof(EVP_CIPHER_CTX));
  ------------------
  |  |  104|      9|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      9|    if (ctx == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 9]
  ------------------
   78|      0|        return NULL;
   79|       |
   80|      9|    ctx->iv_len = -1;
   81|      9|    return ctx;
   82|      9|}
EVP_CIPHER_CTX_free:
   85|      9|{
   86|      9|    if (ctx == NULL)
  ------------------
  |  Branch (86:9): [True: 0, False: 9]
  ------------------
   87|      0|        return;
   88|      9|    EVP_CIPHER_CTX_reset(ctx);
   89|      9|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      9|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   90|      9|}
EVP_CipherInit_ex:
  652|  4.01k|{
  653|  4.01k|    return evp_cipher_init_internal(ctx, cipher, impl, key, iv, enc, 0, NULL);
  654|  4.01k|}
EVP_CipherUpdate:
  718|  2.72k|{
  719|  2.72k|    if (ctx->encrypt)
  ------------------
  |  Branch (719:9): [True: 2.72k, False: 0]
  ------------------
  720|  2.72k|        return EVP_EncryptUpdate(ctx, out, outl, in, inl);
  721|      0|    else
  722|      0|        return EVP_DecryptUpdate(ctx, out, outl, in, inl);
  723|  2.72k|}
EVP_EncryptUpdate:
  979|  2.72k|{
  980|  2.72k|    int ret;
  981|  2.72k|    size_t soutl, inl_ = (size_t)inl;
  982|  2.72k|    int blocksize;
  983|       |
  984|  2.72k|    if (ossl_likely(outl != NULL)) {
  ------------------
  |  |   22|  2.72k|#  define ossl_likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:30): [True: 2.72k, False: 0]
  |  |  ------------------
  ------------------
  985|  2.72k|        *outl = 0;
  986|  2.72k|    } 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|  2.72k|    if (ossl_unlikely(!ctx->encrypt)) {
  ------------------
  |  |   23|  2.72k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 2.72k]
  |  |  ------------------
  ------------------
  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|  2.72k|    if (ossl_unlikely(ctx->cipher == NULL)) {
  ------------------
  |  |   23|  2.72k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 2.72k]
  |  |  ------------------
  ------------------
  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|  2.72k|    if (ossl_unlikely(ctx->cipher->prov == NULL))
  ------------------
  |  |   23|  2.72k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 2.72k]
  |  |  ------------------
  ------------------
 1003|      0|        goto legacy;
 1004|       |
 1005|  2.72k|    blocksize = ctx->cipher->block_size;
 1006|       |
 1007|  2.72k|    if (ossl_unlikely(ctx->cipher->cupdate == NULL || blocksize < 1)) {
  ------------------
  |  |   23|  5.45k|#  define ossl_unlikely(x)   __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (23:30): [True: 0, False: 2.72k]
  |  |  |  Branch (23:50): [True: 0, False: 2.72k]
  |  |  |  Branch (23:50): [True: 0, False: 2.72k]
  |  |  ------------------
  ------------------
 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|  2.72k|    ret = ctx->cipher->cupdate(ctx->algctx, out, &soutl,
 1013|  2.72k|                               inl_ + (size_t)(blocksize == 1 ? 0 : blocksize),
  ------------------
  |  Branch (1013:48): [True: 1.32k, False: 1.40k]
  ------------------
 1014|  2.72k|                               in, inl_);
 1015|       |
 1016|  2.72k|    if (ossl_likely(ret)) {
  ------------------
  |  |   22|  2.72k|#  define ossl_likely(x)     __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (22:30): [True: 2.72k, False: 0]
  |  |  ------------------
  ------------------
 1017|  2.72k|        if (soutl > INT_MAX) {
  ------------------
  |  Branch (1017:13): [True: 0, False: 2.72k]
  ------------------
 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|  2.72k|        *outl = soutl;
 1022|  2.72k|    }
 1023|       |
 1024|  2.72k|    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|  2.72k|}
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_from_prov:
 2085|      6|{
 2086|      6|    return evp_generic_fetch_from_prov(prov, OSSL_OP_CIPHER,
  ------------------
  |  |  311|      6|# define OSSL_OP_CIPHER                              2   /* Symmetric Ciphers */
  ------------------
 2087|      6|                                       algorithm, properties,
 2088|      6|                                       evp_cipher_from_algorithm,
 2089|      6|                                       evp_cipher_up_ref,
 2090|      6|                                       evp_cipher_free);
 2091|      6|}
EVP_CIPHER_up_ref:
 2103|    147|{
 2104|    147|    int ref = 0;
 2105|       |
 2106|    147|    if (cipher->origin == EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|    147|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (2106:9): [True: 147, False: 0]
  ------------------
 2107|    147|        CRYPTO_UP_REF(&cipher->refcnt, &ref);
 2108|    147|    return 1;
 2109|    147|}
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|    292|{
 2121|    292|    int i;
 2122|       |
 2123|    292|    if (cipher == NULL || cipher->origin != EVP_ORIG_DYNAMIC)
  ------------------
  |  |  252|    277|#define EVP_ORIG_DYNAMIC    0
  ------------------
  |  Branch (2123:9): [True: 15, False: 277]
  |  Branch (2123:27): [True: 0, False: 277]
  ------------------
 2124|     15|        return;
 2125|       |
 2126|    277|    CRYPTO_DOWN_REF(&cipher->refcnt, &i);
 2127|    277|    if (i > 0)
  ------------------
  |  Branch (2127:9): [True: 147, False: 130]
  ------------------
 2128|    147|        return;
 2129|    130|    evp_cipher_free_int(cipher);
 2130|    130|}
evp_enc.c:evp_cipher_init_internal:
   98|  4.01k|{
   99|  4.01k|    int n;
  100|  4.01k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  101|  4.01k|    ENGINE *tmpimpl = NULL;
  102|  4.01k|#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|  4.01k|    if (enc == -1) {
  ------------------
  |  Branch (109:9): [True: 4.00k, False: 9]
  ------------------
  110|  4.00k|        enc = ctx->encrypt;
  111|  4.00k|    } else {
  112|      9|        if (enc)
  ------------------
  |  Branch (112:13): [True: 9, False: 0]
  ------------------
  113|      9|            enc = 1;
  114|      9|        ctx->encrypt = enc;
  115|      9|    }
  116|       |
  117|  4.01k|    if (cipher == NULL && ctx->cipher == NULL) {
  ------------------
  |  Branch (117:9): [True: 4.00k, False: 9]
  |  Branch (117:27): [True: 0, False: 4.00k]
  ------------------
  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|  4.01k|    if (is_pipeline)
  ------------------
  |  Branch (123:9): [True: 0, False: 4.01k]
  ------------------
  124|      0|        goto nonlegacy;
  125|       |
  126|  4.01k|#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|  4.01k|    if (ctx->engine && ctx->cipher
  ------------------
  |  Branch (133:9): [True: 0, False: 4.01k]
  |  Branch (133:24): [True: 0, False: 0]
  ------------------
  134|  4.01k|        && (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|  4.01k|    if (cipher != NULL && impl == NULL) {
  ------------------
  |  Branch (137:9): [True: 9, False: 4.00k]
  |  Branch (137:27): [True: 9, False: 0]
  ------------------
  138|       |         /* Ask if an ENGINE is reserved for this job */
  139|      9|        tmpimpl = ENGINE_get_cipher_engine(cipher->nid);
  140|      9|    }
  141|  4.01k|#endif
  142|       |
  143|       |    /*
  144|       |     * If there are engines involved then we should use legacy handling for now.
  145|       |     */
  146|  4.01k|    if (ctx->engine != NULL
  ------------------
  |  Branch (146:9): [True: 0, False: 4.01k]
  ------------------
  147|  4.01k|#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
  148|  4.01k|            || tmpimpl != NULL
  ------------------
  |  Branch (148:16): [True: 0, False: 4.01k]
  ------------------
  149|  4.01k|#endif
  150|  4.01k|            || impl != NULL
  ------------------
  |  Branch (150:16): [True: 0, False: 4.01k]
  ------------------
  151|  4.01k|            || (cipher != NULL && cipher->origin == EVP_ORIG_METH)
  ------------------
  |  |  254|      9|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (151:17): [True: 9, False: 4.00k]
  |  Branch (151:35): [True: 0, False: 9]
  ------------------
  152|  4.01k|            || (cipher == NULL && ctx->cipher != NULL
  ------------------
  |  Branch (152:17): [True: 4.00k, False: 9]
  |  Branch (152:35): [True: 4.00k, False: 0]
  ------------------
  153|  4.01k|                               && ctx->cipher->origin == EVP_ORIG_METH)) {
  ------------------
  |  |  254|  4.00k|#define EVP_ORIG_METH       2
  ------------------
  |  Branch (153:35): [True: 0, False: 4.00k]
  ------------------
  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|  4.01k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (164:9): [True: 9, False: 4.00k]
  |  Branch (164:27): [True: 0, False: 9]
  ------------------
  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|  4.01k|nonlegacy:
  173|       |    /* Ensure a context left lying around from last time is cleared */
  174|  4.01k|    if (cipher != NULL && ctx->cipher != NULL) {
  ------------------
  |  Branch (174:9): [True: 9, False: 4.00k]
  |  Branch (174:27): [True: 0, False: 9]
  ------------------
  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|  4.01k|    if (cipher == NULL)
  ------------------
  |  Branch (183:9): [True: 4.00k, False: 9]
  ------------------
  184|  4.00k|        cipher = ctx->cipher;
  185|       |
  186|  4.01k|    if (cipher->prov == NULL) {
  ------------------
  |  Branch (186:9): [True: 0, False: 4.01k]
  ------------------
  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|  4.01k|    if (!ossl_assert(cipher->prov != NULL)) {
  ------------------
  |  |   52|  4.01k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  4.01k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (206:9): [True: 0, False: 4.01k]
  ------------------
  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|  4.01k|    if (cipher != ctx->fetched_cipher) {
  ------------------
  |  Branch (211:9): [True: 9, False: 4.00k]
  ------------------
  212|      9|        if (!EVP_CIPHER_up_ref((EVP_CIPHER *)cipher)) {
  ------------------
  |  Branch (212:13): [True: 0, False: 9]
  ------------------
  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|      9|        EVP_CIPHER_free(ctx->fetched_cipher);
  217|       |        /* Coverity false positive, the reference counting is confusing it */
  218|       |        /* coverity[use_after_free] */
  219|      9|        ctx->fetched_cipher = (EVP_CIPHER *)cipher;
  220|      9|    }
  221|  4.01k|    ctx->cipher = cipher;
  222|       |
  223|  4.01k|    if (is_pipeline && !EVP_CIPHER_can_pipeline(cipher, enc)) {
  ------------------
  |  Branch (223:9): [True: 0, False: 4.01k]
  |  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|  4.01k|    if (ctx->algctx == NULL) {
  ------------------
  |  Branch (228:9): [True: 9, False: 4.00k]
  ------------------
  229|      9|        ctx->algctx = ctx->cipher->newctx(ossl_provider_ctx(cipher->prov));
  230|      9|        if (ctx->algctx == NULL) {
  ------------------
  |  Branch (230:13): [True: 0, False: 9]
  ------------------
  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|      9|    }
  235|       |
  236|  4.01k|    if ((ctx->flags & EVP_CIPH_NO_PADDING) != 0) {
  ------------------
  |  |  346|  4.01k|# define         EVP_CIPH_NO_PADDING             0x100
  ------------------
  |  Branch (236:9): [True: 0, False: 4.01k]
  ------------------
  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|  4.01k|#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|  4.01k|    if (params != NULL) {
  ------------------
  |  Branch (254:9): [True: 0, False: 4.01k]
  ------------------
  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|  4.01k|#endif
  280|       |
  281|  4.01k|    if (is_pipeline)
  ------------------
  |  Branch (281:9): [True: 0, False: 4.01k]
  ------------------
  282|      0|        return 1;
  283|       |
  284|  4.01k|    if (enc) {
  ------------------
  |  Branch (284:9): [True: 4.01k, False: 0]
  ------------------
  285|  4.01k|        if (ctx->cipher->einit == NULL) {
  ------------------
  |  Branch (285:13): [True: 0, False: 4.01k]
  ------------------
  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|  4.01k|        return ctx->cipher->einit(ctx->algctx,
  302|  4.01k|                                  key,
  303|  4.01k|                                  key == NULL ? 0
  ------------------
  |  Branch (303:35): [True: 1.33k, False: 2.68k]
  ------------------
  304|  4.01k|                                              : EVP_CIPHER_CTX_get_key_length(ctx),
  305|  4.01k|                                  iv,
  306|  4.01k|                                  iv == NULL ? 0
  ------------------
  |  Branch (306:35): [True: 2.68k, False: 1.32k]
  ------------------
  307|  4.01k|                                             : EVP_CIPHER_CTX_get_iv_length(ctx),
  308|  4.01k|                                  params);
  309|  4.01k|    }
  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|    138|{
 2063|    138|    return EVP_CIPHER_up_ref(cipher);
 2064|    138|}
evp_enc.c:evp_cipher_free:
 2067|    262|{
 2068|    262|    EVP_CIPHER_free(cipher);
 2069|    262|}

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

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

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_get_iv_length:
  491|      3|{
  492|      3|    return (cipher == NULL) ? 0 : cipher->iv_len;
  ------------------
  |  Branch (492:12): [True: 0, False: 3]
  ------------------
  493|      3|}
EVP_CIPHER_CTX_get_iv_length:
  496|  1.32k|{
  497|  1.32k|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (497:9): [True: 0, False: 1.32k]
  ------------------
  498|      0|        return 0;
  499|       |
  500|  1.32k|    if (ctx->iv_len < 0) {
  ------------------
  |  Branch (500:9): [True: 3, False: 1.32k]
  ------------------
  501|      3|        int rv, len = EVP_CIPHER_get_iv_length(ctx->cipher);
  502|      3|        size_t v = len;
  503|      3|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      3|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      3|    { NULL, 0, NULL, 0, 0 }
  ------------------
  504|       |
  505|      3|        if (ctx->cipher->get_ctx_params != NULL) {
  ------------------
  |  Branch (505:13): [True: 3, False: 0]
  ------------------
  506|      3|            params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN,
  ------------------
  |  |  193|      3|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  507|      3|                                                    &v);
  508|      3|            rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  509|      3|            if (rv > 0) {
  ------------------
  |  Branch (509:17): [True: 3, False: 0]
  ------------------
  510|      3|                if (OSSL_PARAM_modified(params)
  ------------------
  |  Branch (510:21): [True: 3, False: 0]
  ------------------
  511|      3|                        && !OSSL_PARAM_get_int(params, &len))
  ------------------
  |  Branch (511:28): [True: 0, False: 3]
  ------------------
  512|      0|                    return -1;
  513|      3|            } else if (rv != EVP_CTRL_RET_UNSUPPORTED) {
  ------------------
  |  |   13|      0|#define EVP_CTRL_RET_UNSUPPORTED -1
  ------------------
  |  Branch (513:24): [True: 0, False: 0]
  ------------------
  514|      0|                return -1;
  515|      0|            }
  516|      3|        }
  517|       |        /* Code below to be removed when legacy support is dropped. */
  518|      0|        else if ((EVP_CIPHER_get_flags(ctx->cipher)
  ------------------
  |  Branch (518:18): [True: 0, False: 0]
  ------------------
  519|      0|                  & EVP_CIPH_CUSTOM_IV_LENGTH) != 0) {
  ------------------
  |  |  352|      0|# define         EVP_CIPH_CUSTOM_IV_LENGTH       0x800
  ------------------
  520|      0|            rv = EVP_CIPHER_CTX_ctrl((EVP_CIPHER_CTX *)ctx, EVP_CTRL_GET_IVLEN,
  ------------------
  |  |  453|      0|# define         EVP_CTRL_GET_IVLEN                      0x25
  ------------------
  521|      0|                                     0, &len);
  522|      0|            if (rv <= 0)
  ------------------
  |  Branch (522:17): [True: 0, False: 0]
  ------------------
  523|      0|                return -1;
  524|      0|        }
  525|       |        /*-
  526|       |         * Casting away the const is annoying but required here.  We need to
  527|       |         * cache the result for performance reasons.
  528|       |         */
  529|      3|        ((EVP_CIPHER_CTX *)ctx)->iv_len = len;
  530|      3|    }
  531|  1.32k|    return ctx->iv_len;
  532|  1.32k|}
EVP_CIPHER_get_key_length:
  642|      3|{
  643|      3|    return cipher->key_len;
  644|      3|}
EVP_CIPHER_CTX_get_key_length:
  647|  2.68k|{
  648|  2.68k|    if (ctx->cipher == NULL)
  ------------------
  |  Branch (648:9): [True: 0, False: 2.68k]
  ------------------
  649|      0|        return 0;
  650|       |
  651|  2.68k|    if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) {
  ------------------
  |  Branch (651:9): [True: 9, False: 2.67k]
  |  Branch (651:30): [True: 9, False: 0]
  ------------------
  652|      9|        int ok;
  653|      9|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      9|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      9|    { NULL, 0, NULL, 0, 0 }
  ------------------
  654|      9|        size_t len;
  655|       |
  656|      9|        params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_KEYLEN, &len);
  ------------------
  |  |  194|      9|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  657|      9|        ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
  658|      9|        if (ok <= 0)
  ------------------
  |  Branch (658:13): [True: 0, False: 9]
  ------------------
  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|      9|        if (!OSSL_PARAM_get_int(params, &((EVP_CIPHER_CTX *)ctx)->key_len))
  ------------------
  |  Branch (668:13): [True: 0, False: 9]
  ------------------
  669|      0|            return -1;
  670|      9|        ((EVP_CIPHER_CTX *)ctx)->key_len = (int)len;
  671|      9|    }
  672|  2.68k|    return ctx->key_len;
  673|  2.68k|}
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_get0_name:
  767|    201|{
  768|    201|    if (md == NULL)
  ------------------
  |  Branch (768:9): [True: 0, False: 201]
  ------------------
  769|      0|        return NULL;
  770|    201|    if (md->type_name != NULL)
  ------------------
  |  Branch (770:9): [True: 201, False: 0]
  ------------------
  771|    201|        return md->type_name;
  772|      0|#ifndef FIPS_MODULE
  773|      0|    return OBJ_nid2sn(EVP_MD_nid(md));
  ------------------
  |  |  559|      0|# define EVP_MD_nid EVP_MD_get_type
  ------------------
  774|       |#else
  775|       |    return NULL;
  776|       |#endif
  777|    201|}
EVP_MD_get_type:
  795|     82|{
  796|     82|    return md->type;
  797|     82|}
EVP_MD_get_block_size:
  805|    603|{
  806|    603|    if (md == NULL) {
  ------------------
  |  Branch (806:9): [True: 0, False: 603]
  ------------------
  807|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  808|      0|        return -1;
  809|      0|    }
  810|    603|    return md->block_size;
  811|    603|}
EVP_MD_get_size:
  814|   242M|{
  815|   242M|    if (md == NULL) {
  ------------------
  |  Branch (815:9): [True: 0, False: 242M]
  ------------------
  816|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  817|      0|        return -1;
  818|      0|    }
  819|   242M|    return md->md_size;
  820|   242M|}
EVP_MD_xof:
  823|    201|{
  824|    201|    return md != NULL && ((EVP_MD_get_flags(md) & EVP_MD_FLAG_XOF) != 0);
  ------------------
  |  |  184|    201|#  define EVP_MD_FLAG_XOF         0x0002
  ------------------
  |  Branch (824:12): [True: 201, False: 0]
  |  Branch (824:26): [True: 0, False: 201]
  ------------------
  825|    201|}
EVP_MD_get_flags:
  828|    201|{
  829|    201|    return md->flags;
  830|    201|}
evp_md_free_int:
  866|     27|{
  867|     27|    OPENSSL_free(md->type_name);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  868|     27|    ossl_provider_free(md->prov);
  869|     27|    CRYPTO_FREE_REF(&md->refcnt);
  870|     27|    OPENSSL_free(md);
  ------------------
  |  |  115|     27|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     27|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     27|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  871|     27|}
EVP_MD_CTX_get0_md:
 1023|   242M|{
 1024|   242M|    if (ctx == NULL)
  ------------------
  |  Branch (1024:9): [True: 0, False: 242M]
  ------------------
 1025|      0|        return NULL;
 1026|   242M|    return ctx->reqdigest;
 1027|   242M|}
EVP_MD_CTX_get_size_ex:
 1042|   242M|{
 1043|   242M|    EVP_MD_CTX *c = (EVP_MD_CTX *)ctx;
 1044|   242M|    const OSSL_PARAM *gettables;
 1045|       |
 1046|   242M|    gettables = EVP_MD_CTX_gettable_params(c);
 1047|   242M|    if (gettables != NULL
  ------------------
  |  Branch (1047:9): [True: 0, False: 242M]
  ------------------
 1048|   242M|            && OSSL_PARAM_locate_const(gettables,
  ------------------
  |  Branch (1048:16): [True: 0, False: 0]
  ------------------
 1049|      0|                                       OSSL_DIGEST_PARAM_SIZE) != NULL) {
  ------------------
  |  |  223|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
 1050|      0|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      0|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1051|      0|        size_t sz = 0;
 1052|       |
 1053|       |        /*
 1054|       |         * For XOF's EVP_MD_get_size() returns 0
 1055|       |         * So try to get the xoflen instead. This will return -1 if the
 1056|       |         * xof length has not been set.
 1057|       |         */
 1058|      0|        params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_SIZE, &sz);
  ------------------
  |  |  223|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
 1059|      0|        if (EVP_MD_CTX_get_params(c, params) != 1
  ------------------
  |  Branch (1059:13): [True: 0, False: 0]
  ------------------
 1060|      0|                || sz == SIZE_MAX
  ------------------
  |  Branch (1060:20): [True: 0, False: 0]
  ------------------
 1061|      0|                || sz == 0)
  ------------------
  |  Branch (1061:20): [True: 0, False: 0]
  ------------------
 1062|      0|            return -1;
 1063|      0|        return sz;
 1064|      0|    }
 1065|       |    /* Normal digests have a constant fixed size output */
 1066|   242M|    return EVP_MD_get_size(EVP_MD_CTX_get0_md(ctx));
 1067|   242M|}
EVP_MD_CTX_set_flags:
 1114|  2.57k|{
 1115|  2.57k|    ctx->flags |= flags;
 1116|  2.57k|}
EVP_MD_CTX_clear_flags:
 1119|   403M|{
 1120|   403M|    ctx->flags &= ~flags;
 1121|   403M|}
EVP_MD_CTX_test_flags:
 1124|  6.60k|{
 1125|  6.60k|    return (ctx->flags & flags);
 1126|  6.60k|}

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

EVP_RAND_enable_locking:
   95|      1|{
   96|      1|    if (rand->meth->enable_locking != NULL)
  ------------------
  |  Branch (96:9): [True: 1, False: 0]
  ------------------
   97|      1|        return rand->meth->enable_locking(rand->algctx);
   98|      1|    ERR_raise(ERR_LIB_EVP, EVP_R_LOCKING_NOT_SUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   99|      0|    return 0;
  100|      1|}
EVP_RAND_fetch:
  287|      4|{
  288|      4|    return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties,
  ------------------
  |  |  314|      4|# define OSSL_OP_RAND                                5
  ------------------
  289|      4|                             evp_rand_from_algorithm, evp_rand_up_ref,
  290|      4|                             evp_rand_free);
  291|      4|}
EVP_RAND_up_ref:
  294|      4|{
  295|      4|    return evp_rand_up_ref(rand);
  296|      4|}
EVP_RAND_free:
  299|      8|{
  300|      8|    evp_rand_free(rand);
  301|      8|}
EVP_RAND_get0_provider:
  324|      6|{
  325|      6|    return rand->prov;
  326|      6|}
EVP_RAND_CTX_up_ref:
  336|      3|{
  337|      3|    int ref = 0;
  338|       |
  339|      3|    return CRYPTO_UP_REF(&ctx->refcnt, &ref);
  340|      3|}
EVP_RAND_CTX_new:
  343|      4|{
  344|      4|    EVP_RAND_CTX *ctx;
  345|      4|    void *parent_ctx = NULL;
  346|      4|    const OSSL_DISPATCH *parent_dispatch = NULL;
  347|       |
  348|      4|    if (rand == NULL) {
  ------------------
  |  Branch (348:9): [True: 0, False: 4]
  ------------------
  349|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  350|      0|        return NULL;
  351|      0|    }
  352|       |
  353|      4|    ctx = OPENSSL_zalloc(sizeof(*ctx));
  ------------------
  |  |  104|      4|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  354|      4|    if (ctx == NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 4]
  ------------------
  355|      0|        return NULL;
  356|      4|    if (!CRYPTO_NEW_REF(&ctx->refcnt, 1)) {
  ------------------
  |  Branch (356:9): [True: 0, False: 4]
  ------------------
  357|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  358|      0|        return NULL;
  359|      0|    }
  360|      4|    if (parent != NULL) {
  ------------------
  |  Branch (360:9): [True: 3, False: 1]
  ------------------
  361|      3|        if (!EVP_RAND_CTX_up_ref(parent)) {
  ------------------
  |  Branch (361:13): [True: 0, False: 3]
  ------------------
  362|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  363|      0|            CRYPTO_FREE_REF(&ctx->refcnt);
  364|      0|            OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  365|      0|            return NULL;
  366|      0|        }
  367|      3|        parent_ctx = parent->algctx;
  368|      3|        parent_dispatch = parent->meth->dispatch;
  369|      3|    }
  370|      4|    if ((ctx->algctx = rand->newctx(ossl_provider_ctx(rand->prov), parent_ctx,
  ------------------
  |  Branch (370:9): [True: 0, False: 4]
  ------------------
  371|      4|                                    parent_dispatch)) == NULL
  372|      4|            || !EVP_RAND_up_ref(rand)) {
  ------------------
  |  Branch (372:16): [True: 0, False: 4]
  ------------------
  373|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  374|      0|        rand->freectx(ctx->algctx);
  375|      0|        CRYPTO_FREE_REF(&ctx->refcnt);
  376|      0|        OPENSSL_free(ctx);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  377|      0|        EVP_RAND_CTX_free(parent);
  378|      0|        return NULL;
  379|      0|    }
  380|      4|    ctx->meth = rand;
  381|      4|    ctx->parent = parent;
  382|      4|    return ctx;
  383|      4|}
EVP_RAND_CTX_free:
  386|      8|{
  387|      8|    int ref = 0;
  388|      8|    EVP_RAND_CTX *parent;
  389|       |
  390|      8|    if (ctx == NULL)
  ------------------
  |  Branch (390:9): [True: 1, False: 7]
  ------------------
  391|      1|        return;
  392|       |
  393|      7|    CRYPTO_DOWN_REF(&ctx->refcnt, &ref);
  394|      7|    if (ref > 0)
  ------------------
  |  Branch (394:9): [True: 3, False: 4]
  ------------------
  395|      3|        return;
  396|      4|    parent = ctx->parent;
  397|      4|    ctx->meth->freectx(ctx->algctx);
  398|      4|    ctx->algctx = NULL;
  399|      4|    EVP_RAND_free(ctx->meth);
  400|      4|    CRYPTO_FREE_REF(&ctx->refcnt);
  401|      4|    OPENSSL_free(ctx);
  ------------------
  |  |  115|      4|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  402|      4|    EVP_RAND_CTX_free(parent);
  403|      4|}
EVP_RAND_CTX_settable_params:
  484|      3|{
  485|      3|    void *provctx;
  486|       |
  487|      3|    if (ctx->meth->settable_ctx_params == NULL)
  ------------------
  |  Branch (487:9): [True: 0, False: 3]
  ------------------
  488|      0|        return NULL;
  489|      3|    provctx = ossl_provider_ctx(EVP_RAND_get0_provider(ctx->meth));
  490|      3|    return ctx->meth->settable_ctx_params(ctx->algctx, provctx);
  491|      3|}
EVP_RAND_instantiate:
  525|      4|{
  526|      4|    int res;
  527|       |
  528|      4|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (528:9): [True: 0, False: 4]
  ------------------
  529|      0|        return 0;
  530|      4|    res = evp_rand_instantiate_locked(ctx, strength, prediction_resistance,
  531|      4|                                      pstr, pstr_len, params);
  532|      4|    evp_rand_unlock(ctx);
  533|      4|    return res;
  534|      4|}
EVP_RAND_generate:
  587|  1.32k|{
  588|  1.32k|    int res;
  589|       |
  590|  1.32k|    if (!evp_rand_lock(ctx))
  ------------------
  |  Branch (590:9): [True: 0, False: 1.32k]
  ------------------
  591|      0|        return 0;
  592|  1.32k|    res = evp_rand_generate_locked(ctx, out, outlen, strength,
  593|  1.32k|                                   prediction_resistance, addin, addin_len);
  594|  1.32k|    evp_rand_unlock(ctx);
  595|  1.32k|    return res;
  596|  1.32k|}
evp_rand.c:evp_rand_from_algorithm:
  120|      5|{
  121|      5|    const OSSL_DISPATCH *fns = algodef->implementation;
  122|      5|    EVP_RAND *rand = NULL;
  123|      5|    int fnrandcnt = 0, fnctxcnt = 0, fnlockcnt = 0, fnenablelockcnt = 0;
  124|       |#ifdef FIPS_MODULE
  125|       |    int fnzeroizecnt = 0;
  126|       |#endif
  127|       |
  128|      5|    if ((rand = evp_rand_new()) == NULL) {
  ------------------
  |  Branch (128:9): [True: 0, False: 5]
  ------------------
  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|      5|    rand->name_id = name_id;
  133|      5|    if ((rand->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 5]
  ------------------
  134|      0|        evp_rand_free(rand);
  135|      0|        return NULL;
  136|      0|    }
  137|      5|    rand->description = algodef->algorithm_description;
  138|      5|    rand->dispatch = fns;
  139|     83|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (139:12): [True: 78, False: 5]
  ------------------
  140|     78|        switch (fns->function_id) {
  ------------------
  |  Branch (140:17): [True: 0, False: 78]
  ------------------
  141|      5|        case OSSL_FUNC_RAND_NEWCTX:
  ------------------
  |  |  535|      5|# define OSSL_FUNC_RAND_NEWCTX                        1
  ------------------
  |  Branch (141:9): [True: 5, False: 73]
  ------------------
  142|      5|            if (rand->newctx != NULL)
  ------------------
  |  Branch (142:17): [True: 0, False: 5]
  ------------------
  143|      0|                break;
  144|      5|            rand->newctx = OSSL_FUNC_rand_newctx(fns);
  145|      5|            fnctxcnt++;
  146|      5|            break;
  147|      5|        case OSSL_FUNC_RAND_FREECTX:
  ------------------
  |  |  536|      5|# define OSSL_FUNC_RAND_FREECTX                       2
  ------------------
  |  Branch (147:9): [True: 5, False: 73]
  ------------------
  148|      5|            if (rand->freectx != NULL)
  ------------------
  |  Branch (148:17): [True: 0, False: 5]
  ------------------
  149|      0|                break;
  150|      5|            rand->freectx = OSSL_FUNC_rand_freectx(fns);
  151|      5|            fnctxcnt++;
  152|      5|            break;
  153|      5|        case OSSL_FUNC_RAND_INSTANTIATE:
  ------------------
  |  |  537|      5|# define OSSL_FUNC_RAND_INSTANTIATE                   3
  ------------------
  |  Branch (153:9): [True: 5, False: 73]
  ------------------
  154|      5|            if (rand->instantiate != NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 5]
  ------------------
  155|      0|                break;
  156|      5|            rand->instantiate = OSSL_FUNC_rand_instantiate(fns);
  157|      5|            fnrandcnt++;
  158|      5|            break;
  159|      5|        case OSSL_FUNC_RAND_UNINSTANTIATE:
  ------------------
  |  |  538|      5|# define OSSL_FUNC_RAND_UNINSTANTIATE                 4
  ------------------
  |  Branch (159:9): [True: 5, False: 73]
  ------------------
  160|      5|             if (rand->uninstantiate != NULL)
  ------------------
  |  Branch (160:18): [True: 0, False: 5]
  ------------------
  161|      0|                break;
  162|      5|            rand->uninstantiate = OSSL_FUNC_rand_uninstantiate(fns);
  163|      5|            fnrandcnt++;
  164|      5|            break;
  165|      5|        case OSSL_FUNC_RAND_GENERATE:
  ------------------
  |  |  539|      5|# define OSSL_FUNC_RAND_GENERATE                      5
  ------------------
  |  Branch (165:9): [True: 5, False: 73]
  ------------------
  166|      5|            if (rand->generate != NULL)
  ------------------
  |  Branch (166:17): [True: 0, False: 5]
  ------------------
  167|      0|                break;
  168|      5|            rand->generate = OSSL_FUNC_rand_generate(fns);
  169|      5|            fnrandcnt++;
  170|      5|            break;
  171|      5|        case OSSL_FUNC_RAND_RESEED:
  ------------------
  |  |  540|      5|# define OSSL_FUNC_RAND_RESEED                        6
  ------------------
  |  Branch (171:9): [True: 5, False: 73]
  ------------------
  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: 77]
  ------------------
  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|      5|        case OSSL_FUNC_RAND_ENABLE_LOCKING:
  ------------------
  |  |  542|      5|# define OSSL_FUNC_RAND_ENABLE_LOCKING                8
  ------------------
  |  Branch (181:9): [True: 5, False: 73]
  ------------------
  182|      5|            if (rand->enable_locking != NULL)
  ------------------
  |  Branch (182:17): [True: 0, False: 5]
  ------------------
  183|      0|                break;
  184|      5|            rand->enable_locking = OSSL_FUNC_rand_enable_locking(fns);
  185|      5|            fnenablelockcnt++;
  186|      5|            break;
  187|      5|        case OSSL_FUNC_RAND_LOCK:
  ------------------
  |  |  543|      5|# define OSSL_FUNC_RAND_LOCK                          9
  ------------------
  |  Branch (187:9): [True: 5, False: 73]
  ------------------
  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: 73]
  ------------------
  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: 78]
  ------------------
  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|      5|        case OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  546|      5|# define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS          12
  ------------------
  |  Branch (205:9): [True: 5, False: 73]
  ------------------
  206|      5|            if (rand->gettable_ctx_params != NULL)
  ------------------
  |  Branch (206:17): [True: 0, False: 5]
  ------------------
  207|      0|                break;
  208|      5|            rand->gettable_ctx_params =
  209|      5|                OSSL_FUNC_rand_gettable_ctx_params(fns);
  210|      5|            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: 74]
  ------------------
  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: 78]
  ------------------
  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|      5|        case OSSL_FUNC_RAND_GET_CTX_PARAMS:
  ------------------
  |  |  549|      5|# define OSSL_FUNC_RAND_GET_CTX_PARAMS               15
  ------------------
  |  Branch (222:9): [True: 5, False: 73]
  ------------------
  223|      5|            if (rand->get_ctx_params != NULL)
  ------------------
  |  Branch (223:17): [True: 0, False: 5]
  ------------------
  224|      0|                break;
  225|      5|            rand->get_ctx_params = OSSL_FUNC_rand_get_ctx_params(fns);
  226|      5|            fnctxcnt++;
  227|      5|            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: 74]
  ------------------
  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: 73]
  ------------------
  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: 73]
  ------------------
  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: 74]
  ------------------
  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|     78|        }
  252|     78|    }
  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|      5|    if (fnrandcnt != 3
  ------------------
  |  Branch (262:9): [True: 0, False: 5]
  ------------------
  263|      5|            || fnctxcnt != 3
  ------------------
  |  Branch (263:16): [True: 0, False: 5]
  ------------------
  264|      5|            || (fnenablelockcnt != 0 && fnenablelockcnt != 1)
  ------------------
  |  Branch (264:17): [True: 5, False: 0]
  |  Branch (264:41): [True: 0, False: 5]
  ------------------
  265|      5|            || (fnlockcnt != 0 && fnlockcnt != 2)
  ------------------
  |  Branch (265:17): [True: 5, False: 0]
  |  Branch (265:35): [True: 0, False: 5]
  ------------------
  266|       |#ifdef FIPS_MODULE
  267|       |            || fnzeroizecnt != 1
  268|       |#endif
  269|      5|       ) {
  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|      5|    if (prov != NULL && !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (275:9): [True: 5, False: 0]
  |  Branch (275:25): [True: 0, False: 5]
  ------------------
  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|      5|    rand->prov = prov;
  281|       |
  282|      5|    return rand;
  283|      5|}
evp_rand.c:evp_rand_new:
   80|      5|{
   81|      5|    EVP_RAND *rand = OPENSSL_zalloc(sizeof(*rand));
  ------------------
  |  |  104|      5|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   82|       |
   83|      5|    if (rand == NULL)
  ------------------
  |  Branch (83:9): [True: 0, False: 5]
  ------------------
   84|      0|        return NULL;
   85|       |
   86|      5|    if (!CRYPTO_NEW_REF(&rand->refcnt, 1)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 5]
  ------------------
   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|      5|    return rand;
   91|      5|}
evp_rand.c:evp_rand_up_ref:
   54|     15|{
   55|     15|    EVP_RAND *rand = (EVP_RAND *)vrand;
   56|     15|    int ref = 0;
   57|       |
   58|     15|    if (rand != NULL)
  ------------------
  |  Branch (58:9): [True: 15, False: 0]
  ------------------
   59|     15|        return CRYPTO_UP_REF(&rand->refcnt, &ref);
   60|      0|    return 1;
   61|     15|}
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: 15, False: 5]
  ------------------
   72|     15|        return;
   73|      5|    OPENSSL_free(rand->type_name);
  ------------------
  |  |  115|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   74|      5|    ossl_provider_free(rand->prov);
   75|      5|    CRYPTO_FREE_REF(&rand->refcnt);
   76|      5|    OPENSSL_free(rand);
  ------------------
  |  |  115|      5|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      5|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      5|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|      5|}
evp_rand.c:evp_rand_lock:
  104|  1.32k|{
  105|  1.32k|    if (rand->meth->lock != NULL)
  ------------------
  |  Branch (105:9): [True: 1.32k, False: 0]
  ------------------
  106|  1.32k|        return rand->meth->lock(rand->algctx);
  107|      0|    return 1;
  108|  1.32k|}
evp_rand.c:evp_rand_get_ctx_params_locked:
  412|  1.32k|{
  413|  1.32k|    return ctx->meth->get_ctx_params(ctx->algctx, params);
  414|  1.32k|}
evp_rand.c:evp_rand_unlock:
  112|  1.32k|{
  113|  1.32k|    if (rand->meth->unlock != NULL)
  ------------------
  |  Branch (113:9): [True: 1.32k, False: 0]
  ------------------
  114|  1.32k|        rand->meth->unlock(rand->algctx);
  115|  1.32k|}
evp_rand.c:evp_rand_instantiate_locked:
  516|      4|{
  517|      4|    return ctx->meth->instantiate(ctx->algctx, strength, prediction_resistance,
  518|      4|                                  pstr, pstr_len, params);
  519|      4|}
evp_rand.c:evp_rand_generate_locked:
  557|  1.32k|{
  558|  1.32k|    size_t chunk, max_request = 0;
  559|  1.32k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.32k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.32k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  560|       |
  561|  1.32k|    params[0] = OSSL_PARAM_construct_size_t(OSSL_RAND_PARAM_MAX_REQUEST,
  ------------------
  |  |  532|  1.32k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  562|  1.32k|                                            &max_request);
  563|  1.32k|    if (!evp_rand_get_ctx_params_locked(ctx, params)
  ------------------
  |  Branch (563:9): [True: 0, False: 1.32k]
  ------------------
  564|  1.32k|            || max_request == 0) {
  ------------------
  |  Branch (564:16): [True: 0, False: 1.32k]
  ------------------
  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.64k|    for (; outlen > 0; outlen -= chunk, out += chunk) {
  ------------------
  |  Branch (568:12): [True: 1.32k, False: 1.32k]
  ------------------
  569|  1.32k|        chunk = outlen > max_request ? max_request : outlen;
  ------------------
  |  Branch (569:17): [True: 0, False: 1.32k]
  ------------------
  570|  1.32k|        if (!ctx->meth->generate(ctx->algctx, out, chunk, strength,
  ------------------
  |  Branch (570:13): [True: 0, False: 1.32k]
  ------------------
  571|  1.32k|                                 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.32k|        prediction_resistance = 0;
  580|  1.32k|    }
  581|  1.32k|    return 1;
  582|  1.32k|}

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

evp_keymgmt_util_assign_pkey:
   62|    620|{
   63|    620|    if (pkey == NULL || keymgmt == NULL || keydata == NULL
  ------------------
  |  Branch (63:9): [True: 0, False: 620]
  |  Branch (63:25): [True: 0, False: 620]
  |  Branch (63:44): [True: 0, False: 620]
  ------------------
   64|    620|        || !EVP_PKEY_set_type_by_keymgmt(pkey, keymgmt)) {
  ------------------
  |  Branch (64:12): [True: 0, False: 620]
  ------------------
   65|      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)
  |  |  ------------------
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|    620|    pkey->keydata = keydata;
   69|    620|    evp_keymgmt_util_cache_keyinfo(pkey);
   70|    620|    return 1;
   71|    620|}
evp_keymgmt_util_export:
   89|    126|{
   90|    126|    if (pk == NULL || export_cb == NULL)
  ------------------
  |  Branch (90:9): [True: 0, False: 126]
  |  Branch (90:23): [True: 0, False: 126]
  ------------------
   91|      0|        return 0;
   92|    126|    return evp_keymgmt_export(pk->keymgmt, pk->keydata, selection,
   93|    126|                              export_cb, export_cbarg);
   94|    126|}
evp_keymgmt_util_export_to_provider:
   98|    639|{
   99|    639|    struct evp_keymgmt_util_try_import_data_st import_data;
  100|    639|    OP_CACHE_ELEM *op;
  101|       |
  102|       |    /* Export to where? */
  103|    639|    if (keymgmt == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 639]
  ------------------
  104|      0|        return NULL;
  105|       |
  106|       |    /* If we have an unassigned key, give up */
  107|    639|    if (pk->keydata == NULL)
  ------------------
  |  Branch (107:9): [True: 0, False: 639]
  ------------------
  108|      0|        return NULL;
  109|       |
  110|       |    /*
  111|       |     * If |keymgmt| matches the "origin" |keymgmt|, there is no more to do.
  112|       |     * The "origin" is determined by the |keymgmt| pointers being identical
  113|       |     * or when the provider and the name ID match.  The latter case handles the
  114|       |     * situation where the fetch cache is flushed and a "new" key manager is
  115|       |     * created.
  116|       |     */
  117|    639|    if (pk->keymgmt == keymgmt
  ------------------
  |  Branch (117:9): [True: 639, False: 0]
  ------------------
  118|    639|        || (pk->keymgmt->name_id == keymgmt->name_id
  ------------------
  |  Branch (118:13): [True: 0, False: 0]
  ------------------
  119|      0|            && pk->keymgmt->prov == keymgmt->prov))
  ------------------
  |  Branch (119:16): [True: 0, False: 0]
  ------------------
  120|    639|        return pk->keydata;
  121|       |
  122|      0|    if (!CRYPTO_THREAD_read_lock(pk->lock))
  ------------------
  |  Branch (122:9): [True: 0, False: 0]
  ------------------
  123|      0|        return NULL;
  124|       |    /*
  125|       |     * If the provider native "origin" hasn't changed since last time, we
  126|       |     * try to find our keymgmt in the operation cache.  If it has changed
  127|       |     * and our keymgmt isn't found, we will clear the cache further down.
  128|       |     */
  129|      0|    if (pk->dirty_cnt == pk->dirty_cnt_copy) {
  ------------------
  |  Branch (129:9): [True: 0, False: 0]
  ------------------
  130|       |        /* If this key is already exported to |keymgmt|, no more to do */
  131|      0|        op = evp_keymgmt_util_find_operation_cache(pk, keymgmt, selection);
  132|      0|        if (op != NULL && op->keymgmt != NULL) {
  ------------------
  |  Branch (132:13): [True: 0, False: 0]
  |  Branch (132:27): [True: 0, False: 0]
  ------------------
  133|      0|            void *ret = op->keydata;
  134|       |
  135|      0|            CRYPTO_THREAD_unlock(pk->lock);
  136|      0|            return ret;
  137|      0|        }
  138|      0|    }
  139|      0|    CRYPTO_THREAD_unlock(pk->lock);
  140|       |
  141|       |    /* If the "origin" |keymgmt| doesn't support exporting, give up */
  142|      0|    if (pk->keymgmt->export == NULL)
  ------------------
  |  Branch (142:9): [True: 0, False: 0]
  ------------------
  143|      0|        return NULL;
  144|       |
  145|       |    /*
  146|       |     * Make sure that the type of the keymgmt to export to matches the type
  147|       |     * of the "origin"
  148|       |     */
  149|      0|    if (!ossl_assert(match_type(pk->keymgmt, keymgmt)))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (149:9): [True: 0, False: 0]
  ------------------
  150|      0|        return NULL;
  151|       |
  152|       |    /*
  153|       |     * We look at the already cached provider keys, and import from the
  154|       |     * first that supports it (i.e. use its export function), and export
  155|       |     * the imported data to the new provider.
  156|       |     */
  157|       |
  158|       |    /* Setup for the export callback */
  159|      0|    import_data.keydata = NULL;  /* evp_keymgmt_util_try_import will create it */
  160|      0|    import_data.keymgmt = keymgmt;
  161|      0|    import_data.selection = selection;
  162|       |
  163|       |    /*
  164|       |     * The export function calls the callback (evp_keymgmt_util_try_import),
  165|       |     * which does the import for us.  If successful, we're done.
  166|       |     */
  167|      0|    if (!evp_keymgmt_util_export(pk, selection,
  ------------------
  |  Branch (167:9): [True: 0, False: 0]
  ------------------
  168|      0|                                 &evp_keymgmt_util_try_import, &import_data))
  169|       |        /* If there was an error, bail out */
  170|      0|        return NULL;
  171|       |
  172|      0|    if (!CRYPTO_THREAD_write_lock(pk->lock)) {
  ------------------
  |  Branch (172:9): [True: 0, False: 0]
  ------------------
  173|      0|        evp_keymgmt_freedata(keymgmt, import_data.keydata);
  174|      0|        return NULL;
  175|      0|    }
  176|       |    /* Check to make sure some other thread didn't get there first */
  177|      0|    op = evp_keymgmt_util_find_operation_cache(pk, keymgmt, selection);
  178|      0|    if (op != NULL && op->keydata != NULL) {
  ------------------
  |  Branch (178:9): [True: 0, False: 0]
  |  Branch (178:23): [True: 0, False: 0]
  ------------------
  179|      0|        void *ret = op->keydata;
  180|       |
  181|      0|        CRYPTO_THREAD_unlock(pk->lock);
  182|       |
  183|       |        /*
  184|       |         * Another thread seemms to have already exported this so we abandon
  185|       |         * all the work we just did.
  186|       |         */
  187|      0|        evp_keymgmt_freedata(keymgmt, import_data.keydata);
  188|       |
  189|      0|        return ret;
  190|      0|    }
  191|       |
  192|       |    /*
  193|       |     * If the dirty counter changed since last time, then clear the
  194|       |     * operation cache.  In that case, we know that |i| is zero.
  195|       |     */
  196|      0|    if (pk->dirty_cnt != pk->dirty_cnt_copy)
  ------------------
  |  Branch (196:9): [True: 0, False: 0]
  ------------------
  197|      0|        evp_keymgmt_util_clear_operation_cache(pk);
  198|       |
  199|       |    /* Add the new export to the operation cache */
  200|      0|    if (!evp_keymgmt_util_cache_keydata(pk, keymgmt, import_data.keydata,
  ------------------
  |  Branch (200:9): [True: 0, False: 0]
  ------------------
  201|      0|                                        selection)) {
  202|      0|        CRYPTO_THREAD_unlock(pk->lock);
  203|      0|        evp_keymgmt_freedata(keymgmt, import_data.keydata);
  204|      0|        return NULL;
  205|      0|    }
  206|       |
  207|       |    /* Synchronize the dirty count */
  208|      0|    pk->dirty_cnt_copy = pk->dirty_cnt;
  209|       |
  210|      0|    CRYPTO_THREAD_unlock(pk->lock);
  211|       |
  212|      0|    return import_data.keydata;
  213|      0|}
evp_keymgmt_util_clear_operation_cache:
  223|    639|{
  224|    639|    if (pk != NULL) {
  ------------------
  |  Branch (224:9): [True: 639, False: 0]
  ------------------
  225|    639|        sk_OP_CACHE_ELEM_pop_free(pk->operation_cache, op_cache_free);
  226|    639|        pk->operation_cache = NULL;
  227|    639|    }
  228|       |
  229|    639|    return 1;
  230|    639|}
evp_keymgmt_util_cache_keyinfo:
  290|    620|{
  291|       |    /*
  292|       |     * Cache information about the provider "origin" key.
  293|       |     *
  294|       |     * This services functions like EVP_PKEY_get_size, EVP_PKEY_get_bits, etc
  295|       |     */
  296|    620|    if (pk->keydata != NULL) {
  ------------------
  |  Branch (296:9): [True: 620, False: 0]
  ------------------
  297|    620|        int bits = 0;
  298|    620|        int security_bits = 0;
  299|    620|        int security_category = -1;
  300|    620|        int size = 0;
  301|    620|        OSSL_PARAM params[5];
  302|       |
  303|    620|        params[0] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_BITS, &bits);
  ------------------
  |  |  360|    620|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  304|    620|        params[1] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_BITS,
  ------------------
  |  |  487|    620|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  305|    620|                                             &security_bits);
  306|    620|        params[2] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_SECURITY_CATEGORY,
  ------------------
  |  |  488|    620|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|    620|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  307|    620|                                             &security_category);
  308|    620|        params[3] = OSSL_PARAM_construct_int(OSSL_PKEY_PARAM_MAX_SIZE, &size);
  ------------------
  |  |  416|    620|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  309|    620|        params[4] = OSSL_PARAM_construct_end();
  310|    620|        if (evp_keymgmt_get_params(pk->keymgmt, pk->keydata, params)) {
  ------------------
  |  Branch (310:13): [True: 620, False: 0]
  ------------------
  311|    620|            pk->cache.size = size;
  312|    620|            pk->cache.bits = bits;
  313|    620|            pk->cache.security_bits = security_bits;
  314|    620|            pk->cache.security_category = security_category;
  315|    620|        }
  316|    620|    }
  317|    620|}
evp_keymgmt_util_fromdata:
  321|    150|{
  322|    150|    void *keydata = NULL;
  323|       |
  324|    150|    if ((keydata = evp_keymgmt_newdata(keymgmt)) == NULL
  ------------------
  |  Branch (324:9): [True: 0, False: 150]
  ------------------
  325|    150|        || !evp_keymgmt_import(keymgmt, keydata, selection, params)
  ------------------
  |  Branch (325:12): [True: 19, False: 131]
  ------------------
  326|    150|        || !evp_keymgmt_util_assign_pkey(target, keymgmt, keydata)) {
  ------------------
  |  Branch (326:12): [True: 0, False: 131]
  ------------------
  327|     19|        evp_keymgmt_freedata(keymgmt, keydata);
  328|     19|        keydata = NULL;
  329|     19|    }
  330|    150|    return keydata;
  331|    150|}
evp_keymgmt_util_has:
  334|    378|{
  335|       |    /* Check if key is even assigned */
  336|    378|    if (pk->keymgmt == NULL)
  ------------------
  |  Branch (336:9): [True: 0, False: 378]
  ------------------
  337|      0|        return 0;
  338|       |
  339|    378|    return evp_keymgmt_has(pk->keymgmt, pk->keydata, selection);
  340|    378|}
evp_keymgmt_util_match:
  356|    189|{
  357|    189|    EVP_KEYMGMT *keymgmt1 = NULL, *keymgmt2 = NULL;
  358|    189|    void *keydata1 = NULL, *keydata2 = NULL;
  359|       |
  360|    189|    if (pk1 == NULL || pk2 == NULL) {
  ------------------
  |  Branch (360:9): [True: 0, False: 189]
  |  Branch (360:24): [True: 0, False: 189]
  ------------------
  361|      0|        if (pk1 == NULL && pk2 == NULL)
  ------------------
  |  Branch (361:13): [True: 0, False: 0]
  |  Branch (361:28): [True: 0, False: 0]
  ------------------
  362|      0|            return 1;
  363|      0|        return 0;
  364|      0|    }
  365|       |
  366|    189|    keymgmt1 = pk1->keymgmt;
  367|    189|    keydata1 = pk1->keydata;
  368|    189|    keymgmt2 = pk2->keymgmt;
  369|    189|    keydata2 = pk2->keydata;
  370|       |
  371|    189|    if (keymgmt1 != keymgmt2) {
  ------------------
  |  Branch (371:9): [True: 26, False: 163]
  ------------------
  372|       |        /*
  373|       |         * The condition for a successful cross export is that the
  374|       |         * keydata to be exported is NULL (typed, but otherwise empty
  375|       |         * EVP_PKEY), or that it was possible to export it with
  376|       |         * evp_keymgmt_util_export_to_provider().
  377|       |         *
  378|       |         * We use |ok| to determine if it's ok to cross export one way,
  379|       |         * but also to determine if we should attempt a cross export
  380|       |         * the other way.  There's no point doing it both ways.
  381|       |         */
  382|     26|        int ok = 0;
  383|       |
  384|       |        /* Complex case, where the keymgmt differ */
  385|     26|        if (keymgmt1 != NULL
  ------------------
  |  Branch (385:13): [True: 26, False: 0]
  ------------------
  386|     26|            && keymgmt2 != NULL
  ------------------
  |  Branch (386:16): [True: 26, False: 0]
  ------------------
  387|     26|            && !match_type(keymgmt1, keymgmt2)) {
  ------------------
  |  Branch (387:16): [True: 26, False: 0]
  ------------------
  388|     26|            ERR_raise(ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES);
  ------------------
  |  |  401|     26|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     26|    (ERR_new(),                                                 \
  |  |  |  |  404|     26|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|     26|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|     26|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     26|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     26|     ERR_set_error)
  |  |  ------------------
  ------------------
  389|     26|            return -1;           /* Not the same type */
  390|     26|        }
  391|       |
  392|       |        /*
  393|       |         * The key types are determined to match, so we try cross export,
  394|       |         * but only to keymgmt's that supply a matching function.
  395|       |         */
  396|      0|        if (keymgmt2 != NULL
  ------------------
  |  Branch (396:13): [True: 0, False: 0]
  ------------------
  397|      0|            && keymgmt2->match != NULL) {
  ------------------
  |  Branch (397:16): [True: 0, False: 0]
  ------------------
  398|      0|            void *tmp_keydata = NULL;
  399|       |
  400|      0|            ok = 1;
  401|      0|            if (keydata1 != NULL) {
  ------------------
  |  Branch (401:17): [True: 0, False: 0]
  ------------------
  402|      0|                tmp_keydata =
  403|      0|                    evp_keymgmt_util_export_to_provider(pk1, keymgmt2,
  404|      0|                                                        selection);
  405|      0|                ok = (tmp_keydata != NULL);
  406|      0|            }
  407|      0|            if (ok) {
  ------------------
  |  Branch (407:17): [True: 0, False: 0]
  ------------------
  408|      0|                keymgmt1 = keymgmt2;
  409|      0|                keydata1 = tmp_keydata;
  410|      0|            }
  411|      0|        }
  412|       |        /*
  413|       |         * If we've successfully cross exported one way, there's no point
  414|       |         * doing it the other way, hence the |!ok| check.
  415|       |         */
  416|      0|        if (!ok
  ------------------
  |  Branch (416:13): [True: 0, False: 0]
  ------------------
  417|      0|            && keymgmt1 != NULL
  ------------------
  |  Branch (417:16): [True: 0, False: 0]
  ------------------
  418|      0|            && keymgmt1->match != NULL) {
  ------------------
  |  Branch (418:16): [True: 0, False: 0]
  ------------------
  419|      0|            void *tmp_keydata = NULL;
  420|       |
  421|      0|            ok = 1;
  422|      0|            if (keydata2 != NULL) {
  ------------------
  |  Branch (422:17): [True: 0, False: 0]
  ------------------
  423|      0|                tmp_keydata =
  424|      0|                    evp_keymgmt_util_export_to_provider(pk2, keymgmt1,
  425|      0|                                                        selection);
  426|      0|                ok = (tmp_keydata != NULL);
  427|      0|            }
  428|      0|            if (ok) {
  ------------------
  |  Branch (428:17): [True: 0, False: 0]
  ------------------
  429|      0|                keymgmt2 = keymgmt1;
  430|      0|                keydata2 = tmp_keydata;
  431|      0|            }
  432|      0|        }
  433|      0|    }
  434|       |
  435|       |    /* If we still don't have matching keymgmt implementations, we give up */
  436|    163|    if (keymgmt1 != keymgmt2)
  ------------------
  |  Branch (436:9): [True: 0, False: 163]
  ------------------
  437|      0|        return -2;
  438|       |
  439|       |    /* If both keydata are NULL, then they're the same key */
  440|    163|    if (keydata1 == NULL && keydata2 == NULL)
  ------------------
  |  Branch (440:9): [True: 0, False: 163]
  |  Branch (440:29): [True: 0, False: 0]
  ------------------
  441|      0|        return 1;
  442|       |    /* If only one of the keydata is NULL, then they're different keys */
  443|    163|    if (keydata1 == NULL || keydata2 == NULL)
  ------------------
  |  Branch (443:9): [True: 0, False: 163]
  |  Branch (443:29): [True: 0, False: 163]
  ------------------
  444|      0|        return 0;
  445|       |    /* If both keydata are non-NULL, we let the backend decide */
  446|    163|    return evp_keymgmt_match(keymgmt1, keydata1, keydata2, selection);
  447|    163|}
evp_keymgmt_util_gen:
  519|    489|{
  520|    489|    void *keydata = NULL;
  521|       |
  522|    489|    if ((keydata = evp_keymgmt_gen(keymgmt, genctx, cb, cbarg)) == NULL
  ------------------
  |  Branch (522:9): [True: 0, False: 489]
  ------------------
  523|    489|        || !evp_keymgmt_util_assign_pkey(target, keymgmt, keydata)) {
  ------------------
  |  Branch (523:12): [True: 0, False: 489]
  ------------------
  524|      0|        evp_keymgmt_freedata(keymgmt, keydata);
  525|      0|        keydata = NULL;
  526|      0|    }
  527|       |
  528|    489|    return keydata;
  529|    489|}
keymgmt_lib.c:match_type:
   23|     26|{
   24|     26|    const char *name2 = EVP_KEYMGMT_get0_name(keymgmt2);
   25|       |
   26|     26|    return EVP_KEYMGMT_is_a(keymgmt1, name2);
   27|     26|}

evp_keymgmt_fetch_from_prov:
  277|    639|{
  278|    639|    return evp_generic_fetch_from_prov(prov, OSSL_OP_KEYMGMT,
  ------------------
  |  |  315|    639|# define OSSL_OP_KEYMGMT                            10
  ------------------
  279|    639|                                       name, properties,
  280|    639|                                       keymgmt_from_algorithm,
  281|    639|                                       evp_keymgmt_up_ref,
  282|    639|                                       evp_keymgmt_free);
  283|    639|}
EVP_KEYMGMT_fetch:
  287|    513|{
  288|    513|    return evp_generic_fetch(ctx, OSSL_OP_KEYMGMT, algorithm, properties,
  ------------------
  |  |  315|    513|# define OSSL_OP_KEYMGMT                            10
  ------------------
  289|    513|                             keymgmt_from_algorithm,
  290|    513|                             evp_keymgmt_up_ref,
  291|    513|                             evp_keymgmt_free);
  292|    513|}
EVP_KEYMGMT_up_ref:
  295|  2.28k|{
  296|  2.28k|    int ref = 0;
  297|       |
  298|  2.28k|    CRYPTO_UP_REF(&keymgmt->refcnt, &ref);
  299|  2.28k|    return 1;
  300|  2.28k|}
EVP_KEYMGMT_free:
  303|  2.96k|{
  304|  2.96k|    int ref = 0;
  305|       |
  306|  2.96k|    if (keymgmt == NULL)
  ------------------
  |  Branch (306:9): [True: 639, False: 2.32k]
  ------------------
  307|    639|        return;
  308|       |
  309|  2.32k|    CRYPTO_DOWN_REF(&keymgmt->refcnt, &ref);
  310|  2.32k|    if (ref > 0)
  ------------------
  |  Branch (310:9): [True: 2.28k, False: 40]
  ------------------
  311|  2.28k|        return;
  312|     40|    OPENSSL_free(keymgmt->type_name);
  ------------------
  |  |  115|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  313|     40|    ossl_provider_free(keymgmt->prov);
  314|     40|    CRYPTO_FREE_REF(&keymgmt->refcnt);
  315|     40|    OPENSSL_free(keymgmt);
  ------------------
  |  |  115|     40|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  316|     40|}
EVP_KEYMGMT_get0_provider:
  319|    639|{
  320|    639|    return keymgmt->prov;
  321|    639|}
evp_keymgmt_get_legacy_alg:
  329|    972|{
  330|    972|    return keymgmt->legacy_alg;
  331|    972|}
EVP_KEYMGMT_get0_name:
  339|  1.76k|{
  340|  1.76k|    return keymgmt->type_name;
  341|  1.76k|}
EVP_KEYMGMT_is_a:
  344|     26|{
  345|     26|    return keymgmt != NULL
  ------------------
  |  Branch (345:12): [True: 26, False: 0]
  ------------------
  346|     26|           && evp_is_a(keymgmt->prov, keymgmt->name_id, NULL, name);
  ------------------
  |  Branch (346:15): [True: 0, False: 26]
  ------------------
  347|     26|}
EVP_KEYMGMT_names_do_all:
  363|    660|{
  364|    660|    if (keymgmt->prov != NULL)
  ------------------
  |  Branch (364:9): [True: 660, False: 0]
  ------------------
  365|    660|        return evp_names_do_all(keymgmt->prov, keymgmt->name_id, fn, data);
  366|       |
  367|      0|    return 1;
  368|    660|}
evp_keymgmt_newdata:
  374|    150|{
  375|    150|    void *provctx = ossl_provider_ctx(EVP_KEYMGMT_get0_provider(keymgmt));
  376|       |
  377|       |    /*
  378|       |     * 'new' is currently mandatory on its own, but when new
  379|       |     * constructors appear, it won't be quite as mandatory,
  380|       |     * so we have a check for future cases.
  381|       |     */
  382|    150|    if (keymgmt->new == NULL)
  ------------------
  |  Branch (382:9): [True: 0, False: 150]
  ------------------
  383|      0|        return NULL;
  384|    150|    return keymgmt->new(provctx);
  385|    150|}
evp_keymgmt_freedata:
  388|    639|{
  389|       |    /* This is mandatory, no need to check for its presence */
  390|    639|    keymgmt->free(keydata);
  391|    639|}
evp_keymgmt_gen_init:
  395|    489|{
  396|    489|    void *provctx = ossl_provider_ctx(EVP_KEYMGMT_get0_provider(keymgmt));
  397|       |
  398|    489|    if (keymgmt->gen_init == NULL)
  ------------------
  |  Branch (398:9): [True: 0, False: 489]
  ------------------
  399|      0|        return NULL;
  400|    489|    return keymgmt->gen_init(provctx, selection, params);
  401|    489|}
evp_keymgmt_gen:
  453|    489|{
  454|    489|    void *ret;
  455|    489|    const char *desc = keymgmt->description != NULL ? keymgmt->description : "";
  ------------------
  |  Branch (455:24): [True: 489, False: 0]
  ------------------
  456|       |
  457|    489|    if (keymgmt->gen == NULL) {
  ------------------
  |  Branch (457:9): [True: 0, False: 489]
  ------------------
  458|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED,
  ------------------
  |  |  110|      0|# define EVP_R_PROVIDER_KEYMGMT_NOT_SUPPORTED             236
  ------------------
  459|      0|                       "%s key generation:%s", keymgmt->type_name, desc);
  460|      0|        return NULL;
  461|      0|    }
  462|       |
  463|    489|    ret = keymgmt->gen(genctx, cb, cbarg);
  464|    489|    if (ret == NULL)
  ------------------
  |  Branch (464:9): [True: 0, False: 489]
  ------------------
  465|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_FAILURE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_FAILURE,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_KEYMGMT_FAILURE,
  ------------------
  |  |  109|      0|# define EVP_R_PROVIDER_KEYMGMT_FAILURE                   233
  ------------------
  466|      0|                       "%s key generation:%s", keymgmt->type_name, desc);
  467|    489|    return ret;
  468|    489|}
evp_keymgmt_gen_cleanup:
  471|    489|{
  472|    489|    if (keymgmt->gen_cleanup != NULL)
  ------------------
  |  Branch (472:9): [True: 489, False: 0]
  ------------------
  473|    489|        keymgmt->gen_cleanup(genctx);
  474|    489|}
evp_keymgmt_get_params:
  491|    620|{
  492|    620|    if (keymgmt->get_params == NULL)
  ------------------
  |  Branch (492:9): [True: 0, False: 620]
  ------------------
  493|      0|        return 1;
  494|    620|    return keymgmt->get_params(keydata, params);
  495|    620|}
evp_keymgmt_has:
  524|    378|{
  525|       |    /* This is mandatory, no need to check for its presence */
  526|    378|    return keymgmt->has(keydata, selection);
  527|    378|}
evp_keymgmt_match:
  541|    163|{
  542|       |    /* We assume no match if the implementation doesn't have a function */
  543|    163|    if (keymgmt->match == NULL)
  ------------------
  |  Branch (543:9): [True: 0, False: 163]
  ------------------
  544|      0|        return 0;
  545|    163|    return keymgmt->match(keydata1, keydata2, selection);
  546|    163|}
evp_keymgmt_import:
  550|    150|{
  551|    150|    if (keymgmt->import == NULL)
  ------------------
  |  Branch (551:9): [True: 0, False: 150]
  ------------------
  552|      0|        return 0;
  553|    150|    return keymgmt->import(keydata, selection, params);
  554|    150|}
evp_keymgmt_export:
  570|    126|{
  571|    126|    if (keymgmt->export == NULL)
  ------------------
  |  Branch (571:9): [True: 0, False: 126]
  ------------------
  572|      0|        return 0;
  573|    126|    return keymgmt->export(keydata, selection, param_cb, cbarg);
  574|    126|}
keymgmt_meth.c:keymgmt_from_algorithm:
   66|     40|{
   67|     40|    const OSSL_DISPATCH *fns = algodef->implementation;
   68|     40|    EVP_KEYMGMT *keymgmt = NULL;
   69|     40|    int setparamfncnt = 0, getparamfncnt = 0;
   70|     40|    int setgenparamfncnt = 0;
   71|     40|    int importfncnt = 0, exportfncnt = 0;
   72|     40|    int importtypesfncnt = 0, exporttypesfncnt = 0;
   73|     40|    int getgenparamfncnt = 0;
   74|       |
   75|     40|    if ((keymgmt = keymgmt_new()) == NULL)
  ------------------
  |  Branch (75:9): [True: 0, False: 40]
  ------------------
   76|      0|        return NULL;
   77|       |
   78|     40|    keymgmt->name_id = name_id;
   79|     40|    if ((keymgmt->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) {
  ------------------
  |  Branch (79:9): [True: 0, False: 40]
  ------------------
   80|      0|        EVP_KEYMGMT_free(keymgmt);
   81|      0|        return NULL;
   82|      0|    }
   83|     40|    keymgmt->description = algodef->algorithm_description;
   84|       |
   85|    746|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (85:12): [True: 706, False: 40]
  ------------------
   86|    706|        switch (fns->function_id) {
  ------------------
  |  Branch (86:17): [True: 0, False: 706]
  ------------------
   87|     40|        case OSSL_FUNC_KEYMGMT_NEW:
  ------------------
  |  |  658|     40|# define OSSL_FUNC_KEYMGMT_NEW                         1
  ------------------
  |  Branch (87:9): [True: 40, False: 666]
  ------------------
   88|     40|            if (keymgmt->new == NULL)
  ------------------
  |  Branch (88:17): [True: 40, False: 0]
  ------------------
   89|     40|                keymgmt->new = OSSL_FUNC_keymgmt_new(fns);
   90|     40|            break;
   91|     37|        case OSSL_FUNC_KEYMGMT_GEN_INIT:
  ------------------
  |  |  662|     37|# define OSSL_FUNC_KEYMGMT_GEN_INIT                    2
  ------------------
  |  Branch (91:9): [True: 37, False: 669]
  ------------------
   92|     37|            if (keymgmt->gen_init == NULL)
  ------------------
  |  Branch (92:17): [True: 37, False: 0]
  ------------------
   93|     37|                keymgmt->gen_init = OSSL_FUNC_keymgmt_gen_init(fns);
   94|     37|            break;
   95|      5|        case OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE:
  ------------------
  |  |  663|      5|# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE            3
  ------------------
  |  Branch (95:9): [True: 5, False: 701]
  ------------------
   96|      5|            if (keymgmt->gen_set_template == NULL)
  ------------------
  |  Branch (96:17): [True: 5, False: 0]
  ------------------
   97|      5|                keymgmt->gen_set_template =
   98|      5|                    OSSL_FUNC_keymgmt_gen_set_template(fns);
   99|      5|            break;
  100|     37|        case OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS:
  ------------------
  |  |  664|     37|# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS              4
  ------------------
  |  Branch (100:9): [True: 37, False: 669]
  ------------------
  101|     37|            if (keymgmt->gen_set_params == NULL) {
  ------------------
  |  Branch (101:17): [True: 37, False: 0]
  ------------------
  102|     37|                setgenparamfncnt++;
  103|     37|                keymgmt->gen_set_params =
  104|     37|                    OSSL_FUNC_keymgmt_gen_set_params(fns);
  105|     37|            }
  106|     37|            break;
  107|     37|        case OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS:
  ------------------
  |  |  665|     37|# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS         5
  ------------------
  |  Branch (107:9): [True: 37, False: 669]
  ------------------
  108|     37|            if (keymgmt->gen_settable_params == NULL) {
  ------------------
  |  Branch (108:17): [True: 37, False: 0]
  ------------------
  109|     37|                setgenparamfncnt++;
  110|     37|                keymgmt->gen_settable_params =
  111|     37|                    OSSL_FUNC_keymgmt_gen_settable_params(fns);
  112|     37|            }
  113|     37|            break;
  114|      2|        case OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS:
  ------------------
  |  |  668|      2|# define OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS              15
  ------------------
  |  Branch (114:9): [True: 2, False: 704]
  ------------------
  115|      2|            if (keymgmt->gen_get_params == NULL) {
  ------------------
  |  Branch (115:17): [True: 2, False: 0]
  ------------------
  116|      2|                getgenparamfncnt++;
  117|      2|                keymgmt->gen_get_params =
  118|      2|                    OSSL_FUNC_keymgmt_gen_get_params(fns);
  119|      2|            }
  120|      2|            break;
  121|      2|        case OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS:
  ------------------
  |  |  669|      2|# define OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS         16
  ------------------
  |  Branch (121:9): [True: 2, False: 704]
  ------------------
  122|      2|            if (keymgmt->gen_gettable_params == NULL) {
  ------------------
  |  Branch (122:17): [True: 2, False: 0]
  ------------------
  123|      2|                getgenparamfncnt++;
  124|      2|                keymgmt->gen_gettable_params =
  125|      2|                    OSSL_FUNC_keymgmt_gen_gettable_params(fns);
  126|      2|            }
  127|      2|            break;
  128|     37|        case OSSL_FUNC_KEYMGMT_GEN:
  ------------------
  |  |  666|     37|# define OSSL_FUNC_KEYMGMT_GEN                         6
  ------------------
  |  Branch (128:9): [True: 37, False: 669]
  ------------------
  129|     37|            if (keymgmt->gen == NULL)
  ------------------
  |  Branch (129:17): [True: 37, False: 0]
  ------------------
  130|     37|                keymgmt->gen = OSSL_FUNC_keymgmt_gen(fns);
  131|     37|            break;
  132|     37|        case OSSL_FUNC_KEYMGMT_GEN_CLEANUP:
  ------------------
  |  |  667|     37|# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP                 7
  ------------------
  |  Branch (132:9): [True: 37, False: 669]
  ------------------
  133|     37|            if (keymgmt->gen_cleanup == NULL)
  ------------------
  |  Branch (133:17): [True: 37, False: 0]
  ------------------
  134|     37|                keymgmt->gen_cleanup = OSSL_FUNC_keymgmt_gen_cleanup(fns);
  135|     37|            break;
  136|     40|        case OSSL_FUNC_KEYMGMT_FREE:
  ------------------
  |  |  694|     40|# define OSSL_FUNC_KEYMGMT_FREE                       10
  ------------------
  |  Branch (136:9): [True: 40, False: 666]
  ------------------
  137|     40|            if (keymgmt->free == NULL)
  ------------------
  |  Branch (137:17): [True: 40, False: 0]
  ------------------
  138|     40|                keymgmt->free = OSSL_FUNC_keymgmt_free(fns);
  139|     40|            break;
  140|     29|        case OSSL_FUNC_KEYMGMT_LOAD:
  ------------------
  |  |  689|     29|# define OSSL_FUNC_KEYMGMT_LOAD                        8
  ------------------
  |  Branch (140:9): [True: 29, False: 677]
  ------------------
  141|     29|            if (keymgmt->load == NULL)
  ------------------
  |  Branch (141:17): [True: 29, False: 0]
  ------------------
  142|     29|                keymgmt->load = OSSL_FUNC_keymgmt_load(fns);
  143|     29|            break;
  144|     37|        case OSSL_FUNC_KEYMGMT_GET_PARAMS:
  ------------------
  |  |  698|     37|#define OSSL_FUNC_KEYMGMT_GET_PARAMS                  11
  ------------------
  |  Branch (144:9): [True: 37, False: 669]
  ------------------
  145|     37|            if (keymgmt->get_params == NULL) {
  ------------------
  |  Branch (145:17): [True: 37, False: 0]
  ------------------
  146|     37|                getparamfncnt++;
  147|     37|                keymgmt->get_params = OSSL_FUNC_keymgmt_get_params(fns);
  148|     37|            }
  149|     37|            break;
  150|     37|        case OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS:
  ------------------
  |  |  699|     37|#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS             12
  ------------------
  |  Branch (150:9): [True: 37, False: 669]
  ------------------
  151|     37|            if (keymgmt->gettable_params == NULL) {
  ------------------
  |  Branch (151:17): [True: 37, False: 0]
  ------------------
  152|     37|                getparamfncnt++;
  153|     37|                keymgmt->gettable_params =
  154|     37|                    OSSL_FUNC_keymgmt_gettable_params(fns);
  155|     37|            }
  156|     37|            break;
  157|     19|         case OSSL_FUNC_KEYMGMT_SET_PARAMS:
  ------------------
  |  |  705|     19|#define OSSL_FUNC_KEYMGMT_SET_PARAMS                  13
  ------------------
  |  Branch (157:10): [True: 19, False: 687]
  ------------------
  158|     19|            if (keymgmt->set_params == NULL) {
  ------------------
  |  Branch (158:17): [True: 19, False: 0]
  ------------------
  159|     19|                setparamfncnt++;
  160|     19|                keymgmt->set_params = OSSL_FUNC_keymgmt_set_params(fns);
  161|     19|            }
  162|     19|            break;
  163|     19|        case OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS:
  ------------------
  |  |  706|     19|#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS             14
  ------------------
  |  Branch (163:9): [True: 19, False: 687]
  ------------------
  164|     19|            if (keymgmt->settable_params == NULL) {
  ------------------
  |  Branch (164:17): [True: 19, False: 0]
  ------------------
  165|     19|                setparamfncnt++;
  166|     19|                keymgmt->settable_params =
  167|     19|                    OSSL_FUNC_keymgmt_settable_params(fns);
  168|     19|            }
  169|     19|            break;
  170|      4|        case OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME:
  ------------------
  |  |  713|      4|# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME       20
  ------------------
  |  Branch (170:9): [True: 4, False: 702]
  ------------------
  171|      4|            if (keymgmt->query_operation_name == NULL)
  ------------------
  |  Branch (171:17): [True: 4, False: 0]
  ------------------
  172|      4|                keymgmt->query_operation_name =
  173|      4|                    OSSL_FUNC_keymgmt_query_operation_name(fns);
  174|      4|            break;
  175|     40|        case OSSL_FUNC_KEYMGMT_HAS:
  ------------------
  |  |  718|     40|# define OSSL_FUNC_KEYMGMT_HAS                        21
  ------------------
  |  Branch (175:9): [True: 40, False: 666]
  ------------------
  176|     40|            if (keymgmt->has == NULL)
  ------------------
  |  Branch (176:17): [True: 40, False: 0]
  ------------------
  177|     40|                keymgmt->has = OSSL_FUNC_keymgmt_has(fns);
  178|     40|            break;
  179|     33|        case OSSL_FUNC_KEYMGMT_DUP:
  ------------------
  |  |  748|     33|# define OSSL_FUNC_KEYMGMT_DUP                        44
  ------------------
  |  Branch (179:9): [True: 33, False: 673]
  ------------------
  180|     33|            if (keymgmt->dup == NULL)
  ------------------
  |  Branch (180:17): [True: 33, False: 0]
  ------------------
  181|     33|                keymgmt->dup = OSSL_FUNC_keymgmt_dup(fns);
  182|     33|            break;
  183|     29|        case OSSL_FUNC_KEYMGMT_VALIDATE:
  ------------------
  |  |  722|     29|# define OSSL_FUNC_KEYMGMT_VALIDATE                   22
  ------------------
  |  Branch (183:9): [True: 29, False: 677]
  ------------------
  184|     29|            if (keymgmt->validate == NULL)
  ------------------
  |  Branch (184:17): [True: 29, False: 0]
  ------------------
  185|     29|                keymgmt->validate = OSSL_FUNC_keymgmt_validate(fns);
  186|     29|            break;
  187|     37|        case OSSL_FUNC_KEYMGMT_MATCH:
  ------------------
  |  |  727|     37|# define OSSL_FUNC_KEYMGMT_MATCH                      23
  ------------------
  |  Branch (187:9): [True: 37, False: 669]
  ------------------
  188|     37|            if (keymgmt->match == NULL)
  ------------------
  |  Branch (188:17): [True: 37, False: 0]
  ------------------
  189|     37|                keymgmt->match = OSSL_FUNC_keymgmt_match(fns);
  190|     37|            break;
  191|     37|        case OSSL_FUNC_KEYMGMT_IMPORT:
  ------------------
  |  |  733|     37|# define OSSL_FUNC_KEYMGMT_IMPORT                     40
  ------------------
  |  Branch (191:9): [True: 37, False: 669]
  ------------------
  192|     37|            if (keymgmt->import == NULL) {
  ------------------
  |  Branch (192:17): [True: 37, False: 0]
  ------------------
  193|     37|                importfncnt++;
  194|     37|                keymgmt->import = OSSL_FUNC_keymgmt_import(fns);
  195|     37|            }
  196|     37|            break;
  197|     37|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES:
  ------------------
  |  |  734|     37|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES               41
  ------------------
  |  Branch (197:9): [True: 37, False: 669]
  ------------------
  198|     37|            if (keymgmt->import_types == NULL) {
  ------------------
  |  Branch (198:17): [True: 37, False: 0]
  ------------------
  199|     37|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (199:21): [True: 37, False: 0]
  ------------------
  200|     37|                    importfncnt++;
  201|     37|                importtypesfncnt++;
  202|     37|                keymgmt->import_types = OSSL_FUNC_keymgmt_import_types(fns);
  203|     37|            }
  204|     37|            break;
  205|      0|        case OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX:
  ------------------
  |  |  753|      0|# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES_EX            45
  ------------------
  |  Branch (205:9): [True: 0, False: 706]
  ------------------
  206|      0|            if (keymgmt->import_types_ex == NULL) {
  ------------------
  |  Branch (206:17): [True: 0, False: 0]
  ------------------
  207|      0|                if (importtypesfncnt == 0)
  ------------------
  |  Branch (207:21): [True: 0, False: 0]
  ------------------
  208|      0|                    importfncnt++;
  209|      0|                importtypesfncnt++;
  210|      0|                keymgmt->import_types_ex = OSSL_FUNC_keymgmt_import_types_ex(fns);
  211|      0|            }
  212|      0|            break;
  213|     37|        case OSSL_FUNC_KEYMGMT_EXPORT:
  ------------------
  |  |  735|     37|# define OSSL_FUNC_KEYMGMT_EXPORT                     42
  ------------------
  |  Branch (213:9): [True: 37, False: 669]
  ------------------
  214|     37|            if (keymgmt->export == NULL) {
  ------------------
  |  Branch (214:17): [True: 37, False: 0]
  ------------------
  215|     37|                exportfncnt++;
  216|     37|                keymgmt->export = OSSL_FUNC_keymgmt_export(fns);
  217|     37|            }
  218|     37|            break;
  219|     37|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES:
  ------------------
  |  |  736|     37|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES               43
  ------------------
  |  Branch (219:9): [True: 37, False: 669]
  ------------------
  220|     37|            if (keymgmt->export_types == NULL) {
  ------------------
  |  Branch (220:17): [True: 37, False: 0]
  ------------------
  221|     37|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (221:21): [True: 37, False: 0]
  ------------------
  222|     37|                    exportfncnt++;
  223|     37|                exporttypesfncnt++;
  224|     37|                keymgmt->export_types = OSSL_FUNC_keymgmt_export_types(fns);
  225|     37|            }
  226|     37|            break;
  227|      0|        case OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX:
  ------------------
  |  |  754|      0|# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES_EX            46
  ------------------
  |  Branch (227:9): [True: 0, False: 706]
  ------------------
  228|      0|            if (keymgmt->export_types_ex == NULL) {
  ------------------
  |  Branch (228:17): [True: 0, False: 0]
  ------------------
  229|      0|                if (exporttypesfncnt == 0)
  ------------------
  |  Branch (229:21): [True: 0, False: 0]
  ------------------
  230|      0|                    exportfncnt++;
  231|      0|                exporttypesfncnt++;
  232|      0|                keymgmt->export_types_ex = OSSL_FUNC_keymgmt_export_types_ex(fns);
  233|      0|            }
  234|      0|            break;
  235|    706|        }
  236|    706|    }
  237|       |    /*
  238|       |     * Try to check that the method is sensible.
  239|       |     * At least one constructor and the destructor are MANDATORY
  240|       |     * The functions 'has' is MANDATORY
  241|       |     * It makes no sense being able to free stuff if you can't create it.
  242|       |     * It makes no sense providing OSSL_PARAM descriptors for import and
  243|       |     * export if you can't import or export.
  244|       |     */
  245|     40|    if (keymgmt->free == NULL
  ------------------
  |  Branch (245:9): [True: 0, False: 40]
  ------------------
  246|     40|        || (keymgmt->new == NULL
  ------------------
  |  Branch (246:13): [True: 0, False: 40]
  ------------------
  247|     40|            && keymgmt->gen == NULL
  ------------------
  |  Branch (247:16): [True: 0, False: 0]
  ------------------
  248|     40|            && keymgmt->load == NULL)
  ------------------
  |  Branch (248:16): [True: 0, False: 0]
  ------------------
  249|     40|        || keymgmt->has == NULL
  ------------------
  |  Branch (249:12): [True: 0, False: 40]
  ------------------
  250|     40|        || (getparamfncnt != 0 && getparamfncnt != 2)
  ------------------
  |  Branch (250:13): [True: 37, False: 3]
  |  Branch (250:35): [True: 0, False: 37]
  ------------------
  251|     40|        || (setparamfncnt != 0 && setparamfncnt != 2)
  ------------------
  |  Branch (251:13): [True: 19, False: 21]
  |  Branch (251:35): [True: 0, False: 19]
  ------------------
  252|     40|        || (setgenparamfncnt != 0 && setgenparamfncnt != 2)
  ------------------
  |  Branch (252:13): [True: 37, False: 3]
  |  Branch (252:38): [True: 0, False: 37]
  ------------------
  253|     40|        || (getgenparamfncnt != 0 && getgenparamfncnt != 2)
  ------------------
  |  Branch (253:13): [True: 2, False: 38]
  |  Branch (253:38): [True: 0, False: 2]
  ------------------
  254|     40|        || (importfncnt != 0 && importfncnt != 2)
  ------------------
  |  Branch (254:13): [True: 37, False: 3]
  |  Branch (254:33): [True: 0, False: 37]
  ------------------
  255|     40|        || (exportfncnt != 0 && exportfncnt != 2)
  ------------------
  |  Branch (255:13): [True: 37, False: 3]
  |  Branch (255:33): [True: 0, False: 37]
  ------------------
  256|     40|        || (keymgmt->gen != NULL
  ------------------
  |  Branch (256:13): [True: 37, False: 3]
  ------------------
  257|     40|            && (keymgmt->gen_init == NULL
  ------------------
  |  Branch (257:17): [True: 0, False: 37]
  ------------------
  258|     37|                || keymgmt->gen_cleanup == NULL))) {
  ------------------
  |  Branch (258:20): [True: 0, False: 37]
  ------------------
  259|      0|        EVP_KEYMGMT_free(keymgmt);
  260|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  261|      0|        return NULL;
  262|      0|    }
  263|     40|    keymgmt->prov = prov;
  264|     40|    if (prov != NULL)
  ------------------
  |  Branch (264:9): [True: 40, False: 0]
  ------------------
  265|     40|        ossl_provider_up_ref(prov);
  266|       |
  267|     40|#ifndef FIPS_MODULE
  268|     40|    keymgmt->legacy_alg = get_legacy_alg_type_from_keymgmt(keymgmt);
  269|     40|#endif
  270|       |
  271|     40|    return keymgmt;
  272|     40|}
keymgmt_meth.c:keymgmt_new:
   31|     40|{
   32|     40|    EVP_KEYMGMT *keymgmt = NULL;
   33|       |
   34|     40|    if ((keymgmt = OPENSSL_zalloc(sizeof(*keymgmt))) == NULL)
  ------------------
  |  |  104|     40|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     40|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     40|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (34:9): [True: 0, False: 40]
  ------------------
   35|      0|        return NULL;
   36|     40|    if (!CRYPTO_NEW_REF(&keymgmt->refcnt, 1)) {
  ------------------
  |  Branch (36:9): [True: 0, False: 40]
  ------------------
   37|      0|        EVP_KEYMGMT_free(keymgmt);
   38|      0|        return NULL;
   39|      0|    }
   40|     40|    return keymgmt;
   41|     40|}
keymgmt_meth.c:get_legacy_alg_type_from_keymgmt:
   54|     40|{
   55|     40|    int type = NID_undef;
  ------------------
  |  |   18|     40|#define NID_undef                       0
  ------------------
   56|       |
   57|     40|    EVP_KEYMGMT_names_do_all(keymgmt, help_get_legacy_alg_type_from_keymgmt,
   58|     40|                             &type);
   59|     40|    return type;
   60|     40|}
keymgmt_meth.c:help_get_legacy_alg_type_from_keymgmt:
   46|    107|{
   47|    107|    int *type = arg;
   48|       |
   49|    107|    if (*type == NID_undef)
  ------------------
  |  |   18|    107|#define NID_undef                       0
  ------------------
  |  Branch (49:9): [True: 84, False: 23]
  ------------------
   50|     84|        *type = evp_pkey_name2type(keytype);
   51|    107|}
keymgmt_meth.c:evp_keymgmt_up_ref:
   26|  1.20k|{
   27|  1.20k|    return EVP_KEYMGMT_up_ref(data);
   28|  1.20k|}
keymgmt_meth.c:evp_keymgmt_free:
   21|     92|{
   22|     92|    EVP_KEYMGMT_free(data);
   23|     92|}

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

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

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

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

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

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

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

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

EVP_MAC_CTX_new:
   23|    738|{
   24|    738|    EVP_MAC_CTX *ctx = OPENSSL_zalloc(sizeof(EVP_MAC_CTX));
  ------------------
  |  |  104|    738|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    738|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    738|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   25|       |
   26|    738|    if (ctx != NULL) {
  ------------------
  |  Branch (26:9): [True: 738, False: 0]
  ------------------
   27|    738|        ctx->meth = mac;
   28|    738|        if ((ctx->algctx = mac->newctx(ossl_provider_ctx(mac->prov))) == NULL
  ------------------
  |  Branch (28:13): [True: 0, False: 738]
  ------------------
   29|    738|            || !EVP_MAC_up_ref(mac)) {
  ------------------
  |  Branch (29:16): [True: 0, False: 738]
  ------------------
   30|      0|            mac->freectx(ctx->algctx);
   31|      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)
  |  |  ------------------
  ------------------
   32|      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__
  |  |  ------------------
  ------------------
   33|      0|            ctx = NULL;
   34|      0|        }
   35|    738|    }
   36|    738|    return ctx;
   37|    738|}
EVP_MAC_CTX_free:
   40|  1.12k|{
   41|  1.12k|    if (ctx == NULL)
  ------------------
  |  Branch (41:9): [True: 390, False: 738]
  ------------------
   42|    390|        return;
   43|    738|    ctx->meth->freectx(ctx->algctx);
   44|    738|    ctx->algctx = NULL;
   45|       |    /* refcnt-- */
   46|    738|    EVP_MAC_free(ctx->meth);
   47|    738|    OPENSSL_free(ctx);
  ------------------
  |  |  115|    738|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    738|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    738|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|    738|}
EVP_MAC_CTX_get_mac_size:
  106|    201|{
  107|    201|    return get_size_t_ctx_param(ctx, OSSL_MAC_PARAM_SIZE);
  ------------------
  |  |  347|    201|# define OSSL_MAC_PARAM_SIZE "size"
  ------------------
  108|    201|}
EVP_MAC_init:
  117|    201|{
  118|    201|    if (ctx->meth->init == NULL) {
  ------------------
  |  Branch (118:9): [True: 0, False: 201]
  ------------------
  119|      0|        ERR_raise(ERR_R_EVP_LIB, ERR_R_UNSUPPORTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  120|      0|        return 0;
  121|      0|    }
  122|    201|    return ctx->meth->init(ctx->algctx, key, keylen, params);
  123|    201|}
EVP_MAC_update:
  137|    402|{
  138|    402|    return ctx->meth->update(ctx->algctx, data, datalen);
  139|    402|}
EVP_MAC_final:
  188|    201|{
  189|    201|    return evp_mac_final(ctx, 0, out, outl, outsize);
  190|    201|}
mac_lib.c:get_size_t_ctx_param:
   83|    201|{
   84|    201|    size_t sz = 0;
   85|       |
   86|    201|    if (ctx->algctx != NULL) {
  ------------------
  |  Branch (86:9): [True: 201, False: 0]
  ------------------
   87|    201|        OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    201|    { NULL, 0, NULL, 0, 0 }
  ------------------
                      OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|    201|    { NULL, 0, NULL, 0, 0 }
  ------------------
   88|       |
   89|    201|        params[0] = OSSL_PARAM_construct_size_t(name, &sz);
   90|    201|        if (ctx->meth->get_ctx_params != NULL) {
  ------------------
  |  Branch (90:13): [True: 201, False: 0]
  ------------------
   91|    201|            if (ctx->meth->get_ctx_params(ctx->algctx, params))
  ------------------
  |  Branch (91:17): [True: 201, False: 0]
  ------------------
   92|    201|                return sz;
   93|    201|        } else if (ctx->meth->get_params != NULL) {
  ------------------
  |  Branch (93:20): [True: 0, False: 0]
  ------------------
   94|      0|            if (ctx->meth->get_params(params))
  ------------------
  |  Branch (94:17): [True: 0, False: 0]
  ------------------
   95|      0|                return sz;
   96|      0|        }
   97|    201|    }
   98|       |    /*
   99|       |     * If the MAC hasn't been initialized yet, or there is no size to get,
  100|       |     * we return zero
  101|       |     */
  102|      0|    return 0;
  103|    201|}
mac_lib.c:evp_mac_final:
  143|    201|{
  144|    201|    size_t l;
  145|    201|    int res;
  146|    201|    OSSL_PARAM params[2];
  147|    201|    size_t macsize;
  148|       |
  149|    201|    if (ctx == NULL || ctx->meth == NULL) {
  ------------------
  |  Branch (149:9): [True: 0, False: 201]
  |  Branch (149:24): [True: 0, False: 201]
  ------------------
  150|      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)
  |  |  ------------------
  ------------------
  151|      0|        return 0;
  152|      0|    }
  153|    201|    if (ctx->meth->final == NULL) {
  ------------------
  |  Branch (153:9): [True: 0, False: 201]
  ------------------
  154|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_FINAL_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)
  |  |  ------------------
  ------------------
  155|      0|        return 0;
  156|      0|    }
  157|       |
  158|    201|    macsize = EVP_MAC_CTX_get_mac_size(ctx);
  159|    201|    if (out == NULL) {
  ------------------
  |  Branch (159:9): [True: 0, False: 201]
  ------------------
  160|      0|        if (outl == NULL) {
  ------------------
  |  Branch (160:13): [True: 0, False: 0]
  ------------------
  161|      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)
  |  |  ------------------
  ------------------
  162|      0|            return 0;
  163|      0|        }
  164|      0|        *outl = macsize;
  165|      0|        return 1;
  166|      0|    }
  167|    201|    if (outsize < macsize) {
  ------------------
  |  Branch (167:9): [True: 0, False: 201]
  ------------------
  168|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  169|      0|        return 0;
  170|      0|    }
  171|    201|    if (xof) {
  ------------------
  |  Branch (171:9): [True: 0, False: 201]
  ------------------
  172|      0|        params[0] = OSSL_PARAM_construct_int(OSSL_MAC_PARAM_XOF, &xof);
  ------------------
  |  |  349|      0|# define OSSL_MAC_PARAM_XOF "xof"
  ------------------
  173|      0|        params[1] = OSSL_PARAM_construct_end();
  174|       |
  175|      0|        if (EVP_MAC_CTX_set_params(ctx, params) <= 0) {
  ------------------
  |  Branch (175:13): [True: 0, False: 0]
  ------------------
  176|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_SETTING_XOF_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)
  |  |  ------------------
  ------------------
  177|      0|            return 0;
  178|      0|        }
  179|      0|    }
  180|    201|    res = ctx->meth->final(ctx->algctx, out, &l, outsize);
  181|    201|    if (outl != NULL)
  ------------------
  |  Branch (181:9): [True: 0, False: 201]
  ------------------
  182|      0|        *outl = l;
  183|    201|    return res;
  184|    201|}

EVP_MAC_fetch:
  180|    415|{
  181|    415|    return evp_generic_fetch(libctx, OSSL_OP_MAC, algorithm, properties,
  ------------------
  |  |  312|    415|# define OSSL_OP_MAC                                 3
  ------------------
  182|    415|                             evp_mac_from_algorithm, evp_mac_up_ref,
  183|    415|                             evp_mac_free);
  184|    415|}
EVP_MAC_up_ref:
  187|    738|{
  188|    738|    return evp_mac_up_ref(mac);
  189|    738|}
EVP_MAC_free:
  192|  1.37k|{
  193|  1.37k|    evp_mac_free(mac);
  194|  1.37k|}
mac_meth.c:evp_mac_from_algorithm:
   60|      9|{
   61|      9|    const OSSL_DISPATCH *fns = algodef->implementation;
   62|      9|    EVP_MAC *mac = NULL;
   63|      9|    int fnmaccnt = 0, fnctxcnt = 0, mac_init_found = 0;
   64|       |
   65|      9|    if ((mac = evp_mac_new()) == NULL) {
  ------------------
  |  Branch (65:9): [True: 0, False: 9]
  ------------------
   66|      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)
  |  |  ------------------
  ------------------
   67|      0|        goto err;
   68|      0|    }
   69|      9|    mac->name_id = name_id;
   70|       |
   71|      9|    if ((mac->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (71:9): [True: 0, False: 9]
  ------------------
   72|      0|        goto err;
   73|       |
   74|      9|    mac->description = algodef->algorithm_description;
   75|       |
   76|     99|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (76:12): [True: 90, False: 9]
  ------------------
   77|     90|        switch (fns->function_id) {
  ------------------
  |  Branch (77:17): [True: 0, False: 90]
  ------------------
   78|      9|        case OSSL_FUNC_MAC_NEWCTX:
  ------------------
  |  |  466|      9|# define OSSL_FUNC_MAC_NEWCTX                        1
  ------------------
  |  Branch (78:9): [True: 9, False: 81]
  ------------------
   79|      9|            if (mac->newctx != NULL)
  ------------------
  |  Branch (79:17): [True: 0, False: 9]
  ------------------
   80|      0|                break;
   81|      9|            mac->newctx = OSSL_FUNC_mac_newctx(fns);
   82|      9|            fnctxcnt++;
   83|      9|            break;
   84|      9|        case OSSL_FUNC_MAC_DUPCTX:
  ------------------
  |  |  467|      9|# define OSSL_FUNC_MAC_DUPCTX                        2
  ------------------
  |  Branch (84:9): [True: 9, False: 81]
  ------------------
   85|      9|            if (mac->dupctx != NULL)
  ------------------
  |  Branch (85:17): [True: 0, False: 9]
  ------------------
   86|      0|                break;
   87|      9|            mac->dupctx = OSSL_FUNC_mac_dupctx(fns);
   88|      9|            break;
   89|      9|        case OSSL_FUNC_MAC_FREECTX:
  ------------------
  |  |  468|      9|# define OSSL_FUNC_MAC_FREECTX                       3
  ------------------
  |  Branch (89:9): [True: 9, False: 81]
  ------------------
   90|      9|            if (mac->freectx != NULL)
  ------------------
  |  Branch (90:17): [True: 0, False: 9]
  ------------------
   91|      0|                break;
   92|      9|            mac->freectx = OSSL_FUNC_mac_freectx(fns);
   93|      9|            fnctxcnt++;
   94|      9|            break;
   95|      9|        case OSSL_FUNC_MAC_INIT:
  ------------------
  |  |  469|      9|# define OSSL_FUNC_MAC_INIT                          4
  ------------------
  |  Branch (95:9): [True: 9, False: 81]
  ------------------
   96|      9|            if (mac->init != NULL)
  ------------------
  |  Branch (96:17): [True: 0, False: 9]
  ------------------
   97|      0|                break;
   98|      9|            mac->init = OSSL_FUNC_mac_init(fns);
   99|      9|            mac_init_found = 1;
  100|      9|            break;
  101|      9|        case OSSL_FUNC_MAC_UPDATE:
  ------------------
  |  |  470|      9|# define OSSL_FUNC_MAC_UPDATE                        5
  ------------------
  |  Branch (101:9): [True: 9, False: 81]
  ------------------
  102|      9|            if (mac->update != NULL)
  ------------------
  |  Branch (102:17): [True: 0, False: 9]
  ------------------
  103|      0|                break;
  104|      9|            mac->update = OSSL_FUNC_mac_update(fns);
  105|      9|            fnmaccnt++;
  106|      9|            break;
  107|      9|        case OSSL_FUNC_MAC_FINAL:
  ------------------
  |  |  471|      9|# define OSSL_FUNC_MAC_FINAL                         6
  ------------------
  |  Branch (107:9): [True: 9, False: 81]
  ------------------
  108|      9|            if (mac->final != NULL)
  ------------------
  |  Branch (108:17): [True: 0, False: 9]
  ------------------
  109|      0|                break;
  110|      9|            mac->final = OSSL_FUNC_mac_final(fns);
  111|      9|            fnmaccnt++;
  112|      9|            break;
  113|      2|        case OSSL_FUNC_MAC_GETTABLE_PARAMS:
  ------------------
  |  |  475|      2|# define OSSL_FUNC_MAC_GETTABLE_PARAMS              10
  ------------------
  |  Branch (113:9): [True: 2, False: 88]
  ------------------
  114|      2|            if (mac->gettable_params != NULL)
  ------------------
  |  Branch (114:17): [True: 0, False: 2]
  ------------------
  115|      0|                break;
  116|      2|            mac->gettable_params =
  117|      2|                OSSL_FUNC_mac_gettable_params(fns);
  118|      2|            break;
  119|      7|        case OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  476|      7|# define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS          11
  ------------------
  |  Branch (119:9): [True: 7, False: 83]
  ------------------
  120|      7|            if (mac->gettable_ctx_params != NULL)
  ------------------
  |  Branch (120:17): [True: 0, False: 7]
  ------------------
  121|      0|                break;
  122|      7|            mac->gettable_ctx_params =
  123|      7|                OSSL_FUNC_mac_gettable_ctx_params(fns);
  124|      7|            break;
  125|      9|        case OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  477|      9|# define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS          12
  ------------------
  |  Branch (125:9): [True: 9, False: 81]
  ------------------
  126|      9|            if (mac->settable_ctx_params != NULL)
  ------------------
  |  Branch (126:17): [True: 0, False: 9]
  ------------------
  127|      0|                break;
  128|      9|            mac->settable_ctx_params =
  129|      9|                OSSL_FUNC_mac_settable_ctx_params(fns);
  130|      9|            break;
  131|      2|        case OSSL_FUNC_MAC_GET_PARAMS:
  ------------------
  |  |  472|      2|# define OSSL_FUNC_MAC_GET_PARAMS                    7
  ------------------
  |  Branch (131:9): [True: 2, False: 88]
  ------------------
  132|      2|            if (mac->get_params != NULL)
  ------------------
  |  Branch (132:17): [True: 0, False: 2]
  ------------------
  133|      0|                break;
  134|      2|            mac->get_params = OSSL_FUNC_mac_get_params(fns);
  135|      2|            break;
  136|      7|        case OSSL_FUNC_MAC_GET_CTX_PARAMS:
  ------------------
  |  |  473|      7|# define OSSL_FUNC_MAC_GET_CTX_PARAMS                8
  ------------------
  |  Branch (136:9): [True: 7, False: 83]
  ------------------
  137|      7|            if (mac->get_ctx_params != NULL)
  ------------------
  |  Branch (137:17): [True: 0, False: 7]
  ------------------
  138|      0|                break;
  139|      7|            mac->get_ctx_params = OSSL_FUNC_mac_get_ctx_params(fns);
  140|      7|            break;
  141|      9|        case OSSL_FUNC_MAC_SET_CTX_PARAMS:
  ------------------
  |  |  474|      9|# define OSSL_FUNC_MAC_SET_CTX_PARAMS                9
  ------------------
  |  Branch (141:9): [True: 9, False: 81]
  ------------------
  142|      9|            if (mac->set_ctx_params != NULL)
  ------------------
  |  Branch (142:17): [True: 0, False: 9]
  ------------------
  143|      0|                break;
  144|      9|            mac->set_ctx_params = OSSL_FUNC_mac_set_ctx_params(fns);
  145|      9|            break;
  146|      0|        case OSSL_FUNC_MAC_INIT_SKEY:
  ------------------
  |  |  478|      0|# define OSSL_FUNC_MAC_INIT_SKEY                    13
  ------------------
  |  Branch (146:9): [True: 0, False: 90]
  ------------------
  147|      0|            if (mac->init_skey != NULL)
  ------------------
  |  Branch (147:17): [True: 0, False: 0]
  ------------------
  148|      0|                break;
  149|      0|            mac->init_skey = OSSL_FUNC_mac_init_skey(fns);
  150|      0|            mac_init_found = 1;
  151|      0|            break;
  152|     90|        }
  153|     90|    }
  154|      9|    fnmaccnt += mac_init_found;
  155|      9|    if (fnmaccnt != 3
  ------------------
  |  Branch (155:9): [True: 0, False: 9]
  ------------------
  156|      9|        || fnctxcnt != 2) {
  ------------------
  |  Branch (156:12): [True: 0, False: 9]
  ------------------
  157|       |        /*
  158|       |         * In order to be a consistent set of functions we must have at least
  159|       |         * a complete set of "mac" functions, and a complete set of context
  160|       |         * management functions, as well as the size function.
  161|       |         */
  162|      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)
  |  |  ------------------
  ------------------
  163|      0|        goto err;
  164|      0|    }
  165|       |
  166|      9|    if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (166:9): [True: 9, False: 0]
  |  Branch (166:25): [True: 0, False: 9]
  ------------------
  167|      0|        goto err;
  168|       |
  169|      9|    mac->prov = prov;
  170|       |
  171|      9|    return mac;
  172|       |
  173|      0|err:
  174|      0|    evp_mac_free(mac);
  175|      0|    return NULL;
  176|      9|}
mac_meth.c:evp_mac_new:
   46|      9|{
   47|      9|    EVP_MAC *mac = NULL;
   48|       |
   49|      9|    if ((mac = OPENSSL_zalloc(sizeof(*mac))) == NULL
  ------------------
  |  |  104|      9|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (49:9): [True: 0, False: 9]
  ------------------
   50|      9|        || !CRYPTO_NEW_REF(&mac->refcnt, 1)) {
  ------------------
  |  Branch (50:12): [True: 0, False: 9]
  ------------------
   51|      0|        evp_mac_free(mac);
   52|      0|        return NULL;
   53|      0|    }
   54|      9|    return mac;
   55|      9|}
mac_meth.c:evp_mac_up_ref:
   20|  1.16k|{
   21|  1.16k|    EVP_MAC *mac = vmac;
   22|  1.16k|    int ref = 0;
   23|       |
   24|  1.16k|    CRYPTO_UP_REF(&mac->refcnt, &ref);
   25|  1.16k|    return 1;
   26|  1.16k|}
mac_meth.c:evp_mac_free:
   29|  1.39k|{
   30|  1.39k|    EVP_MAC *mac = vmac;
   31|  1.39k|    int ref = 0;
   32|       |
   33|  1.39k|    if (mac == NULL)
  ------------------
  |  Branch (33:9): [True: 224, False: 1.17k]
  ------------------
   34|    224|        return;
   35|       |
   36|  1.17k|    CRYPTO_DOWN_REF(&mac->refcnt, &ref);
   37|  1.17k|    if (ref > 0)
  ------------------
  |  Branch (37:9): [True: 1.16k, False: 9]
  ------------------
   38|  1.16k|        return;
   39|      9|    OPENSSL_free(mac->type_name);
  ------------------
  |  |  115|      9|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      9|    ossl_provider_free(mac->prov);
   41|      9|    CRYPTO_FREE_REF(&mac->refcnt);
   42|      9|    OPENSSL_free(mac);
  ------------------
  |  |  115|      9|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   43|      9|}

EVP_add_cipher:
   20|    144|{
   21|    144|    int r;
   22|       |
   23|    144|    if (c == NULL)
  ------------------
  |  Branch (23:9): [True: 0, False: 144]
  ------------------
   24|      0|        return 0;
   25|       |
   26|    144|    r = OBJ_NAME_add(OBJ_nid2sn(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   27|    144|                     (const char *)c);
   28|    144|    if (r == 0)
  ------------------
  |  Branch (28:9): [True: 0, False: 144]
  ------------------
   29|      0|        return 0;
   30|    144|    r = OBJ_NAME_add(OBJ_nid2ln(c->nid), OBJ_NAME_TYPE_CIPHER_METH,
  ------------------
  |  |   26|    144|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
   31|    144|                     (const char *)c);
   32|    144|    return r;
   33|    144|}
EVP_add_digest:
   36|     22|{
   37|     22|    int r;
   38|     22|    const char *name;
   39|       |
   40|     22|    name = OBJ_nid2sn(md->type);
   41|     22|    r = OBJ_NAME_add(name, OBJ_NAME_TYPE_MD_METH, (const char *)md);
  ------------------
  |  |   25|     22|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   42|     22|    if (r == 0)
  ------------------
  |  Branch (42:9): [True: 0, False: 22]
  ------------------
   43|      0|        return 0;
   44|     22|    r = OBJ_NAME_add(OBJ_nid2ln(md->type), OBJ_NAME_TYPE_MD_METH,
  ------------------
  |  |   25|     22|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
   45|     22|                     (const char *)md);
   46|     22|    if (r == 0)
  ------------------
  |  Branch (46:9): [True: 0, False: 22]
  ------------------
   47|      0|        return 0;
   48|       |
   49|     22|    if (md->pkey_type && md->type != md->pkey_type) {
  ------------------
  |  Branch (49:9): [True: 17, False: 5]
  |  Branch (49:26): [True: 16, False: 1]
  ------------------
   50|     16|        r = OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
   51|     16|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   52|     16|        if (r == 0)
  ------------------
  |  Branch (52:13): [True: 0, False: 16]
  ------------------
   53|      0|            return 0;
   54|     16|        r = OBJ_NAME_add(OBJ_nid2ln(md->pkey_type),
   55|     16|                         OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   25|     16|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
                                       OBJ_NAME_TYPE_MD_METH | OBJ_NAME_ALIAS, name);
  ------------------
  |  |   33|     16|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
   56|     16|    }
   57|     22|    return r;
   58|     22|}
evp_cleanup_int:
  180|      1|{
  181|      1|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      1|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  182|      1|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      1|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  183|      1|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      1|# 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|      1|    OBJ_NAME_cleanup(-1);
  190|       |
  191|      1|    EVP_PBE_cleanup();
  192|      1|    OBJ_sigid_free();
  193|       |
  194|      1|    evp_app_cleanup_int();
  195|      1|}

EVP_PKEY_eq:
  369|    189|{
  370|       |    /*
  371|       |     * This will just call evp_keymgmt_util_match when legacy support
  372|       |     * is gone.
  373|       |     */
  374|       |
  375|       |    /* Trivial shortcuts */
  376|    189|    if (a == b)
  ------------------
  |  Branch (376:9): [True: 0, False: 189]
  ------------------
  377|      0|        return 1;
  378|    189|    if (a == NULL || b == NULL)
  ------------------
  |  Branch (378:9): [True: 0, False: 189]
  |  Branch (378:22): [True: 0, False: 189]
  ------------------
  379|      0|        return 0;
  380|       |
  381|    189|#ifndef FIPS_MODULE
  382|    189|    if (a->keymgmt != NULL || b->keymgmt != NULL)
  ------------------
  |  Branch (382:9): [True: 189, False: 0]
  |  Branch (382:31): [True: 0, False: 0]
  ------------------
  383|    189|#endif  /* !FIPS_MODULE */
  384|    189|    {
  385|    189|        int selection = SELECT_PARAMETERS;
  ------------------
  |  |   58|    189|# define SELECT_PARAMETERS OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS
  |  |  ------------------
  |  |  |  |  642|    189|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  ------------------
  386|       |
  387|    189|        if (evp_keymgmt_util_has((EVP_PKEY *)a, OSSL_KEYMGMT_SELECT_PUBLIC_KEY)
  ------------------
  |  |  641|    189|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (387:13): [True: 189, False: 0]
  ------------------
  388|    189|            && evp_keymgmt_util_has((EVP_PKEY *)b, OSSL_KEYMGMT_SELECT_PUBLIC_KEY))
  ------------------
  |  |  641|    189|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (388:16): [True: 189, False: 0]
  ------------------
  389|    189|            selection |= OSSL_KEYMGMT_SELECT_PUBLIC_KEY;
  ------------------
  |  |  641|    189|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  390|      0|        else
  391|      0|            selection |= OSSL_KEYMGMT_SELECT_KEYPAIR;
  ------------------
  |  |  650|      0|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|      0|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|      0|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  392|    189|        return evp_pkey_cmp_any(a, b, selection);
  393|    189|    }
  394|       |
  395|      0|#ifndef FIPS_MODULE
  396|       |    /* All legacy keys */
  397|      0|    if (a->type != b->type)
  ------------------
  |  Branch (397:9): [True: 0, False: 0]
  ------------------
  398|      0|        return -1;
  399|       |
  400|      0|    if (a->ameth != NULL) {
  ------------------
  |  Branch (400:9): [True: 0, False: 0]
  ------------------
  401|      0|        int ret;
  402|       |        /* Compare parameters if the algorithm has them */
  403|      0|        if (a->ameth->param_cmp != NULL) {
  ------------------
  |  Branch (403:13): [True: 0, False: 0]
  ------------------
  404|      0|            ret = a->ameth->param_cmp(a, b);
  405|      0|            if (ret <= 0)
  ------------------
  |  Branch (405:17): [True: 0, False: 0]
  ------------------
  406|      0|                return ret;
  407|      0|        }
  408|       |
  409|      0|        if (a->ameth->pub_cmp != NULL)
  ------------------
  |  Branch (409:13): [True: 0, False: 0]
  ------------------
  410|      0|            return a->ameth->pub_cmp(a, b);
  411|      0|    }
  412|       |
  413|      0|    return -2;
  414|      0|#endif  /* !FIPS_MODULE */
  415|      0|}
EVP_PKEY_type:
 1026|  2.09k|{
 1027|  2.09k|    int ret;
 1028|  2.09k|    const EVP_PKEY_ASN1_METHOD *ameth;
 1029|  2.09k|    ENGINE *e;
 1030|  2.09k|    ameth = EVP_PKEY_asn1_find(&e, type);
 1031|  2.09k|    if (ameth)
  ------------------
  |  Branch (1031:9): [True: 5, False: 2.09k]
  ------------------
 1032|      5|        ret = ameth->pkey_id;
 1033|  2.09k|    else
 1034|  2.09k|        ret = NID_undef;
  ------------------
  |  |   18|  2.09k|#define NID_undef                       0
  ------------------
 1035|  2.09k|# ifndef OPENSSL_NO_ENGINE
 1036|  2.09k|    ENGINE_finish(e);
 1037|  2.09k|# endif
 1038|  2.09k|    return ret;
 1039|  2.09k|}
evp_pkey_name2type:
 1079|  1.05k|{
 1080|  1.05k|    int type;
 1081|  1.05k|    size_t i;
 1082|       |
 1083|  13.6k|    for (i = 0; i < OSSL_NELEM(standard_name2type); i++) {
  ------------------
  |  |   14|  13.6k|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (1083:17): [True: 12.6k, False: 1.05k]
  ------------------
 1084|  12.6k|        if (OPENSSL_strcasecmp(name, standard_name2type[i].ptr) == 0)
  ------------------
  |  Branch (1084:13): [True: 6, False: 12.6k]
  ------------------
 1085|      6|            return (int)standard_name2type[i].id;
 1086|  12.6k|    }
 1087|       |
 1088|  1.05k|    if ((type = EVP_PKEY_type(OBJ_sn2nid(name))) != NID_undef)
  ------------------
  |  |   18|  1.05k|#define NID_undef                       0
  ------------------
  |  Branch (1088:9): [True: 5, False: 1.04k]
  ------------------
 1089|      5|        return type;
 1090|  1.04k|    return EVP_PKEY_type(OBJ_ln2nid(name));
 1091|  1.05k|}
EVP_PKEY_new:
 1509|    639|{
 1510|    639|    EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|    639|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1511|       |
 1512|    639|    if (ret == NULL)
  ------------------
  |  Branch (1512:9): [True: 0, False: 639]
  ------------------
 1513|      0|        return NULL;
 1514|       |
 1515|    639|    ret->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|    639|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    639|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1516|    639|    ret->save_type = EVP_PKEY_NONE;
  ------------------
  |  |   62|    639|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    639|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1517|       |
 1518|    639|    if (!CRYPTO_NEW_REF(&ret->references, 1))
  ------------------
  |  Branch (1518:9): [True: 0, False: 639]
  ------------------
 1519|      0|        goto err;
 1520|       |
 1521|    639|    ret->lock = CRYPTO_THREAD_lock_new();
 1522|    639|    if (ret->lock == NULL) {
  ------------------
  |  Branch (1522:9): [True: 0, False: 639]
  ------------------
 1523|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1524|      0|        goto err;
 1525|      0|    }
 1526|       |
 1527|    639|#ifndef FIPS_MODULE
 1528|    639|    ret->save_parameters = 1;
 1529|    639|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, ret, &ret->ex_data)) {
  ------------------
  |  |  247|    639|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
  |  Branch (1529:9): [True: 0, False: 639]
  ------------------
 1530|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_CRYPTO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1531|      0|        goto err;
 1532|      0|    }
 1533|    639|#endif
 1534|    639|    return ret;
 1535|       |
 1536|      0| err:
 1537|      0|    CRYPTO_FREE_REF(&ret->references);
 1538|      0|    CRYPTO_THREAD_lock_free(ret->lock);
 1539|      0|    OPENSSL_free(ret);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1540|      0|    return NULL;
 1541|    639|}
EVP_PKEY_set_type_by_keymgmt:
 1695|    620|{
 1696|    620|#ifndef FIPS_MODULE
 1697|    620|# define EVP_PKEY_TYPE_STR str[0]
 1698|    620|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
 1699|       |    /*
 1700|       |     * Find at most two strings that have an associated EVP_PKEY_ASN1_METHOD
 1701|       |     * Ideally, only one should be found.  If two (or more) are found, the
 1702|       |     * match is ambiguous.  This should never happen, but...
 1703|       |     */
 1704|    620|    const char *str[2] = { NULL, NULL };
 1705|       |
 1706|    620|    if (!EVP_KEYMGMT_names_do_all(keymgmt, find_ameth, &str)
  ------------------
  |  Branch (1706:9): [True: 0, False: 620]
  ------------------
 1707|    620|            || str[1] != NULL) {
  ------------------
  |  Branch (1707:16): [True: 0, False: 620]
  ------------------
 1708|      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)
  |  |  ------------------
  ------------------
 1709|      0|        return 0;
 1710|      0|    }
 1711|       |#else
 1712|       |# define EVP_PKEY_TYPE_STR NULL
 1713|       |# define EVP_PKEY_TYPE_STRLEN -1
 1714|       |#endif
 1715|    620|    return pkey_set_type(pkey, NULL, EVP_PKEY_NONE,
  ------------------
  |  |   62|    620|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    620|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1716|    620|                         EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1697|    620|# define EVP_PKEY_TYPE_STR str[0]
  ------------------
                                       EVP_PKEY_TYPE_STR, EVP_PKEY_TYPE_STRLEN,
  ------------------
  |  | 1698|    620|# define EVP_PKEY_TYPE_STRLEN (str[0] == NULL ? -1 : (int)strlen(str[0]))
  |  |  ------------------
  |  |  |  Branch (1698:32): [True: 620, False: 0]
  |  |  ------------------
  ------------------
 1717|    620|                         keymgmt);
 1718|       |
 1719|    620|#undef EVP_PKEY_TYPE_STR
 1720|    620|#undef EVP_PKEY_TYPE_STRLEN
 1721|    620|}
EVP_PKEY_up_ref:
 1724|    459|{
 1725|    459|    int i;
 1726|       |
 1727|    459|    if (CRYPTO_UP_REF(&pkey->references, &i) <= 0)
  ------------------
  |  Branch (1727:9): [True: 0, False: 459]
  ------------------
 1728|      0|        return 0;
 1729|       |
 1730|    459|    REF_PRINT_COUNT("EVP_PKEY", i, pkey);
  ------------------
  |  |  301|    459|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|    459|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|    459|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    459|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1731|    459|    REF_ASSERT_ISNT(i < 2);
  ------------------
  |  |  293|    459|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 459]
  |  |  ------------------
  ------------------
 1732|    459|    return ((i > 1) ? 1 : 0);
  ------------------
  |  Branch (1732:13): [True: 459, False: 0]
  ------------------
 1733|    459|}
evp_pkey_free_legacy:
 1798|  1.12k|{
 1799|  1.12k|    const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
 1800|  1.12k|    ENGINE *tmpe = NULL;
 1801|       |
 1802|  1.12k|    if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
  ------------------
  |  Branch (1802:9): [True: 1.12k, False: 0]
  |  Branch (1802:26): [True: 0, False: 1.12k]
  ------------------
 1803|      0|        ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
 1804|       |
 1805|  1.12k|    if (ameth != NULL) {
  ------------------
  |  Branch (1805:9): [True: 0, False: 1.12k]
  ------------------
 1806|      0|        if (x->legacy_cache_pkey.ptr != NULL) {
  ------------------
  |  Branch (1806:13): [True: 0, False: 0]
  ------------------
 1807|       |            /*
 1808|       |             * We should never have both a legacy origin key, and a key in the
 1809|       |             * legacy cache.
 1810|       |             */
 1811|      0|            assert(x->pkey.ptr == NULL);
 1812|       |            /*
 1813|       |             * For the purposes of freeing we make the legacy cache look like
 1814|       |             * a legacy origin key.
 1815|       |             */
 1816|      0|            x->pkey = x->legacy_cache_pkey;
 1817|      0|            x->legacy_cache_pkey.ptr = NULL;
 1818|      0|        }
 1819|      0|        if (ameth->pkey_free != NULL)
  ------------------
  |  Branch (1819:13): [True: 0, False: 0]
  ------------------
 1820|      0|            ameth->pkey_free(x);
 1821|      0|        x->pkey.ptr = NULL;
 1822|      0|    }
 1823|  1.12k|# ifndef OPENSSL_NO_ENGINE
 1824|  1.12k|    ENGINE_finish(tmpe);
 1825|  1.12k|    ENGINE_finish(x->engine);
 1826|  1.12k|    x->engine = NULL;
 1827|  1.12k|    ENGINE_finish(x->pmeth_engine);
 1828|  1.12k|    x->pmeth_engine = NULL;
 1829|  1.12k|# endif
 1830|  1.12k|}
EVP_PKEY_free:
 1851|  3.82k|{
 1852|  3.82k|    int i;
 1853|       |
 1854|  3.82k|    if (x == NULL)
  ------------------
  |  Branch (1854:9): [True: 2.73k, False: 1.09k]
  ------------------
 1855|  2.73k|        return;
 1856|       |
 1857|  1.09k|    CRYPTO_DOWN_REF(&x->references, &i);
 1858|  1.09k|    REF_PRINT_COUNT("EVP_PKEY", i, x);
  ------------------
  |  |  301|  1.09k|    REF_PRINT_EX(text, val, (void *)object)
  |  |  ------------------
  |  |  |  |  299|  1.09k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  295|  1.09k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  1.09k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1859|  1.09k|    if (i > 0)
  ------------------
  |  Branch (1859:9): [True: 459, False: 639]
  ------------------
 1860|    459|        return;
 1861|    639|    REF_ASSERT_ISNT(i < 0);
  ------------------
  |  |  293|    639|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (293:12): [True: 0, False: 639]
  |  |  ------------------
  ------------------
 1862|    639|    evp_pkey_free_it(x);
 1863|    639|#ifndef FIPS_MODULE
 1864|    639|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_EVP_PKEY, x, &x->ex_data);
  ------------------
  |  |  247|    639|# define CRYPTO_EX_INDEX_EVP_PKEY        17
  ------------------
 1865|    639|#endif
 1866|    639|    CRYPTO_THREAD_lock_free(x->lock);
 1867|    639|    CRYPTO_FREE_REF(&x->references);
 1868|    639|#ifndef FIPS_MODULE
 1869|    639|    sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
  ------------------
  |  |  278|    639|#define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))
  ------------------
 1870|    639|#endif
 1871|    639|    OPENSSL_free(x);
  ------------------
  |  |  115|    639|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1872|    639|}
evp_pkey_export_to_provider:
 1909|    639|{
 1910|    639|    EVP_KEYMGMT *allocated_keymgmt = NULL;
 1911|    639|    EVP_KEYMGMT *tmp_keymgmt = NULL;
 1912|    639|    int selection = OSSL_KEYMGMT_SELECT_ALL;
  ------------------
  |  |  652|    639|    ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  650|    639|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|    639|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|    639|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  ------------------
  |  |  |  |  647|    639|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  642|    639|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  ------------------
  |  |  |  |  648|    639|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  643|    639|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1913|    639|    void *keydata = NULL;
 1914|    639|    int check;
 1915|       |
 1916|    639|    if (pk == NULL)
  ------------------
  |  Branch (1916:9): [True: 0, False: 639]
  ------------------
 1917|      0|        return NULL;
 1918|       |
 1919|       |    /* No key data => nothing to export */
 1920|    639|    check = 1;
 1921|    639|#ifndef FIPS_MODULE
 1922|    639|    check = check && pk->pkey.ptr == NULL;
  ------------------
  |  Branch (1922:13): [True: 639, False: 0]
  |  Branch (1922:22): [True: 639, False: 0]
  ------------------
 1923|    639|#endif
 1924|    639|    check = check && pk->keydata == NULL;
  ------------------
  |  Branch (1924:13): [True: 639, False: 0]
  |  Branch (1924:22): [True: 0, False: 639]
  ------------------
 1925|    639|    if (check)
  ------------------
  |  Branch (1925:9): [True: 0, False: 639]
  ------------------
 1926|      0|        return NULL;
 1927|       |
 1928|    639|#ifndef FIPS_MODULE
 1929|    639|    if (pk->pkey.ptr != NULL) {
  ------------------
  |  Branch (1929:9): [True: 0, False: 639]
  ------------------
 1930|       |        /*
 1931|       |         * If the legacy key doesn't have an dirty counter or export function,
 1932|       |         * give up
 1933|       |         */
 1934|      0|        if (pk->ameth->dirty_cnt == NULL || pk->ameth->export_to == NULL)
  ------------------
  |  Branch (1934:13): [True: 0, False: 0]
  |  Branch (1934:45): [True: 0, False: 0]
  ------------------
 1935|      0|            return NULL;
 1936|      0|    }
 1937|    639|#endif
 1938|       |
 1939|    639|    if (keymgmt != NULL) {
  ------------------
  |  Branch (1939:9): [True: 639, False: 0]
  ------------------
 1940|    639|        tmp_keymgmt = *keymgmt;
 1941|    639|        *keymgmt = NULL;
 1942|    639|    }
 1943|       |
 1944|       |    /*
 1945|       |     * If no keymgmt was given or found, get a default keymgmt.  We do so by
 1946|       |     * letting EVP_PKEY_CTX_new_from_pkey() do it for us, then we steal it.
 1947|       |     */
 1948|    639|    if (tmp_keymgmt == NULL) {
  ------------------
  |  Branch (1948:9): [True: 0, False: 639]
  ------------------
 1949|      0|        EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_from_pkey(libctx, pk, propquery);
 1950|       |
 1951|      0|        if (ctx == NULL)
  ------------------
  |  Branch (1951:13): [True: 0, False: 0]
  ------------------
 1952|      0|            goto end;
 1953|      0|        allocated_keymgmt = tmp_keymgmt = ctx->keymgmt;
 1954|      0|        ctx->keymgmt = NULL;
 1955|      0|        EVP_PKEY_CTX_free(ctx);
 1956|      0|    }
 1957|       |
 1958|       |    /* If there's still no keymgmt to be had, give up */
 1959|    639|    if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (1959:9): [True: 0, False: 639]
  ------------------
 1960|      0|        goto end;
 1961|       |
 1962|    639|#ifndef FIPS_MODULE
 1963|    639|    if (pk->pkey.ptr != NULL) {
  ------------------
  |  Branch (1963:9): [True: 0, False: 639]
  ------------------
 1964|      0|        OP_CACHE_ELEM *op;
 1965|       |
 1966|       |        /*
 1967|       |         * If the legacy "origin" hasn't changed since last time, we try
 1968|       |         * to find our keymgmt in the operation cache.  If it has changed,
 1969|       |         * |i| remains zero, and we will clear the cache further down.
 1970|       |         */
 1971|      0|        if (pk->ameth->dirty_cnt(pk) == pk->dirty_cnt_copy) {
  ------------------
  |  Branch (1971:13): [True: 0, False: 0]
  ------------------
 1972|      0|            if (!CRYPTO_THREAD_read_lock(pk->lock))
  ------------------
  |  Branch (1972:17): [True: 0, False: 0]
  ------------------
 1973|      0|                goto end;
 1974|      0|            op = evp_keymgmt_util_find_operation_cache(pk, tmp_keymgmt,
 1975|      0|                                                       selection);
 1976|       |
 1977|       |            /*
 1978|       |             * If |tmp_keymgmt| is present in the operation cache, it means
 1979|       |             * that export doesn't need to be redone.  In that case, we take
 1980|       |             * token copies of the cached pointers, to have token success
 1981|       |             * values to return. It is possible (e.g. in a no-cached-fetch
 1982|       |             * build), for op->keymgmt to be a different pointer to tmp_keymgmt
 1983|       |             * even though the name/provider must be the same. In other words
 1984|       |             * the keymgmt instance may be different but still equivalent, i.e.
 1985|       |             * same algorithm/provider instance - but we make the simplifying
 1986|       |             * assumption that the keydata can be used with either keymgmt
 1987|       |             * instance. Not doing so introduces significant complexity and
 1988|       |             * probably requires refactoring - since we would have to ripple
 1989|       |             * the change in keymgmt instance up the call chain.
 1990|       |             */
 1991|      0|            if (op != NULL && op->keymgmt != NULL) {
  ------------------
  |  Branch (1991:17): [True: 0, False: 0]
  |  Branch (1991:31): [True: 0, False: 0]
  ------------------
 1992|      0|                keydata = op->keydata;
 1993|      0|                CRYPTO_THREAD_unlock(pk->lock);
 1994|      0|                goto end;
 1995|      0|            }
 1996|      0|            CRYPTO_THREAD_unlock(pk->lock);
 1997|      0|        }
 1998|       |
 1999|       |        /* Make sure that the keymgmt key type matches the legacy NID */
 2000|      0|        if (!EVP_KEYMGMT_is_a(tmp_keymgmt, OBJ_nid2sn(pk->type)))
  ------------------
  |  Branch (2000:13): [True: 0, False: 0]
  ------------------
 2001|      0|            goto end;
 2002|       |
 2003|      0|        if ((keydata = evp_keymgmt_newdata(tmp_keymgmt)) == NULL)
  ------------------
  |  Branch (2003:13): [True: 0, False: 0]
  ------------------
 2004|      0|            goto end;
 2005|       |
 2006|      0|        if (!pk->ameth->export_to(pk, keydata, tmp_keymgmt->import,
  ------------------
  |  Branch (2006:13): [True: 0, False: 0]
  ------------------
 2007|      0|                                  libctx, propquery)) {
 2008|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2009|      0|            keydata = NULL;
 2010|      0|            goto end;
 2011|      0|        }
 2012|       |
 2013|       |        /*
 2014|       |         * If the dirty counter changed since last time, then clear the
 2015|       |         * operation cache.  In that case, we know that |i| is zero.  Just
 2016|       |         * in case this is a re-export, we increment then decrement the
 2017|       |         * keymgmt reference counter.
 2018|       |         */
 2019|      0|        if (!EVP_KEYMGMT_up_ref(tmp_keymgmt)) { /* refcnt++ */
  ------------------
  |  Branch (2019:13): [True: 0, False: 0]
  ------------------
 2020|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2021|      0|            keydata = NULL;
 2022|      0|            goto end;
 2023|      0|        }
 2024|       |
 2025|      0|        if (!CRYPTO_THREAD_write_lock(pk->lock))
  ------------------
  |  Branch (2025:13): [True: 0, False: 0]
  ------------------
 2026|      0|            goto end;
 2027|      0|        if (pk->ameth->dirty_cnt(pk) != pk->dirty_cnt_copy
  ------------------
  |  Branch (2027:13): [True: 0, False: 0]
  ------------------
 2028|      0|                && !evp_keymgmt_util_clear_operation_cache(pk)) {
  ------------------
  |  Branch (2028:20): [True: 0, False: 0]
  ------------------
 2029|      0|            CRYPTO_THREAD_unlock(pk->lock);
 2030|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2031|      0|            keydata = NULL;
 2032|      0|            EVP_KEYMGMT_free(tmp_keymgmt);
 2033|      0|            goto end;
 2034|      0|        }
 2035|      0|        EVP_KEYMGMT_free(tmp_keymgmt); /* refcnt-- */
 2036|       |
 2037|       |        /* Check to make sure some other thread didn't get there first */
 2038|      0|        op = evp_keymgmt_util_find_operation_cache(pk, tmp_keymgmt, selection);
 2039|      0|        if (op != NULL && op->keymgmt != NULL) {
  ------------------
  |  Branch (2039:13): [True: 0, False: 0]
  |  Branch (2039:27): [True: 0, False: 0]
  ------------------
 2040|      0|            void *tmp_keydata = op->keydata;
 2041|       |
 2042|      0|            CRYPTO_THREAD_unlock(pk->lock);
 2043|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2044|      0|            keydata = tmp_keydata;
 2045|      0|            goto end;
 2046|      0|        }
 2047|       |
 2048|       |        /* Add the new export to the operation cache */
 2049|      0|        if (!evp_keymgmt_util_cache_keydata(pk, tmp_keymgmt, keydata,
  ------------------
  |  Branch (2049:13): [True: 0, False: 0]
  ------------------
 2050|      0|                                            selection)) {
 2051|      0|            CRYPTO_THREAD_unlock(pk->lock);
 2052|      0|            evp_keymgmt_freedata(tmp_keymgmt, keydata);
 2053|      0|            keydata = NULL;
 2054|      0|            goto end;
 2055|      0|        }
 2056|       |
 2057|       |        /* Synchronize the dirty count */
 2058|      0|        pk->dirty_cnt_copy = pk->ameth->dirty_cnt(pk);
 2059|       |
 2060|      0|        CRYPTO_THREAD_unlock(pk->lock);
 2061|      0|        goto end;
 2062|      0|    }
 2063|    639|#endif  /* FIPS_MODULE */
 2064|       |
 2065|    639|    keydata = evp_keymgmt_util_export_to_provider(pk, tmp_keymgmt, selection);
 2066|       |
 2067|    639| end:
 2068|       |    /*
 2069|       |     * If nothing was exported, |tmp_keymgmt| might point at a freed
 2070|       |     * EVP_KEYMGMT, so we clear it to be safe.  It shouldn't be useful for
 2071|       |     * the caller either way in that case.
 2072|       |     */
 2073|    639|    if (keydata == NULL)
  ------------------
  |  Branch (2073:9): [True: 0, False: 639]
  ------------------
 2074|      0|        tmp_keymgmt = NULL;
 2075|       |
 2076|    639|    if (keymgmt != NULL && tmp_keymgmt != NULL) {
  ------------------
  |  Branch (2076:9): [True: 639, False: 0]
  |  Branch (2076:28): [True: 639, False: 0]
  ------------------
 2077|    639|        *keymgmt = tmp_keymgmt;
 2078|    639|        allocated_keymgmt = NULL;
 2079|    639|    }
 2080|       |
 2081|    639|    EVP_KEYMGMT_free(allocated_keymgmt);
 2082|    639|    return keydata;
 2083|    639|}
p_lib.c:evp_pkey_cmp_any:
  263|    189|{
  264|       |#ifdef FIPS_MODULE
  265|       |    return evp_keymgmt_util_match((EVP_PKEY *)a, (EVP_PKEY *)b, selection);
  266|       |#else
  267|    189|    EVP_KEYMGMT *keymgmt1 = NULL, *keymgmt2 = NULL;
  268|    189|    void *keydata1 = NULL, *keydata2 = NULL, *tmp_keydata = NULL;
  269|       |
  270|       |    /* If none of them are provided, this function shouldn't have been called */
  271|    189|    if (!ossl_assert(evp_pkey_is_provided(a) || evp_pkey_is_provided(b)))
  ------------------
  |  |   52|    189|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 189, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|    189|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (271:9): [True: 0, False: 189]
  ------------------
  272|      0|        return -2;
  273|       |
  274|       |    /* For purely provided keys, we just call the keymgmt utility */
  275|    189|    if (evp_pkey_is_provided(a) && evp_pkey_is_provided(b))
  ------------------
  |  |  649|    378|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (649:5): [True: 189, False: 0]
  |  |  ------------------
  ------------------
                  if (evp_pkey_is_provided(a) && evp_pkey_is_provided(b))
  ------------------
  |  |  649|    189|    ((pk)->keymgmt != NULL)
  |  |  ------------------
  |  |  |  Branch (649:5): [True: 189, False: 0]
  |  |  ------------------
  ------------------
  276|    189|        return evp_keymgmt_util_match((EVP_PKEY *)a, (EVP_PKEY *)b, selection);
  277|       |
  278|       |    /*
  279|       |     * At this point, one of them is provided, the other not.  This allows
  280|       |     * us to compare types using legacy NIDs.
  281|       |     */
  282|      0|    if (evp_pkey_is_legacy(a)
  ------------------
  |  |  647|      0|    ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  |   62|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (647:6): [True: 0, False: 0]
  |  |  |  Branch (647:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  283|      0|        && !EVP_KEYMGMT_is_a(b->keymgmt, OBJ_nid2sn(a->type)))
  ------------------
  |  Branch (283:12): [True: 0, False: 0]
  ------------------
  284|      0|        return -1;               /* not the same key type */
  285|      0|    if (evp_pkey_is_legacy(b)
  ------------------
  |  |  647|      0|    ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  |   62|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (647:6): [True: 0, False: 0]
  |  |  |  Branch (647:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  286|      0|        && !EVP_KEYMGMT_is_a(a->keymgmt, OBJ_nid2sn(b->type)))
  ------------------
  |  Branch (286:12): [True: 0, False: 0]
  ------------------
  287|      0|        return -1;               /* not the same key type */
  288|       |
  289|       |    /*
  290|       |     * We've determined that they both are the same keytype, so the next
  291|       |     * step is to do a bit of cross export to ensure we have keydata for
  292|       |     * both keys in the same keymgmt.
  293|       |     */
  294|      0|    keymgmt1 = a->keymgmt;
  295|      0|    keydata1 = a->keydata;
  296|      0|    keymgmt2 = b->keymgmt;
  297|      0|    keydata2 = b->keydata;
  298|       |
  299|      0|    if (keymgmt2 != NULL && keymgmt2->match != NULL) {
  ------------------
  |  Branch (299:9): [True: 0, False: 0]
  |  Branch (299:29): [True: 0, False: 0]
  ------------------
  300|      0|        tmp_keydata =
  301|      0|            evp_pkey_export_to_provider((EVP_PKEY *)a, NULL, &keymgmt2, NULL);
  302|      0|        if (tmp_keydata != NULL) {
  ------------------
  |  Branch (302:13): [True: 0, False: 0]
  ------------------
  303|      0|            keymgmt1 = keymgmt2;
  304|      0|            keydata1 = tmp_keydata;
  305|      0|        }
  306|      0|    }
  307|      0|    if (tmp_keydata == NULL && keymgmt1 != NULL && keymgmt1->match != NULL) {
  ------------------
  |  Branch (307:9): [True: 0, False: 0]
  |  Branch (307:32): [True: 0, False: 0]
  |  Branch (307:52): [True: 0, False: 0]
  ------------------
  308|      0|        tmp_keydata =
  309|      0|            evp_pkey_export_to_provider((EVP_PKEY *)b, NULL, &keymgmt1, NULL);
  310|      0|        if (tmp_keydata != NULL) {
  ------------------
  |  Branch (310:13): [True: 0, False: 0]
  ------------------
  311|      0|            keymgmt2 = keymgmt1;
  312|      0|            keydata2 = tmp_keydata;
  313|      0|        }
  314|      0|    }
  315|       |
  316|       |    /* If we still don't have matching keymgmt implementations, we give up */
  317|      0|    if (keymgmt1 != keymgmt2)
  ------------------
  |  Branch (317:9): [True: 0, False: 0]
  ------------------
  318|      0|        return -2;
  319|       |
  320|       |    /* If the keymgmt implementations are NULL, the export failed */
  321|      0|    if (keymgmt1 == NULL)
  ------------------
  |  Branch (321:9): [True: 0, False: 0]
  ------------------
  322|      0|        return -2;
  323|       |
  324|      0|    return evp_keymgmt_match(keymgmt1, keydata1, keydata2, selection);
  325|      0|#endif  /* FIPS_MODULE */
  326|      0|}
p_lib.c:pkey_set_type:
 1558|  2.48k|{
 1559|  2.48k|#ifndef FIPS_MODULE
 1560|  2.48k|    const EVP_PKEY_ASN1_METHOD *ameth = NULL;
 1561|  2.48k|    ENGINE **eptr = (e == NULL) ? &e :  NULL;
  ------------------
  |  Branch (1561:21): [True: 2.48k, False: 0]
  ------------------
 1562|  2.48k|#endif
 1563|       |
 1564|       |    /*
 1565|       |     * The setups can't set both legacy and provider side methods.
 1566|       |     * It is forbidden
 1567|       |     */
 1568|  2.48k|    if (!ossl_assert(type == EVP_PKEY_NONE || keymgmt == NULL)
  ------------------
  |  |   52|  4.96k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.48k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  4.96k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1568:9): [True: 0, False: 2.48k]
  ------------------
 1569|  2.48k|        || !ossl_assert(e == NULL || keymgmt == NULL)) {
  ------------------
  |  |   52|  2.48k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 2.48k, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|  2.48k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1569:12): [True: 0, False: 2.48k]
  ------------------
 1570|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1571|      0|        return 0;
 1572|      0|    }
 1573|       |
 1574|  2.48k|    if (pkey != NULL) {
  ------------------
  |  Branch (1574:9): [True: 620, False: 1.86k]
  ------------------
 1575|    620|        int free_it = 0;
 1576|       |
 1577|    620|#ifndef FIPS_MODULE
 1578|    620|        free_it = free_it || pkey->pkey.ptr != NULL;
  ------------------
  |  Branch (1578:19): [True: 0, False: 620]
  |  Branch (1578:30): [True: 0, False: 620]
  ------------------
 1579|    620|#endif
 1580|    620|        free_it = free_it || pkey->keydata != NULL;
  ------------------
  |  Branch (1580:19): [True: 0, False: 620]
  |  Branch (1580:30): [True: 0, False: 620]
  ------------------
 1581|    620|        if (free_it)
  ------------------
  |  Branch (1581:13): [True: 0, False: 620]
  ------------------
 1582|      0|            evp_pkey_free_it(pkey);
 1583|    620|#ifndef FIPS_MODULE
 1584|       |        /*
 1585|       |         * If key type matches and a method exists then this lookup has
 1586|       |         * succeeded once so just indicate success.
 1587|       |         */
 1588|    620|        if (pkey->type != EVP_PKEY_NONE
  ------------------
  |  |   62|    620|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  1.24k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1588:13): [True: 0, False: 620]
  ------------------
 1589|    620|            && type == pkey->save_type
  ------------------
  |  Branch (1589:16): [True: 0, False: 0]
  ------------------
 1590|    620|            && pkey->ameth != NULL)
  ------------------
  |  Branch (1590:16): [True: 0, False: 0]
  ------------------
 1591|      0|            return 1;
 1592|    620|# ifndef OPENSSL_NO_ENGINE
 1593|       |        /* If we have ENGINEs release them */
 1594|    620|        ENGINE_finish(pkey->engine);
 1595|    620|        pkey->engine = NULL;
 1596|    620|        ENGINE_finish(pkey->pmeth_engine);
 1597|    620|        pkey->pmeth_engine = NULL;
 1598|    620|# endif
 1599|    620|#endif
 1600|    620|    }
 1601|  2.48k|#ifndef FIPS_MODULE
 1602|  2.48k|    if (str != NULL)
  ------------------
  |  Branch (1602:9): [True: 1.86k, False: 620]
  ------------------
 1603|  1.86k|        ameth = EVP_PKEY_asn1_find_str(eptr, str, len);
 1604|    620|    else if (type != EVP_PKEY_NONE)
  ------------------
  |  |   62|    620|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    620|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1604:14): [True: 0, False: 620]
  ------------------
 1605|      0|        ameth = EVP_PKEY_asn1_find(eptr, type);
 1606|  2.48k|# ifndef OPENSSL_NO_ENGINE
 1607|  2.48k|    if (pkey == NULL && eptr != NULL)
  ------------------
  |  Branch (1607:9): [True: 1.86k, False: 620]
  |  Branch (1607:25): [True: 1.86k, False: 0]
  ------------------
 1608|  1.86k|        ENGINE_finish(e);
 1609|  2.48k|# endif
 1610|  2.48k|#endif
 1611|       |
 1612|       |
 1613|  2.48k|    {
 1614|  2.48k|        int check = 1;
 1615|       |
 1616|  2.48k|#ifndef FIPS_MODULE
 1617|  2.48k|        check = check && ameth == NULL;
  ------------------
  |  Branch (1617:17): [True: 2.48k, False: 0]
  |  Branch (1617:26): [True: 2.48k, False: 0]
  ------------------
 1618|  2.48k|#endif
 1619|  2.48k|        check = check && keymgmt == NULL;
  ------------------
  |  Branch (1619:17): [True: 2.48k, False: 0]
  |  Branch (1619:26): [True: 1.86k, False: 620]
  ------------------
 1620|  2.48k|        if (check) {
  ------------------
  |  Branch (1620:13): [True: 1.86k, False: 620]
  ------------------
 1621|  1.86k|            ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
  ------------------
  |  |  401|  1.86k|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|  1.86k|    (ERR_new(),                                                 \
  |  |  |  |  404|  1.86k|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|  1.86k|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|  1.86k|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.86k|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|  1.86k|     ERR_set_error)
  |  |  ------------------
  ------------------
 1622|  1.86k|            return 0;
 1623|  1.86k|        }
 1624|  2.48k|    }
 1625|    620|    if (pkey != NULL) {
  ------------------
  |  Branch (1625:9): [True: 620, False: 0]
  ------------------
 1626|    620|        if (keymgmt != NULL && !EVP_KEYMGMT_up_ref(keymgmt)) {
  ------------------
  |  Branch (1626:13): [True: 620, False: 0]
  |  Branch (1626:32): [True: 0, False: 620]
  ------------------
 1627|      0|            ERR_raise(ERR_LIB_EVP, ERR_R_INTERNAL_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1628|      0|            return 0;
 1629|      0|        }
 1630|       |
 1631|    620|        pkey->keymgmt = keymgmt;
 1632|       |
 1633|    620|        pkey->save_type = type;
 1634|    620|        pkey->type = type;
 1635|       |
 1636|    620|#ifndef FIPS_MODULE
 1637|       |        /*
 1638|       |         * If the internal "origin" key is provider side, don't save |ameth|.
 1639|       |         * The main reason is that |ameth| is one factor to detect that the
 1640|       |         * internal "origin" key is a legacy one.
 1641|       |         */
 1642|    620|        if (keymgmt == NULL)
  ------------------
  |  Branch (1642:13): [True: 0, False: 620]
  ------------------
 1643|      0|            pkey->ameth = ameth;
 1644|       |
 1645|       |        /*
 1646|       |         * The EVP_PKEY_ASN1_METHOD |pkey_id| retains its legacy key purpose
 1647|       |         * for any key type that has a legacy implementation, regardless of
 1648|       |         * if the internal key is a legacy or a provider side one.  When
 1649|       |         * there is no legacy implementation for the key, the type becomes
 1650|       |         * EVP_PKEY_KEYMGMT, which indicates that one should be cautious
 1651|       |         * with functions that expect legacy internal keys.
 1652|       |         */
 1653|    620|        if (ameth != NULL) {
  ------------------
  |  Branch (1653:13): [True: 0, False: 620]
  ------------------
 1654|      0|            if (type == EVP_PKEY_NONE)
  ------------------
  |  |   62|      0|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|      0|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1654:17): [True: 0, False: 0]
  ------------------
 1655|      0|                pkey->type = ameth->pkey_id;
 1656|    620|        } else {
 1657|    620|            pkey->type = EVP_PKEY_KEYMGMT;
  ------------------
  |  |  103|    620|# define EVP_PKEY_KEYMGMT -1
  ------------------
 1658|    620|        }
 1659|    620|# ifndef OPENSSL_NO_ENGINE
 1660|    620|        if (eptr == NULL && e != NULL && !ENGINE_init(e)) {
  ------------------
  |  Branch (1660:13): [True: 0, False: 620]
  |  Branch (1660:29): [True: 0, False: 0]
  |  Branch (1660:42): [True: 0, False: 0]
  ------------------
 1661|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1662|      0|            return 0;
 1663|      0|        }
 1664|    620|# endif
 1665|    620|        pkey->engine = e;
 1666|    620|#endif
 1667|    620|    }
 1668|    620|    return 1;
 1669|    620|}
p_lib.c:find_ameth:
 1673|  1.86k|{
 1674|  1.86k|    const char **str = data;
 1675|       |
 1676|       |    /*
 1677|       |     * The error messages from pkey_set_type() are uninteresting here,
 1678|       |     * and misleading.
 1679|       |     */
 1680|  1.86k|    ERR_set_mark();
 1681|       |
 1682|  1.86k|    if (pkey_set_type(NULL, NULL, EVP_PKEY_NONE, name, strlen(name),
  ------------------
  |  |   62|  1.86k|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|  1.86k|#define NID_undef                       0
  |  |  ------------------
  ------------------
  |  Branch (1682:9): [True: 0, False: 1.86k]
  ------------------
 1683|  1.86k|                      NULL)) {
 1684|      0|        if (str[0] == NULL)
  ------------------
  |  Branch (1684:13): [True: 0, False: 0]
  ------------------
 1685|      0|            str[0] = name;
 1686|      0|        else if (str[1] == NULL)
  ------------------
  |  Branch (1686:18): [True: 0, False: 0]
  ------------------
 1687|      0|            str[1] = name;
 1688|      0|    }
 1689|       |
 1690|  1.86k|    ERR_pop_to_mark();
 1691|  1.86k|}
p_lib.c:evp_pkey_free_it:
 1834|    639|{
 1835|       |    /* internal function; x is never NULL */
 1836|    639|    evp_keymgmt_util_clear_operation_cache(x);
 1837|    639|#ifndef FIPS_MODULE
 1838|    639|    evp_pkey_free_legacy(x);
 1839|    639|#endif
 1840|       |
 1841|    639|    if (x->keymgmt != NULL) {
  ------------------
  |  Branch (1841:9): [True: 620, False: 19]
  ------------------
 1842|    620|        evp_keymgmt_freedata(x->keymgmt, x->keydata);
 1843|    620|        EVP_KEYMGMT_free(x->keymgmt);
 1844|    620|        x->keymgmt = NULL;
 1845|    620|        x->keydata = NULL;
 1846|    620|    }
 1847|    639|    x->type = EVP_PKEY_NONE;
  ------------------
  |  |   62|    639|# define EVP_PKEY_NONE   NID_undef
  |  |  ------------------
  |  |  |  |   18|    639|#define NID_undef                       0
  |  |  ------------------
  ------------------
 1848|    639|}

EVP_PKEY_keygen_init:
  100|    489|{
  101|    489|    return gen_init(ctx, EVP_PKEY_OP_KEYGEN);
  ------------------
  |  | 1746|    489|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  102|    489|}
EVP_PKEY_generate:
  129|    489|{
  130|    489|    int ret = 0;
  131|    489|    EVP_PKEY *allocated_pkey = NULL;
  132|       |    /* Legacy compatible keygen callback info, only used with provider impls */
  133|    489|    int gentmp[2];
  134|       |
  135|    489|    if (ppkey == NULL)
  ------------------
  |  Branch (135:9): [True: 0, False: 489]
  ------------------
  136|      0|        return -1;
  137|       |
  138|    489|    if (ctx == NULL)
  ------------------
  |  Branch (138:9): [True: 0, False: 489]
  ------------------
  139|      0|        goto not_supported;
  140|       |
  141|    489|    if ((ctx->operation & EVP_PKEY_OP_TYPE_GEN) == 0)
  ------------------
  |  | 1782|    489|    (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  ------------------
  |  |  |  | 1745|    489|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  |  |  ------------------
  |  |                   (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
  |  |  ------------------
  |  |  |  | 1746|    489|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  |  |  ------------------
  ------------------
  |  Branch (141:9): [True: 0, False: 489]
  ------------------
  142|      0|        goto not_initialized;
  143|       |
  144|    489|    if (*ppkey == NULL)
  ------------------
  |  Branch (144:9): [True: 489, False: 0]
  ------------------
  145|    489|        *ppkey = allocated_pkey = EVP_PKEY_new();
  146|       |
  147|    489|    if (*ppkey == NULL) {
  ------------------
  |  Branch (147:9): [True: 0, False: 489]
  ------------------
  148|      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)
  |  |  ------------------
  ------------------
  149|      0|        return -1;
  150|      0|    }
  151|       |
  152|    489|    if (ctx->op.keymgmt.genctx == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 489]
  ------------------
  153|      0|        goto legacy;
  154|       |
  155|       |    /*
  156|       |     * Assigning gentmp to ctx->keygen_info is something our legacy
  157|       |     * implementations do.  Because the provider implementations aren't
  158|       |     * allowed to reach into our EVP_PKEY_CTX, we need to provide similar
  159|       |     * space for backward compatibility.  It's ok that we attach a local
  160|       |     * variable, as it should only be useful in the calls down from here.
  161|       |     * This is cleared as soon as it isn't useful any more, i.e. directly
  162|       |     * after the evp_keymgmt_util_gen() call.
  163|       |     */
  164|    489|    ctx->keygen_info = gentmp;
  165|    489|    ctx->keygen_info_count = 2;
  166|       |
  167|    489|    ret = 1;
  168|    489|    if (ctx->pkey != NULL) {
  ------------------
  |  Branch (168:9): [True: 0, False: 489]
  ------------------
  169|      0|        EVP_KEYMGMT *tmp_keymgmt = ctx->keymgmt;
  170|      0|        void *keydata =
  171|      0|            evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
  172|      0|                                        &tmp_keymgmt, ctx->propquery);
  173|       |
  174|      0|        if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (174:13): [True: 0, False: 0]
  ------------------
  175|      0|            goto not_supported;
  176|       |        /*
  177|       |         * It's ok if keydata is NULL here.  The backend is expected to deal
  178|       |         * with that as it sees fit.
  179|       |         */
  180|      0|        ret = evp_keymgmt_gen_set_template(ctx->keymgmt,
  181|      0|                                           ctx->op.keymgmt.genctx, keydata);
  182|      0|    }
  183|       |
  184|       |    /*
  185|       |     * the returned value from evp_keymgmt_util_gen() is cached in *ppkey,
  186|       |     * so we do not need to save it, just check it.
  187|       |     */
  188|    489|    ret = ret
  ------------------
  |  Branch (188:11): [True: 489, False: 0]
  ------------------
  189|    489|        && (evp_keymgmt_util_gen(*ppkey, ctx->keymgmt, ctx->op.keymgmt.genctx,
  ------------------
  |  Branch (189:12): [True: 489, False: 0]
  ------------------
  190|    489|                                 ossl_callback_to_pkey_gencb, ctx)
  191|    489|            != NULL);
  192|       |
  193|    489|    ctx->keygen_info = NULL;
  194|       |
  195|    489|#ifndef FIPS_MODULE
  196|       |    /* In case |*ppkey| was originally a legacy key */
  197|    489|    if (ret)
  ------------------
  |  Branch (197:9): [True: 489, False: 0]
  ------------------
  198|    489|        evp_pkey_free_legacy(*ppkey);
  199|    489|#endif
  200|       |
  201|       |    /*
  202|       |     * Because we still have legacy keys
  203|       |     */
  204|    489|    (*ppkey)->type = ctx->legacy_keytype;
  205|       |
  206|    489|    goto end;
  207|       |
  208|      0| legacy:
  209|       |#ifdef FIPS_MODULE
  210|       |    goto not_supported;
  211|       |#else
  212|       |    /*
  213|       |     * If we get here then we're using legacy paramgen/keygen. In that case
  214|       |     * the pkey in ctx (if there is one) had better not be provided (because the
  215|       |     * legacy methods may not know how to handle it). However we can only get
  216|       |     * here if ctx->op.keymgmt.genctx == NULL, but that should never be the case
  217|       |     * if ctx->pkey is provided because we don't allow this when we initialise
  218|       |     * the ctx.
  219|       |     */
  220|      0|    if (ctx->pkey != NULL && !ossl_assert(!evp_pkey_is_provided(ctx->pkey)))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (220:9): [True: 0, False: 0]
  |  Branch (220:30): [True: 0, False: 0]
  ------------------
  221|      0|        goto not_accessible;
  222|       |
  223|      0|    switch (ctx->operation) {
  224|      0|    case EVP_PKEY_OP_PARAMGEN:
  ------------------
  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  ------------------
  |  Branch (224:5): [True: 0, False: 0]
  ------------------
  225|      0|        ret = ctx->pmeth->paramgen(ctx, *ppkey);
  226|      0|        break;
  227|      0|    case EVP_PKEY_OP_KEYGEN:
  ------------------
  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  |  Branch (227:5): [True: 0, False: 0]
  ------------------
  228|      0|        ret = ctx->pmeth->keygen(ctx, *ppkey);
  229|      0|        break;
  230|      0|    default:
  ------------------
  |  Branch (230:5): [True: 0, False: 0]
  ------------------
  231|      0|        goto not_supported;
  232|      0|    }
  233|      0|#endif
  234|       |
  235|    489| end:
  236|    489|    if (ret <= 0) {
  ------------------
  |  Branch (236:9): [True: 0, False: 489]
  ------------------
  237|      0|        if (allocated_pkey != NULL)
  ------------------
  |  Branch (237:13): [True: 0, False: 0]
  ------------------
  238|      0|            *ppkey = NULL;
  239|      0|        EVP_PKEY_free(allocated_pkey);
  240|      0|    }
  241|    489|    return ret;
  242|       |
  243|      0| not_supported:
  244|      0|    ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  245|      0|    ret = -2;
  246|      0|    goto end;
  247|      0| not_initialized:
  248|      0|    ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  249|      0|    ret = -1;
  250|      0|    goto end;
  251|      0|#ifndef FIPS_MODULE
  252|      0| not_accessible:
  253|      0|    ERR_raise(ERR_LIB_EVP, EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  254|      0|    ret = -1;
  255|      0|    goto end;
  256|      0|#endif
  257|      0|}
EVP_PKEY_fromdata_init:
  359|    150|{
  360|    150|    return fromdata_init(ctx, EVP_PKEY_OP_FROMDATA);
  ------------------
  |  | 1747|    150|# define EVP_PKEY_OP_FROMDATA            (1 << 3)
  ------------------
  361|    150|}
EVP_PKEY_fromdata:
  365|    150|{
  366|    150|    void *keydata = NULL;
  367|    150|    EVP_PKEY *allocated_pkey = NULL;
  368|       |
  369|    150|    if (ctx == NULL || (ctx->operation & EVP_PKEY_OP_FROMDATA) == 0) {
  ------------------
  |  | 1747|    150|# define EVP_PKEY_OP_FROMDATA            (1 << 3)
  ------------------
  |  Branch (369:9): [True: 0, False: 150]
  |  Branch (369:24): [True: 0, False: 150]
  ------------------
  370|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  371|      0|        return -2;
  372|      0|    }
  373|       |
  374|    150|    if (ppkey == NULL)
  ------------------
  |  Branch (374:9): [True: 0, False: 150]
  ------------------
  375|      0|        return -1;
  376|       |
  377|    150|    if (*ppkey == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 150]
  ------------------
  378|      0|        allocated_pkey = *ppkey = EVP_PKEY_new();
  379|       |
  380|    150|    if (*ppkey == NULL) {
  ------------------
  |  Branch (380:9): [True: 0, False: 150]
  ------------------
  381|      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)
  |  |  ------------------
  ------------------
  382|      0|        return -1;
  383|      0|    }
  384|       |
  385|    150|    keydata = evp_keymgmt_util_fromdata(*ppkey, ctx->keymgmt, selection, params);
  386|    150|    if (keydata == NULL) {
  ------------------
  |  Branch (386:9): [True: 19, False: 131]
  ------------------
  387|     19|        if (allocated_pkey != NULL) {
  ------------------
  |  Branch (387:13): [True: 0, False: 19]
  ------------------
  388|      0|            *ppkey = NULL;
  389|      0|            EVP_PKEY_free(allocated_pkey);
  390|      0|        }
  391|     19|        return 0;
  392|     19|    }
  393|       |    /* keydata is cached in *ppkey, so we need not bother with it further */
  394|    131|    return 1;
  395|    150|}
EVP_PKEY_todata:
  416|    126|{
  417|    126|    if (params == NULL)
  ------------------
  |  Branch (417:9): [True: 0, False: 126]
  ------------------
  418|      0|        return 0;
  419|    126|    return EVP_PKEY_export(pkey, selection, ossl_pkey_todata_cb, params);
  420|    126|}
EVP_PKEY_export:
  440|    126|{
  441|    126|    if (pkey == NULL) {
  ------------------
  |  Branch (441:9): [True: 0, False: 126]
  ------------------
  442|      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)
  |  |  ------------------
  ------------------
  443|      0|        return 0;
  444|      0|    }
  445|    126|#ifndef FIPS_MODULE
  446|    126|    if (evp_pkey_is_legacy(pkey)) {
  ------------------
  |  |  647|    126|    ((pk)->type != EVP_PKEY_NONE && (pk)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  |   62|    126|# define EVP_PKEY_NONE   NID_undef
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|    252|#define NID_undef                       0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (647:6): [True: 126, False: 0]
  |  |  |  Branch (647:37): [True: 0, False: 126]
  |  |  ------------------
  ------------------
  447|      0|        struct fake_import_data_st data;
  448|       |
  449|      0|        data.export_cb = export_cb;
  450|      0|        data.export_cbarg = export_cbarg;
  451|       |
  452|       |        /*
  453|       |         * We don't need to care about libctx or propq here, as we're only
  454|       |         * interested in the resulting OSSL_PARAM array.
  455|       |         */
  456|      0|        return pkey->ameth->export_to(pkey, &data, pkey_fake_import,
  457|      0|                                      NULL, NULL);
  458|      0|    }
  459|    126|#endif
  460|    126|    return evp_keymgmt_util_export(pkey, selection, export_cb, export_cbarg);
  461|    126|}
pmeth_gn.c:gen_init:
   26|    489|{
   27|    489|    int ret = 0;
   28|       |
   29|    489|    if (ctx == NULL)
  ------------------
  |  Branch (29:9): [True: 0, False: 489]
  ------------------
   30|      0|        goto not_supported;
   31|       |
   32|    489|    evp_pkey_ctx_free_old_ops(ctx);
   33|    489|    ctx->operation = operation;
   34|       |
   35|    489|    if (ctx->keymgmt == NULL || ctx->keymgmt->gen_init == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 489]
  |  Branch (35:33): [True: 0, False: 489]
  ------------------
   36|      0|        goto legacy;
   37|       |
   38|    489|    switch (operation) {
  ------------------
  |  Branch (38:13): [True: 0, False: 489]
  ------------------
   39|      0|    case EVP_PKEY_OP_PARAMGEN:
  ------------------
  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  ------------------
  |  Branch (39:5): [True: 0, False: 489]
  ------------------
   40|      0|        ctx->op.keymgmt.genctx =
   41|      0|            evp_keymgmt_gen_init(ctx->keymgmt,
   42|      0|                                 OSSL_KEYMGMT_SELECT_ALL_PARAMETERS, NULL);
  ------------------
  |  |  647|      0|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  ------------------
  |  |  |  |  642|      0|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  ------------------
  |  |  648|      0|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  ------------------
  |  |  |  |  643|      0|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  ------------------
  ------------------
   43|      0|        break;
   44|    489|    case EVP_PKEY_OP_KEYGEN:
  ------------------
  |  | 1746|    489|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  |  Branch (44:5): [True: 489, False: 0]
  ------------------
   45|    489|        ctx->op.keymgmt.genctx =
   46|    489|            evp_keymgmt_gen_init(ctx->keymgmt, OSSL_KEYMGMT_SELECT_KEYPAIR,
  ------------------
  |  |  650|    489|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|    489|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|    489|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
   47|    489|                                 NULL);
   48|    489|        break;
   49|    489|    }
   50|       |
   51|    489|    if (ctx->op.keymgmt.genctx == NULL)
  ------------------
  |  Branch (51:9): [True: 0, False: 489]
  ------------------
   52|    489|        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)
  |  |  ------------------
  ------------------
   53|    489|    else
   54|    489|        ret = 1;
   55|    489|    goto end;
   56|       |
   57|      0| legacy:
   58|       |#ifdef FIPS_MODULE
   59|       |    goto not_supported;
   60|       |#else
   61|      0|    if (ctx->pmeth == NULL
  ------------------
  |  Branch (61:9): [True: 0, False: 0]
  ------------------
   62|      0|        || (operation == EVP_PKEY_OP_PARAMGEN
  ------------------
  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  ------------------
  |  Branch (62:13): [True: 0, False: 0]
  ------------------
   63|      0|            && ctx->pmeth->paramgen == NULL)
  ------------------
  |  Branch (63:16): [True: 0, False: 0]
  ------------------
   64|      0|        || (operation == EVP_PKEY_OP_KEYGEN
  ------------------
  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  |  Branch (64:13): [True: 0, False: 0]
  ------------------
   65|      0|            && ctx->pmeth->keygen == NULL))
  ------------------
  |  Branch (65:16): [True: 0, False: 0]
  ------------------
   66|      0|        goto not_supported;
   67|       |
   68|      0|    ret = 1;
   69|      0|    switch (operation) {
  ------------------
  |  Branch (69:13): [True: 0, False: 0]
  ------------------
   70|      0|    case EVP_PKEY_OP_PARAMGEN:
  ------------------
  |  | 1745|      0|# define EVP_PKEY_OP_PARAMGEN            (1 << 1)
  ------------------
  |  Branch (70:5): [True: 0, False: 0]
  ------------------
   71|      0|        if (ctx->pmeth->paramgen_init != NULL)
  ------------------
  |  Branch (71:13): [True: 0, False: 0]
  ------------------
   72|      0|            ret = ctx->pmeth->paramgen_init(ctx);
   73|      0|        break;
   74|      0|    case EVP_PKEY_OP_KEYGEN:
  ------------------
  |  | 1746|      0|# define EVP_PKEY_OP_KEYGEN              (1 << 2)
  ------------------
  |  Branch (74:5): [True: 0, False: 0]
  ------------------
   75|      0|        if (ctx->pmeth->keygen_init != NULL)
  ------------------
  |  Branch (75:13): [True: 0, False: 0]
  ------------------
   76|      0|            ret = ctx->pmeth->keygen_init(ctx);
   77|      0|        break;
   78|      0|    }
   79|      0|#endif
   80|       |
   81|    489| end:
   82|    489|    if (ret <= 0 && ctx != NULL) {
  ------------------
  |  Branch (82:9): [True: 0, False: 489]
  |  Branch (82:21): [True: 0, False: 0]
  ------------------
   83|      0|        evp_pkey_ctx_free_old_ops(ctx);
   84|      0|        ctx->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|      0|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
   85|      0|    }
   86|    489|    return ret;
   87|       |
   88|      0| not_supported:
   89|      0|    ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   90|      0|    ret = -2;
   91|      0|    goto end;
   92|      0|}
pmeth_gn.c:fromdata_init:
  340|    150|{
  341|    150|    if (ctx == NULL || ctx->keytype == NULL)
  ------------------
  |  Branch (341:9): [True: 0, False: 150]
  |  Branch (341:24): [True: 0, False: 150]
  ------------------
  342|      0|        goto not_supported;
  343|       |
  344|    150|    evp_pkey_ctx_free_old_ops(ctx);
  345|    150|    if (ctx->keymgmt == NULL)
  ------------------
  |  Branch (345:9): [True: 0, False: 150]
  ------------------
  346|      0|        goto not_supported;
  347|       |
  348|    150|    ctx->operation = operation;
  349|    150|    return 1;
  350|       |
  351|      0| not_supported:
  352|      0|    if (ctx != NULL)
  ------------------
  |  Branch (352:9): [True: 0, False: 0]
  ------------------
  353|      0|        ctx->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|      0|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  354|      0|    ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  355|      0|    return -2;
  356|    150|}
pmeth_gn.c:ossl_pkey_todata_cb:
  408|    126|{
  409|    126|    OSSL_PARAM **ret = arg;
  410|       |
  411|    126|    *ret = OSSL_PARAM_dup(params);
  412|    126|    return 1;
  413|    126|}

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

EVP_SIGNATURE_free:
  460|  1.10k|{
  461|  1.10k|    int i;
  462|       |
  463|  1.10k|    if (signature == NULL)
  ------------------
  |  Branch (463:9): [True: 0, False: 1.10k]
  ------------------
  464|      0|        return;
  465|  1.10k|    CRYPTO_DOWN_REF(&signature->refcnt, &i);
  466|  1.10k|    if (i > 0)
  ------------------
  |  Branch (466:9): [True: 1.04k, False: 59]
  ------------------
  467|  1.04k|        return;
  468|     59|    OPENSSL_free(signature->type_name);
  ------------------
  |  |  115|     59|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     59|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     59|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  469|     59|    ossl_provider_free(signature->prov);
  470|     59|    CRYPTO_FREE_REF(&signature->refcnt);
  471|     59|    OPENSSL_free(signature);
  ------------------
  |  |  115|     59|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     59|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     59|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  472|     59|}
EVP_SIGNATURE_up_ref:
  475|  1.04k|{
  476|  1.04k|    int ref = 0;
  477|       |
  478|  1.04k|    CRYPTO_UP_REF(&signature->refcnt, &ref);
  479|  1.04k|    return 1;
  480|  1.04k|}
EVP_SIGNATURE_get0_provider:
  483|    639|{
  484|    639|    return signature->prov;
  485|    639|}
EVP_SIGNATURE_fetch:
  489|    333|{
  490|    333|    return evp_generic_fetch(ctx, OSSL_OP_SIGNATURE, algorithm, properties,
  ------------------
  |  |  317|    333|# define OSSL_OP_SIGNATURE                          12
  ------------------
  491|    333|                             evp_signature_from_algorithm,
  492|    333|                             evp_signature_up_ref,
  493|    333|                             evp_signature_free);
  494|    333|}
EVP_SIGNATURE_is_a:
  508|    639|{
  509|    639|    return signature != NULL
  ------------------
  |  Branch (509:12): [True: 639, False: 0]
  ------------------
  510|    639|           && evp_is_a(signature->prov, signature->name_id, NULL, name);
  ------------------
  |  Branch (510:15): [True: 639, False: 0]
  ------------------
  511|    639|}
EVP_PKEY_sign_message_init:
  927|    333|{
  928|    333|    return evp_pkey_signature_init(ctx, algo, EVP_PKEY_OP_SIGNMSG, params);
  ------------------
  |  | 1758|    333|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  ------------------
  929|    333|}
EVP_PKEY_sign:
  999|    612|{
 1000|    612|    EVP_SIGNATURE *signature;
 1001|    612|    const char *desc;
 1002|    612|    int ret;
 1003|       |
 1004|    612|    if (ctx == NULL) {
  ------------------
  |  Branch (1004:9): [True: 0, False: 612]
  ------------------
 1005|      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)
  |  |  ------------------
  ------------------
 1006|      0|        return -1;
 1007|      0|    }
 1008|       |
 1009|    612|    if (ctx->operation != EVP_PKEY_OP_SIGN
  ------------------
  |  | 1748|  1.22k|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  |  Branch (1009:9): [True: 612, False: 0]
  ------------------
 1010|    612|        && ctx->operation != EVP_PKEY_OP_SIGNMSG) {
  ------------------
  |  | 1758|    612|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  ------------------
  |  Branch (1010:12): [True: 0, False: 612]
  ------------------
 1011|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1012|      0|        return -1;
 1013|      0|    }
 1014|       |
 1015|    612|    if (ctx->op.sig.algctx == NULL)
  ------------------
  |  Branch (1015:9): [True: 0, False: 612]
  ------------------
 1016|      0|        goto legacy;
 1017|       |
 1018|    612|    signature = ctx->op.sig.signature;
 1019|    612|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (1019:12): [True: 612, False: 0]
  ------------------
 1020|    612|    if (signature->sign == NULL) {
  ------------------
  |  Branch (1020:9): [True: 0, False: 612]
  ------------------
 1021|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
 1022|      0|                       "%s sign:%s", signature->type_name, desc);
 1023|      0|        return -2;
 1024|      0|    }
 1025|       |
 1026|    612|    ret = signature->sign(ctx->op.sig.algctx, sig, siglen,
 1027|    612|                          (sig == NULL) ? 0 : *siglen, tbs, tbslen);
  ------------------
  |  Branch (1027:27): [True: 306, False: 306]
  ------------------
 1028|    612|    if (ret <= 0)
  ------------------
  |  Branch (1028:9): [True: 0, False: 612]
  ------------------
 1029|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  111|      0|# define EVP_R_PROVIDER_SIGNATURE_FAILURE                 234
  ------------------
 1030|      0|                       "%s sign:%s", signature->type_name, desc);
 1031|    612|    return ret;
 1032|      0| legacy:
 1033|       |
 1034|      0|    if (ctx->pmeth == NULL || ctx->pmeth->sign == NULL) {
  ------------------
  |  Branch (1034:9): [True: 0, False: 0]
  |  Branch (1034:31): [True: 0, False: 0]
  ------------------
 1035|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1036|      0|        return -2;
 1037|      0|    }
 1038|       |
 1039|      0|    M_check_autoarg(ctx, sig, siglen, EVP_F_EVP_PKEY_SIGN)
  ------------------
  |  |  389|      0|    if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) {           \
  |  |  ------------------
  |  |  |  | 1813|      0|# define EVP_PKEY_FLAG_AUTOARGLEN        2
  |  |  ------------------
  |  |  |  Branch (389:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  390|      0|        size_t pksize = (size_t)EVP_PKEY_get_size(ctx->pkey);         \
  |  |  391|      0|                                                                  \
  |  |  392|      0|        if (pksize == 0) {                                        \
  |  |  ------------------
  |  |  |  Branch (392:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  393|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_KEY); /*ckerr_ignore*/ \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  394|      0|            return 0;                                             \
  |  |  395|      0|        }                                                         \
  |  |  396|      0|        if (arg == NULL) {                                        \
  |  |  ------------------
  |  |  |  Branch (396:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  397|      0|            *arglen = pksize;                                     \
  |  |  398|      0|            return 1;                                             \
  |  |  399|      0|        }                                                         \
  |  |  400|      0|        if (*arglen < pksize) {                                   \
  |  |  ------------------
  |  |  |  Branch (400:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  401|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL); /*ckerr_ignore*/ \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  402|      0|            return 0;                                             \
  |  |  403|      0|        }                                                         \
  |  |  404|      0|    }
  ------------------
 1040|      0|        return ctx->pmeth->sign(ctx, sig, siglen, tbs, tbslen);
 1041|      0|}
EVP_PKEY_verify_message_init:
 1061|    306|{
 1062|    306|    return evp_pkey_signature_init(ctx, algo, EVP_PKEY_OP_VERIFYMSG, params);
  ------------------
  |  | 1759|    306|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
 1063|    306|}
EVP_PKEY_verify:
 1153|    306|{
 1154|    306|    EVP_SIGNATURE *signature;
 1155|    306|    const char *desc;
 1156|    306|    int ret;
 1157|       |
 1158|    306|    if (ctx == NULL) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 306]
  ------------------
 1159|      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)
  |  |  ------------------
  ------------------
 1160|      0|        return -1;
 1161|      0|    }
 1162|       |
 1163|    306|    if (ctx->operation != EVP_PKEY_OP_VERIFY
  ------------------
  |  | 1749|    612|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  |  Branch (1163:9): [True: 306, False: 0]
  ------------------
 1164|    306|        && ctx->operation != EVP_PKEY_OP_VERIFYMSG) {
  ------------------
  |  | 1759|    306|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  |  Branch (1164:12): [True: 0, False: 306]
  ------------------
 1165|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1166|      0|        return -1;
 1167|      0|    }
 1168|       |
 1169|    306|    if (ctx->op.sig.algctx == NULL)
  ------------------
  |  Branch (1169:9): [True: 0, False: 306]
  ------------------
 1170|      0|        goto legacy;
 1171|       |
 1172|    306|    signature = ctx->op.sig.signature;
 1173|    306|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (1173:12): [True: 306, False: 0]
  ------------------
 1174|    306|    if (signature->verify == NULL) {
  ------------------
  |  Branch (1174:9): [True: 0, False: 306]
  ------------------
 1175|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
 1176|      0|                       "%s verify:%s", signature->type_name, desc);
 1177|      0|        return -2;
 1178|      0|    }
 1179|       |
 1180|    306|    ret = ctx->op.sig.signature->verify(ctx->op.sig.algctx, sig, siglen,
 1181|    306|                                        tbs, tbslen);
 1182|    306|    if (ret <= 0)
  ------------------
  |  Branch (1182:9): [True: 0, False: 306]
  ------------------
 1183|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_FAILURE,
  ------------------
  |  |  111|      0|# define EVP_R_PROVIDER_SIGNATURE_FAILURE                 234
  ------------------
 1184|      0|                       "%s verify:%s", signature->type_name, desc);
 1185|       |
 1186|    306|    return ret;
 1187|      0| legacy:
 1188|      0|    if (ctx->pmeth == NULL || ctx->pmeth->verify == NULL) {
  ------------------
  |  Branch (1188:9): [True: 0, False: 0]
  |  Branch (1188:31): [True: 0, False: 0]
  ------------------
 1189|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
 1190|      0|        return -2;
 1191|      0|    }
 1192|       |
 1193|      0|    return ctx->pmeth->verify(ctx, sig, siglen, tbs, tbslen);
 1194|      0|}
signature.c:evp_signature_from_algorithm:
   55|     59|{
   56|     59|    const OSSL_DISPATCH *fns = algodef->implementation;
   57|     59|    EVP_SIGNATURE *signature = NULL;
   58|     59|    const char *desc;
   59|       |    /* Counts newctx / freectx */
   60|     59|    int ctxfncnt = 0;
   61|       |    /* Counts all init functions  */
   62|     59|    int initfncnt = 0;
   63|       |    /* Counts all parameter functions */
   64|     59|    int gparamfncnt = 0, sparamfncnt = 0, gmdparamfncnt = 0, smdparamfncnt = 0;
   65|     59|    int valid = 0;
   66|       |
   67|     59|    if ((signature = evp_signature_new(prov)) == NULL) {
  ------------------
  |  Branch (67:9): [True: 0, False: 59]
  ------------------
   68|      0|        ERR_raise(ERR_LIB_EVP, ERR_R_EVP_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   69|      0|        goto err;
   70|      0|    }
   71|       |
   72|     59|    signature->name_id = name_id;
   73|     59|    if ((signature->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 59]
  ------------------
   74|      0|        goto err;
   75|     59|    signature->description = algodef->algorithm_description;
   76|     59|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (76:12): [True: 12, False: 47]
  ------------------
   77|       |
   78|  1.08k|    for (; fns->function_id != 0; fns++) {
  ------------------
  |  Branch (78:12): [True: 1.02k, False: 59]
  ------------------
   79|  1.02k|        switch (fns->function_id) {
  ------------------
  |  Branch (79:17): [True: 0, False: 1.02k]
  ------------------
   80|     59|        case OSSL_FUNC_SIGNATURE_NEWCTX:
  ------------------
  |  |  792|     59|# define OSSL_FUNC_SIGNATURE_NEWCTX                  1
  ------------------
  |  Branch (80:9): [True: 59, False: 962]
  ------------------
   81|     59|            if (signature->newctx != NULL)
  ------------------
  |  Branch (81:17): [True: 0, False: 59]
  ------------------
   82|      0|                break;
   83|     59|            signature->newctx = OSSL_FUNC_signature_newctx(fns);
   84|     59|            ctxfncnt++;
   85|     59|            break;
   86|     42|        case OSSL_FUNC_SIGNATURE_SIGN_INIT:
  ------------------
  |  |  793|     42|# define OSSL_FUNC_SIGNATURE_SIGN_INIT               2
  ------------------
  |  Branch (86:9): [True: 42, False: 979]
  ------------------
   87|     42|            if (signature->sign_init != NULL)
  ------------------
  |  Branch (87:17): [True: 2, False: 40]
  ------------------
   88|      2|                break;
   89|     40|            signature->sign_init = OSSL_FUNC_signature_sign_init(fns);
   90|     40|            initfncnt++;
   91|     40|            break;
   92|     55|        case OSSL_FUNC_SIGNATURE_SIGN:
  ------------------
  |  |  794|     55|# define OSSL_FUNC_SIGNATURE_SIGN                    3
  ------------------
  |  Branch (92:9): [True: 55, False: 966]
  ------------------
   93|     55|            if (signature->sign != NULL)
  ------------------
  |  Branch (93:17): [True: 0, False: 55]
  ------------------
   94|      0|                break;
   95|     55|            signature->sign = OSSL_FUNC_signature_sign(fns);
   96|     55|            break;
   97|     51|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT:
  ------------------
  |  |  818|     51|# define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_INIT      27
  ------------------
  |  Branch (97:9): [True: 51, False: 970]
  ------------------
   98|     51|            if (signature->sign_message_init != NULL)
  ------------------
  |  Branch (98:17): [True: 0, False: 51]
  ------------------
   99|      0|                break;
  100|     51|            signature->sign_message_init
  101|     51|                = OSSL_FUNC_signature_sign_message_init(fns);
  102|     51|            initfncnt++;
  103|     51|            break;
  104|     34|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE:
  ------------------
  |  |  819|     34|# define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_UPDATE    28
  ------------------
  |  Branch (104:9): [True: 34, False: 987]
  ------------------
  105|     34|            if (signature->sign_message_update != NULL)
  ------------------
  |  Branch (105:17): [True: 0, False: 34]
  ------------------
  106|      0|                break;
  107|     34|            signature->sign_message_update
  108|     34|                = OSSL_FUNC_signature_sign_message_update(fns);
  109|     34|            break;
  110|     34|        case OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL:
  ------------------
  |  |  820|     34|# define OSSL_FUNC_SIGNATURE_SIGN_MESSAGE_FINAL     29
  ------------------
  |  Branch (110:9): [True: 34, False: 987]
  ------------------
  111|     34|            if (signature->sign_message_final != NULL)
  ------------------
  |  Branch (111:17): [True: 0, False: 34]
  ------------------
  112|      0|                break;
  113|     34|            signature->sign_message_final
  114|     34|                = OSSL_FUNC_signature_sign_message_final(fns);
  115|     34|            break;
  116|     42|        case OSSL_FUNC_SIGNATURE_VERIFY_INIT:
  ------------------
  |  |  795|     42|# define OSSL_FUNC_SIGNATURE_VERIFY_INIT             4
  ------------------
  |  Branch (116:9): [True: 42, False: 979]
  ------------------
  117|     42|            if (signature->verify_init != NULL)
  ------------------
  |  Branch (117:17): [True: 2, False: 40]
  ------------------
  118|      2|                break;
  119|     40|            signature->verify_init = OSSL_FUNC_signature_verify_init(fns);
  120|     40|            initfncnt++;
  121|     40|            break;
  122|     55|        case OSSL_FUNC_SIGNATURE_VERIFY:
  ------------------
  |  |  796|     55|# define OSSL_FUNC_SIGNATURE_VERIFY                  5
  ------------------
  |  Branch (122:9): [True: 55, False: 966]
  ------------------
  123|     55|            if (signature->verify != NULL)
  ------------------
  |  Branch (123:17): [True: 0, False: 55]
  ------------------
  124|      0|                break;
  125|     55|            signature->verify = OSSL_FUNC_signature_verify(fns);
  126|     55|            break;
  127|     51|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT:
  ------------------
  |  |  821|     51|# define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_INIT    30
  ------------------
  |  Branch (127:9): [True: 51, False: 970]
  ------------------
  128|     51|            if (signature->verify_message_init != NULL)
  ------------------
  |  Branch (128:17): [True: 0, False: 51]
  ------------------
  129|      0|                break;
  130|     51|            signature->verify_message_init
  131|     51|                = OSSL_FUNC_signature_verify_message_init(fns);
  132|     51|            initfncnt++;
  133|     51|            break;
  134|     34|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE:
  ------------------
  |  |  822|     34|# define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_UPDATE  31
  ------------------
  |  Branch (134:9): [True: 34, False: 987]
  ------------------
  135|     34|            if (signature->verify_message_update != NULL)
  ------------------
  |  Branch (135:17): [True: 0, False: 34]
  ------------------
  136|      0|                break;
  137|     34|            signature->verify_message_update
  138|     34|                = OSSL_FUNC_signature_verify_message_update(fns);
  139|     34|            break;
  140|     34|        case OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL:
  ------------------
  |  |  823|     34|# define OSSL_FUNC_SIGNATURE_VERIFY_MESSAGE_FINAL   32
  ------------------
  |  Branch (140:9): [True: 34, False: 987]
  ------------------
  141|     34|            if (signature->verify_message_final != NULL)
  ------------------
  |  Branch (141:17): [True: 0, False: 34]
  ------------------
  142|      0|                break;
  143|     34|            signature->verify_message_final
  144|     34|                = OSSL_FUNC_signature_verify_message_final(fns);
  145|     34|            break;
  146|     14|        case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT:
  ------------------
  |  |  797|     14|# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT     6
  ------------------
  |  Branch (146:9): [True: 14, False: 1.00k]
  ------------------
  147|     14|            if (signature->verify_recover_init != NULL)
  ------------------
  |  Branch (147:17): [True: 0, False: 14]
  ------------------
  148|      0|                break;
  149|     14|            signature->verify_recover_init
  150|     14|                = OSSL_FUNC_signature_verify_recover_init(fns);
  151|     14|            initfncnt++;
  152|     14|            break;
  153|     14|        case OSSL_FUNC_SIGNATURE_VERIFY_RECOVER:
  ------------------
  |  |  798|     14|# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER          7
  ------------------
  |  Branch (153:9): [True: 14, False: 1.00k]
  ------------------
  154|     14|            if (signature->verify_recover != NULL)
  ------------------
  |  Branch (154:17): [True: 0, False: 14]
  ------------------
  155|      0|                break;
  156|     14|            signature->verify_recover
  157|     14|                = OSSL_FUNC_signature_verify_recover(fns);
  158|     14|            break;
  159|     25|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT:
  ------------------
  |  |  799|     25|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT        8
  ------------------
  |  Branch (159:9): [True: 25, False: 996]
  ------------------
  160|     25|            if (signature->digest_sign_init != NULL)
  ------------------
  |  Branch (160:17): [True: 0, False: 25]
  ------------------
  161|      0|                break;
  162|     25|            signature->digest_sign_init
  163|     25|                = OSSL_FUNC_signature_digest_sign_init(fns);
  164|     25|            initfncnt++;
  165|     25|            break;
  166|      8|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE:
  ------------------
  |  |  800|      8|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE      9
  ------------------
  |  Branch (166:9): [True: 8, False: 1.01k]
  ------------------
  167|      8|            if (signature->digest_sign_update != NULL)
  ------------------
  |  Branch (167:17): [True: 0, False: 8]
  ------------------
  168|      0|                break;
  169|      8|            signature->digest_sign_update
  170|      8|                = OSSL_FUNC_signature_digest_sign_update(fns);
  171|      8|            break;
  172|      8|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL:
  ------------------
  |  |  801|      8|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL      10
  ------------------
  |  Branch (172:9): [True: 8, False: 1.01k]
  ------------------
  173|      8|            if (signature->digest_sign_final != NULL)
  ------------------
  |  Branch (173:17): [True: 0, False: 8]
  ------------------
  174|      0|                break;
  175|      8|            signature->digest_sign_final
  176|      8|                = OSSL_FUNC_signature_digest_sign_final(fns);
  177|      8|            break;
  178|     17|        case OSSL_FUNC_SIGNATURE_DIGEST_SIGN:
  ------------------
  |  |  802|     17|# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN            11
  ------------------
  |  Branch (178:9): [True: 17, False: 1.00k]
  ------------------
  179|     17|            if (signature->digest_sign != NULL)
  ------------------
  |  Branch (179:17): [True: 0, False: 17]
  ------------------
  180|      0|                break;
  181|     17|            signature->digest_sign
  182|     17|                = OSSL_FUNC_signature_digest_sign(fns);
  183|     17|            break;
  184|     21|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT:
  ------------------
  |  |  803|     21|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT     12
  ------------------
  |  Branch (184:9): [True: 21, False: 1.00k]
  ------------------
  185|     21|            if (signature->digest_verify_init != NULL)
  ------------------
  |  Branch (185:17): [True: 0, False: 21]
  ------------------
  186|      0|                break;
  187|     21|            signature->digest_verify_init
  188|     21|                = OSSL_FUNC_signature_digest_verify_init(fns);
  189|     21|            initfncnt++;
  190|     21|            break;
  191|      4|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE:
  ------------------
  |  |  804|      4|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE   13
  ------------------
  |  Branch (191:9): [True: 4, False: 1.01k]
  ------------------
  192|      4|            if (signature->digest_verify_update != NULL)
  ------------------
  |  Branch (192:17): [True: 0, False: 4]
  ------------------
  193|      0|                break;
  194|      4|            signature->digest_verify_update
  195|      4|                = OSSL_FUNC_signature_digest_verify_update(fns);
  196|      4|            break;
  197|      4|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL:
  ------------------
  |  |  805|      4|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL    14
  ------------------
  |  Branch (197:9): [True: 4, False: 1.01k]
  ------------------
  198|      4|            if (signature->digest_verify_final != NULL)
  ------------------
  |  Branch (198:17): [True: 0, False: 4]
  ------------------
  199|      0|                break;
  200|      4|            signature->digest_verify_final
  201|      4|                = OSSL_FUNC_signature_digest_verify_final(fns);
  202|      4|            break;
  203|     17|        case OSSL_FUNC_SIGNATURE_DIGEST_VERIFY:
  ------------------
  |  |  806|     17|# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY          15
  ------------------
  |  Branch (203:9): [True: 17, False: 1.00k]
  ------------------
  204|     17|            if (signature->digest_verify != NULL)
  ------------------
  |  Branch (204:17): [True: 0, False: 17]
  ------------------
  205|      0|                break;
  206|     17|            signature->digest_verify
  207|     17|                = OSSL_FUNC_signature_digest_verify(fns);
  208|     17|            break;
  209|     59|        case OSSL_FUNC_SIGNATURE_FREECTX:
  ------------------
  |  |  807|     59|# define OSSL_FUNC_SIGNATURE_FREECTX                16
  ------------------
  |  Branch (209:9): [True: 59, False: 962]
  ------------------
  210|     59|            if (signature->freectx != NULL)
  ------------------
  |  Branch (210:17): [True: 0, False: 59]
  ------------------
  211|      0|                break;
  212|     59|            signature->freectx = OSSL_FUNC_signature_freectx(fns);
  213|     59|            ctxfncnt++;
  214|     59|            break;
  215|     59|        case OSSL_FUNC_SIGNATURE_DUPCTX:
  ------------------
  |  |  808|     59|# define OSSL_FUNC_SIGNATURE_DUPCTX                 17
  ------------------
  |  Branch (215:9): [True: 59, False: 962]
  ------------------
  216|     59|            if (signature->dupctx != NULL)
  ------------------
  |  Branch (216:17): [True: 0, False: 59]
  ------------------
  217|      0|                break;
  218|     59|            signature->dupctx = OSSL_FUNC_signature_dupctx(fns);
  219|     59|            break;
  220|     55|        case OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS:
  ------------------
  |  |  809|     55|# define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS         18
  ------------------
  |  Branch (220:9): [True: 55, False: 966]
  ------------------
  221|     55|            if (signature->get_ctx_params != NULL)
  ------------------
  |  Branch (221:17): [True: 0, False: 55]
  ------------------
  222|      0|                break;
  223|     55|            signature->get_ctx_params
  224|     55|                = OSSL_FUNC_signature_get_ctx_params(fns);
  225|     55|            gparamfncnt++;
  226|     55|            break;
  227|     55|        case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS:
  ------------------
  |  |  810|     55|# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS    19
  ------------------
  |  Branch (227:9): [True: 55, False: 966]
  ------------------
  228|     55|            if (signature->gettable_ctx_params != NULL)
  ------------------
  |  Branch (228:17): [True: 0, False: 55]
  ------------------
  229|      0|                break;
  230|     55|            signature->gettable_ctx_params
  231|     55|                = OSSL_FUNC_signature_gettable_ctx_params(fns);
  232|     55|            gparamfncnt++;
  233|     55|            break;
  234|     59|        case OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS:
  ------------------
  |  |  811|     59|# define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS         20
  ------------------
  |  Branch (234:9): [True: 59, False: 962]
  ------------------
  235|     59|            if (signature->set_ctx_params != NULL)
  ------------------
  |  Branch (235:17): [True: 0, False: 59]
  ------------------
  236|      0|                break;
  237|     59|            signature->set_ctx_params
  238|     59|                = OSSL_FUNC_signature_set_ctx_params(fns);
  239|     59|            sparamfncnt++;
  240|     59|            break;
  241|     59|        case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS:
  ------------------
  |  |  812|     59|# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS    21
  ------------------
  |  Branch (241:9): [True: 59, False: 962]
  ------------------
  242|     59|            if (signature->settable_ctx_params != NULL)
  ------------------
  |  Branch (242:17): [True: 0, False: 59]
  ------------------
  243|      0|                break;
  244|     59|            signature->settable_ctx_params
  245|     59|                = OSSL_FUNC_signature_settable_ctx_params(fns);
  246|     59|            sparamfncnt++;
  247|     59|            break;
  248|      4|        case OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS:
  ------------------
  |  |  813|      4|# define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS      22
  ------------------
  |  Branch (248:9): [True: 4, False: 1.01k]
  ------------------
  249|      4|            if (signature->get_ctx_md_params != NULL)
  ------------------
  |  Branch (249:17): [True: 0, False: 4]
  ------------------
  250|      0|                break;
  251|      4|            signature->get_ctx_md_params
  252|      4|                = OSSL_FUNC_signature_get_ctx_md_params(fns);
  253|      4|            gmdparamfncnt++;
  254|      4|            break;
  255|      4|        case OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS:
  ------------------
  |  |  814|      4|# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23
  ------------------
  |  Branch (255:9): [True: 4, False: 1.01k]
  ------------------
  256|      4|            if (signature->gettable_ctx_md_params != NULL)
  ------------------
  |  Branch (256:17): [True: 0, False: 4]
  ------------------
  257|      0|                break;
  258|      4|            signature->gettable_ctx_md_params
  259|      4|                = OSSL_FUNC_signature_gettable_ctx_md_params(fns);
  260|      4|            gmdparamfncnt++;
  261|      4|            break;
  262|      4|        case OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS:
  ------------------
  |  |  815|      4|# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS      24
  ------------------
  |  Branch (262:9): [True: 4, False: 1.01k]
  ------------------
  263|      4|            if (signature->set_ctx_md_params != NULL)
  ------------------
  |  Branch (263:17): [True: 0, False: 4]
  ------------------
  264|      0|                break;
  265|      4|            signature->set_ctx_md_params
  266|      4|                = OSSL_FUNC_signature_set_ctx_md_params(fns);
  267|      4|            smdparamfncnt++;
  268|      4|            break;
  269|      4|        case OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS:
  ------------------
  |  |  816|      4|# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
  ------------------
  |  Branch (269:9): [True: 4, False: 1.01k]
  ------------------
  270|      4|            if (signature->settable_ctx_md_params != NULL)
  ------------------
  |  Branch (270:17): [True: 0, False: 4]
  ------------------
  271|      0|                break;
  272|      4|            signature->settable_ctx_md_params
  273|      4|                = OSSL_FUNC_signature_settable_ctx_md_params(fns);
  274|      4|            smdparamfncnt++;
  275|      4|            break;
  276|     36|        case OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES:
  ------------------
  |  |  817|     36|# define OSSL_FUNC_SIGNATURE_QUERY_KEY_TYPES        26
  ------------------
  |  Branch (276:9): [True: 36, False: 985]
  ------------------
  277|     36|            if (signature->query_key_types != NULL)
  ------------------
  |  Branch (277:17): [True: 0, False: 36]
  ------------------
  278|      0|                break;
  279|     36|            signature->query_key_types
  280|     36|                = OSSL_FUNC_signature_query_key_types(fns);
  281|     36|            break;
  282|  1.02k|        }
  283|  1.02k|    }
  284|       |    /*
  285|       |     * In order to be a consistent set of functions we must have at least
  286|       |     * a set of context functions (newctx and freectx) as well as a set of
  287|       |     * "signature" functions.  Because there's an overlap between some sets
  288|       |     * of functions, counters don't always cut it, we must test known
  289|       |     * combinations.
  290|       |     * We start by assuming the implementation is valid, and then look for
  291|       |     * reasons it's not.
  292|       |     */
  293|     59|    valid = 1;
  294|       |    /* Start with the ones where counters say enough */
  295|     59|    if (ctxfncnt != 2) {
  ------------------
  |  Branch (295:9): [True: 0, False: 59]
  ------------------
  296|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  297|      0|                       "missing %s newctx or freectx:%s", signature->type_name, desc);
  298|      0|        valid = 0;
  299|      0|    }
  300|     59|    if (valid
  ------------------
  |  Branch (300:9): [True: 59, False: 0]
  ------------------
  301|     59|        && ((gparamfncnt != 0 && gparamfncnt != 2)
  ------------------
  |  Branch (301:14): [True: 55, False: 4]
  |  Branch (301:34): [True: 0, False: 55]
  ------------------
  302|     59|            || (sparamfncnt != 0 && sparamfncnt != 2)
  ------------------
  |  Branch (302:17): [True: 59, False: 0]
  |  Branch (302:37): [True: 0, False: 59]
  ------------------
  303|     59|            || (gmdparamfncnt != 0 && gmdparamfncnt != 2)
  ------------------
  |  Branch (303:17): [True: 4, False: 55]
  |  Branch (303:39): [True: 0, False: 4]
  ------------------
  304|     59|            || (smdparamfncnt != 0 && smdparamfncnt != 2))) {
  ------------------
  |  Branch (304:17): [True: 4, False: 55]
  |  Branch (304:39): [True: 0, False: 4]
  ------------------
  305|       |        /*
  306|       |         * Params functions are optional, but if defined, they must
  307|       |         * be pairwise complete sets, i.e. a getter must have an
  308|       |         * associated gettable, etc
  309|       |         */
  310|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  311|      0|                       "missing %s params getter or setter:%s", signature->type_name, desc);
  312|      0|        valid = 0;
  313|      0|    }
  314|     59|    if (valid && initfncnt == 0) {
  ------------------
  |  Branch (314:9): [True: 59, False: 0]
  |  Branch (314:18): [True: 0, False: 59]
  ------------------
  315|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  316|      0|                       "missing %s init:%s", signature->type_name, desc);
  317|      0|        valid = 0;
  318|      0|    }
  319|       |
  320|       |    /* Now we check for function combinations */
  321|     59|    if (valid
  ------------------
  |  Branch (321:9): [True: 59, False: 0]
  ------------------
  322|     59|        && ((signature->sign_init != NULL
  ------------------
  |  Branch (322:14): [True: 40, False: 19]
  ------------------
  323|     59|             && signature->sign == NULL)
  ------------------
  |  Branch (323:17): [True: 0, False: 40]
  ------------------
  324|     59|            || (signature->sign_message_init != NULL
  ------------------
  |  Branch (324:17): [True: 51, False: 8]
  ------------------
  325|     59|                && signature->sign == NULL
  ------------------
  |  Branch (325:20): [True: 0, False: 51]
  ------------------
  326|     59|                && (signature->sign_message_update == NULL
  ------------------
  |  Branch (326:21): [True: 0, False: 0]
  ------------------
  327|      0|                    || signature->sign_message_final == NULL)))) {
  ------------------
  |  Branch (327:24): [True: 0, False: 0]
  ------------------
  328|       |        /* sign_init function(s) with no signing function?  That's weird */
  329|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  330|      0|                       "missing %s signing function:%s", signature->type_name, desc);
  331|      0|        valid = 0;
  332|      0|    }
  333|     59|    if (valid
  ------------------
  |  Branch (333:9): [True: 59, False: 0]
  ------------------
  334|     59|        && (signature->sign != NULL
  ------------------
  |  Branch (334:13): [True: 55, False: 4]
  ------------------
  335|     59|            || signature->sign_message_update != NULL
  ------------------
  |  Branch (335:16): [True: 0, False: 4]
  ------------------
  336|     59|            || signature->sign_message_final != NULL)
  ------------------
  |  Branch (336:16): [True: 0, False: 4]
  ------------------
  337|     59|        && signature->sign_init == NULL
  ------------------
  |  Branch (337:12): [True: 15, False: 40]
  ------------------
  338|     59|        && signature->sign_message_init == NULL) {
  ------------------
  |  Branch (338:12): [True: 0, False: 15]
  ------------------
  339|       |        /* signing function(s) with no sign_init? That's odd */
  340|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  341|      0|                       "missing %s sign_init or sign_message_init:%s", signature->type_name, desc);
  342|      0|        valid = 0;
  343|      0|    }
  344|       |
  345|     59|    if (valid
  ------------------
  |  Branch (345:9): [True: 59, False: 0]
  ------------------
  346|     59|        && ((signature->verify_init != NULL
  ------------------
  |  Branch (346:14): [True: 40, False: 19]
  ------------------
  347|     59|             && signature->verify == NULL)
  ------------------
  |  Branch (347:17): [True: 0, False: 40]
  ------------------
  348|     59|            || (signature->verify_message_init != NULL
  ------------------
  |  Branch (348:17): [True: 51, False: 8]
  ------------------
  349|     59|                && signature->verify == NULL
  ------------------
  |  Branch (349:20): [True: 0, False: 51]
  ------------------
  350|     59|                && (signature->verify_message_update == NULL
  ------------------
  |  Branch (350:21): [True: 0, False: 0]
  ------------------
  351|      0|                    || signature->verify_message_final == NULL)))) {
  ------------------
  |  Branch (351:24): [True: 0, False: 0]
  ------------------
  352|       |        /* verify_init function(s) with no verification function?  That's weird */
  353|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  354|      0|                       "missing %s verification function:%s", signature->type_name, desc);
  355|      0|        valid = 0;
  356|      0|    }
  357|     59|    if (valid
  ------------------
  |  Branch (357:9): [True: 59, False: 0]
  ------------------
  358|     59|        && (signature->verify != NULL
  ------------------
  |  Branch (358:13): [True: 55, False: 4]
  ------------------
  359|     59|            || signature->verify_message_update != NULL
  ------------------
  |  Branch (359:16): [True: 0, False: 4]
  ------------------
  360|     59|            || signature->verify_message_final != NULL)
  ------------------
  |  Branch (360:16): [True: 0, False: 4]
  ------------------
  361|     59|        && signature->verify_init == NULL
  ------------------
  |  Branch (361:12): [True: 15, False: 40]
  ------------------
  362|     59|            && signature->verify_message_init == NULL) {
  ------------------
  |  Branch (362:16): [True: 0, False: 15]
  ------------------
  363|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  364|      0|                       "missing %s verify_init or verify_message_init:%s",
  365|      0|                       signature->type_name, desc);
  366|       |        /* verification function(s) with no verify_init? That's odd */
  367|      0|        valid = 0;
  368|      0|    }
  369|       |
  370|     59|    if (valid
  ------------------
  |  Branch (370:9): [True: 59, False: 0]
  ------------------
  371|     59|        && (signature->verify_recover_init != NULL)
  ------------------
  |  Branch (371:12): [True: 14, False: 45]
  ------------------
  372|     59|            && (signature->verify_recover == NULL)) {
  ------------------
  |  Branch (372:16): [True: 0, False: 14]
  ------------------
  373|       |        /* verify_recover_init function with no verify_recover?  How quaint */
  374|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  375|      0|                       "missing %s verify_recover:%s", signature->type_name, desc);
  376|      0|        valid = 0;
  377|      0|    }
  378|       |
  379|     59|    if (valid
  ------------------
  |  Branch (379:9): [True: 59, False: 0]
  ------------------
  380|     59|        && (signature->digest_sign_init != NULL
  ------------------
  |  Branch (380:13): [True: 25, False: 34]
  ------------------
  381|     59|            && signature->digest_sign == NULL
  ------------------
  |  Branch (381:16): [True: 8, False: 17]
  ------------------
  382|     59|            && (signature->digest_sign_update == NULL
  ------------------
  |  Branch (382:17): [True: 0, False: 8]
  ------------------
  383|      8|                || signature->digest_sign_final == NULL))) {
  ------------------
  |  Branch (383:20): [True: 0, False: 8]
  ------------------
  384|       |        /* You can't have a digest_sign_init without *some* performing functions */
  385|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  386|      0|                       "missing %s digest_sign function:%s", signature->type_name, desc);
  387|      0|        valid = 0;
  388|      0|    }
  389|       |
  390|     59|    if (valid
  ------------------
  |  Branch (390:9): [True: 59, False: 0]
  ------------------
  391|     59|        && ((signature->digest_verify_init != NULL
  ------------------
  |  Branch (391:14): [True: 21, False: 38]
  ------------------
  392|     59|             && signature->digest_verify == NULL
  ------------------
  |  Branch (392:17): [True: 4, False: 17]
  ------------------
  393|     59|             && (signature->digest_verify_update == NULL
  ------------------
  |  Branch (393:18): [True: 0, False: 4]
  ------------------
  394|      4|                 || signature->digest_verify_final == NULL)))) {
  ------------------
  |  Branch (394:21): [True: 0, False: 4]
  ------------------
  395|       |        /* You can't have a digest_verify_init without *some* performing functions */
  396|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  397|      0|                       "missing %s digest_verify function:%s", signature->type_name, desc);
  398|      0|        valid = 0;
  399|      0|    }
  400|       |
  401|     59|    if (!valid)
  ------------------
  |  Branch (401:9): [True: 0, False: 59]
  ------------------
  402|      0|        goto err;
  403|       |
  404|     59|    if ((signature->digest_sign != NULL
  ------------------
  |  Branch (404:10): [True: 17, False: 42]
  ------------------
  405|     59|         || signature->digest_sign_update != NULL
  ------------------
  |  Branch (405:13): [True: 8, False: 34]
  ------------------
  406|     59|         || signature->digest_sign_final != NULL)
  ------------------
  |  Branch (406:13): [True: 0, False: 34]
  ------------------
  407|     59|        && signature->digest_sign_init == NULL) {
  ------------------
  |  Branch (407:12): [True: 0, False: 25]
  ------------------
  408|       |        /* digest signing function(s) with no digest_sign_init? That's odd */
  409|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  410|      0|                       "missing %s digest_sign_init:%s", signature->type_name, desc);
  411|      0|        goto err;
  412|      0|    }
  413|       |
  414|     59|    if ((signature->digest_verify != NULL
  ------------------
  |  Branch (414:10): [True: 17, False: 42]
  ------------------
  415|     59|         || signature->digest_verify_update != NULL
  ------------------
  |  Branch (415:13): [True: 4, False: 38]
  ------------------
  416|     59|         || signature->digest_verify_final != NULL)
  ------------------
  |  Branch (416:13): [True: 0, False: 38]
  ------------------
  417|     59|        && signature->digest_verify_init == NULL) {
  ------------------
  |  Branch (417:12): [True: 0, False: 21]
  ------------------
  418|       |        /* digest verification function(s) with no digest_verify_init? That's odd */
  419|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  420|      0|                       "missing %s digest_verify_init:%s", signature->type_name, desc);
  421|      0|        goto err;
  422|      0|    }
  423|       |
  424|     59|    if ((signature->sign_message_update == NULL) !=
  ------------------
  |  Branch (424:9): [True: 0, False: 59]
  ------------------
  425|     59|        (signature->sign_message_final == NULL)) {
  426|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  427|      0|                       "only one of %s message signing update and final available:%s",
  428|      0|                       signature->type_name, desc);
  429|      0|        goto err;
  430|      0|    }
  431|     59|    if ((signature->verify_message_update == NULL) !=
  ------------------
  |  Branch (431:9): [True: 0, False: 59]
  ------------------
  432|     59|        (signature->verify_message_final == NULL)) {
  433|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  434|      0|                       "only one of %s message verification update and final available:%s",
  435|      0|                       signature->type_name, desc);
  436|      0|        goto err;
  437|      0|    }
  438|     59|    if ((signature->digest_sign_update == NULL) !=
  ------------------
  |  Branch (438:9): [True: 0, False: 59]
  ------------------
  439|     59|        (signature->digest_sign_final == NULL)) {
  440|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  441|      0|                       "only one of %s digest signing update and final available:%s",
  442|      0|                       signature->type_name, desc);
  443|      0|        goto err;
  444|      0|    }
  445|     59|    if ((signature->digest_verify_update == NULL) !=
  ------------------
  |  Branch (445:9): [True: 0, False: 59]
  ------------------
  446|     59|        (signature->digest_verify_final == NULL)) {
  447|      0|        ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                      ERR_raise_data(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS,
  ------------------
  |  |   72|      0|# define EVP_R_INVALID_PROVIDER_FUNCTIONS                 193
  ------------------
  448|      0|                       "only one of %s digest verification update and final available:%s",
  449|      0|                       signature->type_name, desc);
  450|      0|        goto err;
  451|      0|    }
  452|       |
  453|     59|    return signature;
  454|      0| err:
  455|      0|    EVP_SIGNATURE_free(signature);
  456|      0|    return NULL;
  457|     59|}
signature.c:evp_signature_new:
   34|     59|{
   35|     59|    EVP_SIGNATURE *signature = OPENSSL_zalloc(sizeof(EVP_SIGNATURE));
  ------------------
  |  |  104|     59|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     59|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     59|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|       |
   37|     59|    if (signature == NULL)
  ------------------
  |  Branch (37:9): [True: 0, False: 59]
  ------------------
   38|      0|        return NULL;
   39|       |
   40|     59|    if (!CRYPTO_NEW_REF(&signature->refcnt, 1)
  ------------------
  |  Branch (40:9): [True: 0, False: 59]
  ------------------
   41|     59|        || !ossl_provider_up_ref(prov)) {
  ------------------
  |  Branch (41:12): [True: 0, False: 59]
  ------------------
   42|      0|        CRYPTO_FREE_REF(&signature->refcnt);
   43|      0|        OPENSSL_free(signature);
  ------------------
  |  |  115|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|      0|        return NULL;
   45|      0|    }
   46|       |
   47|     59|    signature->prov = prov;
   48|       |
   49|     59|    return signature;
   50|     59|}
signature.c:evp_signature_up_ref:
   29|    404|{
   30|    404|    return EVP_SIGNATURE_up_ref(data);
   31|    404|}
signature.c:evp_signature_free:
   24|    130|{
   25|    130|    EVP_SIGNATURE_free(data);
   26|    130|}
signature.c:evp_pkey_signature_init:
  575|    639|{
  576|    639|    const char *desc;
  577|    639|    int ret = 0;
  578|    639|    void *provkey = NULL;
  579|    639|    EVP_KEYMGMT *tmp_keymgmt = NULL;
  580|    639|    const OSSL_PROVIDER *tmp_prov = NULL;
  581|    639|    const char *supported_sig = NULL;
  582|    639|    int iter;
  583|       |
  584|    639|    if (ctx == NULL) {
  ------------------
  |  Branch (584:9): [True: 0, False: 639]
  ------------------
  585|      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)
  |  |  ------------------
  ------------------
  586|      0|        return -1;
  587|      0|    }
  588|       |
  589|    639|    evp_pkey_ctx_free_old_ops(ctx);
  590|    639|    ctx->operation = operation;
  591|       |
  592|    639|    if (signature != NULL) {
  ------------------
  |  Branch (592:9): [True: 639, False: 0]
  ------------------
  593|       |        /*
  594|       |         * It's important to figure out what the key type should be, and if
  595|       |         * that is what we have in ctx.
  596|       |         */
  597|       |
  598|    639|        EVP_KEYMGMT *tmp_keymgmt_tofree = NULL;
  599|       |
  600|    639|        if (ctx->pkey == NULL) {
  ------------------
  |  Branch (600:13): [True: 0, False: 639]
  ------------------
  601|      0|            ERR_raise(ERR_LIB_EVP, EVP_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)
  |  |  ------------------
  ------------------
  602|      0|            goto err;
  603|      0|        }
  604|       |
  605|       |        /*
  606|       |         * Ensure that the key is provided, either natively, or as a
  607|       |         * cached export.  We start by fetching the keymgmt with the same
  608|       |         * name as |ctx->pkey|, but from the provider of the signature
  609|       |         * method, using the same property query as when fetching the
  610|       |         * signature method.  With the keymgmt we found (if we did), we
  611|       |         * try to export |ctx->pkey| to it (evp_pkey_export_to_provider()
  612|       |         * is smart enough to only actually export it if |tmp_keymgmt|
  613|       |         * is different from |ctx->pkey|'s keymgmt)
  614|       |         */
  615|    639|        tmp_prov = EVP_SIGNATURE_get0_provider(signature);
  616|    639|        tmp_keymgmt_tofree = tmp_keymgmt =
  617|    639|            evp_keymgmt_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  618|    639|                                        EVP_KEYMGMT_get0_name(ctx->keymgmt),
  619|    639|                                        ctx->propquery);
  620|    639|        if (tmp_keymgmt != NULL)
  ------------------
  |  Branch (620:13): [True: 639, False: 0]
  ------------------
  621|    639|            provkey = evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
  622|    639|                                                  &tmp_keymgmt, ctx->propquery);
  623|    639|        if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (623:13): [True: 0, False: 639]
  ------------------
  624|      0|            EVP_KEYMGMT_free(tmp_keymgmt_tofree);
  625|       |
  626|    639|        if (provkey == NULL)
  ------------------
  |  Branch (626:13): [True: 0, False: 639]
  ------------------
  627|      0|            goto end;
  628|       |
  629|       |        /*
  630|       |         * Check that the signature matches the given key.  This is not
  631|       |         * designed to work with legacy keys, so has to be done after we've
  632|       |         * ensured that the key is at least exported to a provider (above).
  633|       |         */
  634|    639|        if (signature->query_key_types != NULL) {
  ------------------
  |  Branch (634:13): [True: 0, False: 639]
  ------------------
  635|       |            /* This is expected to be a NULL-terminated array */
  636|      0|            const char **keytypes;
  637|       |
  638|      0|            keytypes = signature->query_key_types();
  639|      0|            for (; *keytypes != NULL; keytypes++)
  ------------------
  |  Branch (639:20): [True: 0, False: 0]
  ------------------
  640|      0|                if (EVP_PKEY_CTX_is_a(ctx, *keytypes))
  ------------------
  |  Branch (640:21): [True: 0, False: 0]
  ------------------
  641|      0|                    break;
  642|      0|            if (*keytypes == NULL) {
  ------------------
  |  Branch (642:17): [True: 0, False: 0]
  ------------------
  643|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_SIGNATURE_TYPE_AND_KEY_TYPE_INCOMPATIBLE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  644|      0|                return -2;
  645|      0|            }
  646|    639|        } else {
  647|       |            /*
  648|       |             * Fallback 1:
  649|       |             * check if the keytype is the same as the signature algorithm name
  650|       |             */
  651|    639|            const char *keytype = EVP_KEYMGMT_get0_name(ctx->keymgmt);
  652|    639|            int ok = EVP_SIGNATURE_is_a(signature, keytype);
  653|       |
  654|       |            /*
  655|       |             * Fallback 2:
  656|       |             * query the pkey for a default signature algorithm name, and check
  657|       |             * if it matches the signature implementation
  658|       |             */
  659|    639|            if (!ok) {
  ------------------
  |  Branch (659:17): [True: 0, False: 639]
  ------------------
  660|      0|                const char *signame
  661|      0|                    = evp_keymgmt_util_query_operation_name(ctx->keymgmt,
  662|      0|                                                            OSSL_OP_SIGNATURE);
  ------------------
  |  |  317|      0|# define OSSL_OP_SIGNATURE                          12
  ------------------
  663|       |
  664|      0|                ok = EVP_SIGNATURE_is_a(signature, signame);
  665|      0|            }
  666|       |
  667|       |            /* If none of the fallbacks helped, we're lost */
  668|    639|            if (!ok) {
  ------------------
  |  Branch (668:17): [True: 0, False: 639]
  ------------------
  669|      0|                ERR_raise(ERR_LIB_EVP, EVP_R_SIGNATURE_TYPE_AND_KEY_TYPE_INCOMPATIBLE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  670|      0|                return -2;
  671|      0|            }
  672|    639|        }
  673|       |
  674|    639|        if (!EVP_SIGNATURE_up_ref(signature))
  ------------------
  |  Branch (674:13): [True: 0, False: 639]
  ------------------
  675|      0|            return 0;
  676|    639|    } else {
  677|       |        /* Without a pre-fetched signature, it must be figured out somehow */
  678|      0|        ERR_set_mark();
  679|       |
  680|      0|        if (evp_pkey_ctx_is_legacy(ctx))
  ------------------
  |  |   36|      0|    ((ctx)->keymgmt == NULL)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  681|      0|            goto legacy;
  682|       |
  683|      0|        if (ctx->pkey == NULL) {
  ------------------
  |  Branch (683:13): [True: 0, False: 0]
  ------------------
  684|      0|            ERR_clear_last_mark();
  685|      0|            ERR_raise(ERR_LIB_EVP, EVP_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)
  |  |  ------------------
  ------------------
  686|      0|            goto err;
  687|      0|        }
  688|       |
  689|       |        /*
  690|       |         * Try to derive the supported signature from |ctx->keymgmt|.
  691|       |         */
  692|      0|        if (!ossl_assert(ctx->pkey->keymgmt == NULL
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  |  Branch (52:43): [True: 0, False: 0]
  |  |  ------------------
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (692:13): [True: 0, False: 0]
  ------------------
  693|      0|                         || ctx->pkey->keymgmt == ctx->keymgmt)) {
  694|      0|            ERR_clear_last_mark();
  695|      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)
  |  |  ------------------
  ------------------
  696|      0|            goto err;
  697|      0|        }
  698|      0|        supported_sig
  699|      0|            = evp_keymgmt_util_query_operation_name(ctx->keymgmt,
  700|      0|                                                    OSSL_OP_SIGNATURE);
  ------------------
  |  |  317|      0|# define OSSL_OP_SIGNATURE                          12
  ------------------
  701|      0|        if (supported_sig == NULL) {
  ------------------
  |  Branch (701:13): [True: 0, False: 0]
  ------------------
  702|      0|            ERR_clear_last_mark();
  703|      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)
  |  |  ------------------
  ------------------
  704|      0|            goto err;
  705|      0|        }
  706|       |
  707|       |        /*
  708|       |         * We perform two iterations:
  709|       |         *
  710|       |         * 1.  Do the normal signature fetch, using the fetching data given by
  711|       |         *     the EVP_PKEY_CTX.
  712|       |         * 2.  Do the provider specific signature fetch, from the same provider
  713|       |         *     as |ctx->keymgmt|
  714|       |         *
  715|       |         * We then try to fetch the keymgmt from the same provider as the
  716|       |         * signature, and try to export |ctx->pkey| to that keymgmt (when
  717|       |         * this keymgmt happens to be the same as |ctx->keymgmt|, the export
  718|       |         * is a no-op, but we call it anyway to not complicate the code even
  719|       |         * more).
  720|       |         * If the export call succeeds (returns a non-NULL provider key pointer),
  721|       |         * we're done and can perform the operation itself.  If not, we perform
  722|       |         * the second iteration, or jump to legacy.
  723|       |         */
  724|      0|        for (iter = 1; iter < 3 && provkey == NULL; iter++) {
  ------------------
  |  Branch (724:24): [True: 0, False: 0]
  |  Branch (724:36): [True: 0, False: 0]
  ------------------
  725|      0|            EVP_KEYMGMT *tmp_keymgmt_tofree = NULL;
  726|       |
  727|       |            /*
  728|       |             * If we're on the second iteration, free the results from the first.
  729|       |             * They are NULL on the first iteration, so no need to check what
  730|       |             * iteration we're on.
  731|       |             */
  732|      0|            EVP_SIGNATURE_free(signature);
  733|      0|            EVP_KEYMGMT_free(tmp_keymgmt);
  734|       |
  735|      0|            switch (iter) {
  ------------------
  |  Branch (735:21): [True: 0, False: 0]
  ------------------
  736|      0|            case 1:
  ------------------
  |  Branch (736:13): [True: 0, False: 0]
  ------------------
  737|      0|                signature =
  738|      0|                    EVP_SIGNATURE_fetch(ctx->libctx, supported_sig, ctx->propquery);
  739|      0|                if (signature != NULL)
  ------------------
  |  Branch (739:21): [True: 0, False: 0]
  ------------------
  740|      0|                    tmp_prov = EVP_SIGNATURE_get0_provider(signature);
  741|      0|                break;
  742|      0|            case 2:
  ------------------
  |  Branch (742:13): [True: 0, False: 0]
  ------------------
  743|      0|                tmp_prov = EVP_KEYMGMT_get0_provider(ctx->keymgmt);
  744|      0|                signature =
  745|      0|                    evp_signature_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  746|      0|                                                  supported_sig, ctx->propquery);
  747|      0|                if (signature == NULL)
  ------------------
  |  Branch (747:21): [True: 0, False: 0]
  ------------------
  748|      0|                    goto legacy;
  749|      0|                break;
  750|      0|            }
  751|      0|            if (signature == NULL)
  ------------------
  |  Branch (751:17): [True: 0, False: 0]
  ------------------
  752|      0|                continue;
  753|       |
  754|       |            /*
  755|       |             * Ensure that the key is provided, either natively, or as a
  756|       |             * cached export.  We start by fetching the keymgmt with the same
  757|       |             * name as |ctx->pkey|, but from the provider of the signature
  758|       |             * method, using the same property query as when fetching the
  759|       |             * signature method.  With the keymgmt we found (if we did), we
  760|       |             * try to export |ctx->pkey| to it (evp_pkey_export_to_provider()
  761|       |             * is smart enough to only actually export it if |tmp_keymgmt|
  762|       |             * is different from |ctx->pkey|'s keymgmt)
  763|       |             */
  764|      0|            tmp_keymgmt_tofree = tmp_keymgmt =
  765|      0|                evp_keymgmt_fetch_from_prov((OSSL_PROVIDER *)tmp_prov,
  766|      0|                                            EVP_KEYMGMT_get0_name(ctx->keymgmt),
  767|      0|                                            ctx->propquery);
  768|      0|            if (tmp_keymgmt != NULL)
  ------------------
  |  Branch (768:17): [True: 0, False: 0]
  ------------------
  769|      0|                provkey = evp_pkey_export_to_provider(ctx->pkey, ctx->libctx,
  770|      0|                                                      &tmp_keymgmt, ctx->propquery);
  771|      0|            if (tmp_keymgmt == NULL)
  ------------------
  |  Branch (771:17): [True: 0, False: 0]
  ------------------
  772|      0|                EVP_KEYMGMT_free(tmp_keymgmt_tofree);
  773|      0|        }
  774|       |
  775|      0|        if (provkey == NULL) {
  ------------------
  |  Branch (775:13): [True: 0, False: 0]
  ------------------
  776|      0|            EVP_SIGNATURE_free(signature);
  777|      0|            goto legacy;
  778|      0|        }
  779|       |
  780|      0|        ERR_pop_to_mark();
  781|      0|    }
  782|       |
  783|       |    /* No more legacy from here down to legacy: */
  784|       |
  785|    639|    ctx->op.sig.signature = signature;
  786|    639|    desc = signature->description != NULL ? signature->description : "";
  ------------------
  |  Branch (786:12): [True: 639, False: 0]
  ------------------
  787|       |
  788|    639|    ctx->op.sig.algctx =
  789|    639|        signature->newctx(ossl_provider_ctx(signature->prov), ctx->propquery);
  790|    639|    if (ctx->op.sig.algctx == NULL) {
  ------------------
  |  Branch (790:9): [True: 0, False: 639]
  ------------------
  791|       |        /* The provider key can stay in the cache */
  792|      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)
  |  |  ------------------
  ------------------
  793|      0|        goto err;
  794|      0|    }
  795|       |
  796|    639|    switch (operation) {
  797|      0|    case EVP_PKEY_OP_SIGN:
  ------------------
  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  |  Branch (797:5): [True: 0, False: 639]
  ------------------
  798|      0|        if (signature->sign_init == NULL) {
  ------------------
  |  Branch (798:13): [True: 0, False: 0]
  ------------------
  799|      0|            ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
  800|      0|                           "%s sign_init:%s", signature->type_name, desc);
  801|      0|            ret = -2;
  802|      0|            goto err;
  803|      0|        }
  804|      0|        ret = signature->sign_init(ctx->op.sig.algctx, provkey, params);
  805|      0|        break;
  806|    333|    case EVP_PKEY_OP_SIGNMSG:
  ------------------
  |  | 1758|    333|# define EVP_PKEY_OP_SIGNMSG             (1 << 14)
  ------------------
  |  Branch (806:5): [True: 333, False: 306]
  ------------------
  807|    333|        if (signature->sign_message_init == NULL) {
  ------------------
  |  Branch (807:13): [True: 0, False: 333]
  ------------------
  808|      0|            ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
  809|      0|                           "%s sign_message_init:%s", signature->type_name, desc);
  810|      0|            ret = -2;
  811|      0|            goto err;
  812|      0|        }
  813|    333|        ret = signature->sign_message_init(ctx->op.sig.algctx, provkey, params);
  814|    333|        break;
  815|      0|    case EVP_PKEY_OP_VERIFY:
  ------------------
  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  |  Branch (815:5): [True: 0, False: 639]
  ------------------
  816|      0|        if (signature->verify_init == NULL) {
  ------------------
  |  Branch (816:13): [True: 0, False: 0]
  ------------------
  817|      0|            ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
  818|      0|                           "%s verify_init:%s", signature->type_name, desc);
  819|      0|            ret = -2;
  820|      0|            goto err;
  821|      0|        }
  822|      0|        ret = signature->verify_init(ctx->op.sig.algctx, provkey, params);
  823|      0|        break;
  824|    306|    case EVP_PKEY_OP_VERIFYMSG:
  ------------------
  |  | 1759|    306|# define EVP_PKEY_OP_VERIFYMSG           (1 << 15)
  ------------------
  |  Branch (824:5): [True: 306, False: 333]
  ------------------
  825|    306|        if (signature->verify_message_init == NULL) {
  ------------------
  |  Branch (825:13): [True: 0, False: 306]
  ------------------
  826|      0|            ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
  827|      0|                           "%s verify_message_init:%s", signature->type_name, desc);
  828|      0|            ret = -2;
  829|      0|            goto err;
  830|      0|        }
  831|    306|        ret = signature->verify_message_init(ctx->op.sig.algctx, provkey, params);
  832|    306|        break;
  833|      0|    case EVP_PKEY_OP_VERIFYRECOVER:
  ------------------
  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  ------------------
  |  Branch (833:5): [True: 0, False: 639]
  ------------------
  834|      0|        if (signature->verify_recover_init == NULL) {
  ------------------
  |  Branch (834:13): [True: 0, False: 0]
  ------------------
  835|      0|            ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  ------------------
  |  |  405|      0|     ERR_set_error)
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |   76|      0|# define ERR_LIB_EVP             6
  ------------------
                          ERR_raise_data(ERR_LIB_EVP, EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED,
  ------------------
  |  |  112|      0|# define EVP_R_PROVIDER_SIGNATURE_NOT_SUPPORTED           237
  ------------------
  836|      0|                           "%s verify_recover_init:%s", signature->type_name, desc);
  837|      0|            ret = -2;
  838|      0|            goto err;
  839|      0|        }
  840|      0|        ret = signature->verify_recover_init(ctx->op.sig.algctx, provkey, params);
  841|      0|        break;
  842|      0|    default:
  ------------------
  |  Branch (842:5): [True: 0, False: 639]
  ------------------
  843|      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)
  |  |  ------------------
  ------------------
  844|      0|        goto err;
  845|    639|    }
  846|       |
  847|    639|    if (ret <= 0) {
  ------------------
  |  Branch (847:9): [True: 27, False: 612]
  ------------------
  848|     27|        signature->freectx(ctx->op.sig.algctx);
  849|     27|        ctx->op.sig.algctx = NULL;
  850|     27|        goto err;
  851|     27|    }
  852|    612|    goto end;
  853|       |
  854|    612| legacy:
  855|       |    /*
  856|       |     * If we don't have the full support we need with provided methods,
  857|       |     * let's go see if legacy does.
  858|       |     */
  859|      0|    ERR_pop_to_mark();
  860|      0|    EVP_KEYMGMT_free(tmp_keymgmt);
  861|      0|    tmp_keymgmt = NULL;
  862|       |
  863|      0|    if (ctx->pmeth == NULL
  ------------------
  |  Branch (863:9): [True: 0, False: 0]
  ------------------
  864|      0|            || (operation == EVP_PKEY_OP_SIGN && ctx->pmeth->sign == NULL)
  ------------------
  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  |  Branch (864:17): [True: 0, False: 0]
  |  Branch (864:50): [True: 0, False: 0]
  ------------------
  865|      0|            || (operation == EVP_PKEY_OP_VERIFY && ctx->pmeth->verify == NULL)
  ------------------
  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  |  Branch (865:17): [True: 0, False: 0]
  |  Branch (865:52): [True: 0, False: 0]
  ------------------
  866|      0|            || (operation == EVP_PKEY_OP_VERIFYRECOVER
  ------------------
  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  ------------------
  |  Branch (866:17): [True: 0, False: 0]
  ------------------
  867|      0|                && ctx->pmeth->verify_recover == NULL)) {
  ------------------
  |  Branch (867:20): [True: 0, False: 0]
  ------------------
  868|      0|        ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  869|      0|        return -2;
  870|      0|    }
  871|       |
  872|      0|    switch (operation) {
  873|      0|    case EVP_PKEY_OP_SIGN:
  ------------------
  |  | 1748|      0|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  |  Branch (873:5): [True: 0, False: 0]
  ------------------
  874|      0|        if (ctx->pmeth->sign_init == NULL)
  ------------------
  |  Branch (874:13): [True: 0, False: 0]
  ------------------
  875|      0|            return 1;
  876|      0|        ret = ctx->pmeth->sign_init(ctx);
  877|      0|        break;
  878|      0|    case EVP_PKEY_OP_VERIFY:
  ------------------
  |  | 1749|      0|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  |  Branch (878:5): [True: 0, False: 0]
  ------------------
  879|      0|        if (ctx->pmeth->verify_init == NULL)
  ------------------
  |  Branch (879:13): [True: 0, False: 0]
  ------------------
  880|      0|            return 1;
  881|      0|        ret = ctx->pmeth->verify_init(ctx);
  882|      0|        break;
  883|      0|    case EVP_PKEY_OP_VERIFYRECOVER:
  ------------------
  |  | 1750|      0|# define EVP_PKEY_OP_VERIFYRECOVER       (1 << 6)
  ------------------
  |  Branch (883:5): [True: 0, False: 0]
  ------------------
  884|      0|        if (ctx->pmeth->verify_recover_init == NULL)
  ------------------
  |  Branch (884:13): [True: 0, False: 0]
  ------------------
  885|      0|            return 1;
  886|      0|        ret = ctx->pmeth->verify_recover_init(ctx);
  887|      0|        break;
  888|      0|    default:
  ------------------
  |  Branch (888:5): [True: 0, False: 0]
  ------------------
  889|      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)
  |  |  ------------------
  ------------------
  890|      0|        goto err;
  891|      0|    }
  892|      0|    if (ret <= 0)
  ------------------
  |  Branch (892:9): [True: 0, False: 0]
  ------------------
  893|      0|        goto err;
  894|    612| end:
  895|    612|#ifndef FIPS_MODULE
  896|    612|    if (ret > 0)
  ------------------
  |  Branch (896:9): [True: 612, False: 0]
  ------------------
  897|    612|        ret = evp_pkey_ctx_use_cached_data(ctx);
  898|    612|#endif
  899|       |
  900|    612|    EVP_KEYMGMT_free(tmp_keymgmt);
  901|    612|    return ret;
  902|     27| err:
  903|     27|    evp_pkey_ctx_free_old_ops(ctx);
  904|     27|    ctx->operation = EVP_PKEY_OP_UNDEFINED;
  ------------------
  |  | 1744|     27|# define EVP_PKEY_OP_UNDEFINED           0
  ------------------
  905|     27|    EVP_KEYMGMT_free(tmp_keymgmt);
  906|     27|    return ret;
  907|      0|}

ossl_do_ex_data_init:
   15|      1|{
   16|      1|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      1|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 1]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      1|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|      1|    return global->ex_data_lock != NULL;
   23|      1|}
ossl_crypto_cleanup_all_ex_data_int:
   73|      1|{
   74|      1|    int i;
   75|      1|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   76|       |
   77|      1|    if (global == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 1]
  ------------------
   78|      0|        return;
   79|       |
   80|     19|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  248|     19|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (80:17): [True: 18, False: 1]
  ------------------
   81|     18|        EX_CALLBACKS *ip = &global->ex_data[i];
   82|       |
   83|     18|        sk_EX_CALLBACK_pop_free(ip->meth, cleanup_cb);
   84|     18|        ip->meth = NULL;
   85|     18|    }
   86|       |
   87|      1|    CRYPTO_THREAD_lock_free(global->ex_data_lock);
   88|      1|    global->ex_data_lock = NULL;
   89|      1|}
ossl_crypto_new_ex_data_ex:
  221|    639|{
  222|    639|    int mx, i;
  223|    639|    void *ptr;
  224|    639|    EX_CALLBACK **storage = NULL;
  225|    639|    EX_CALLBACK *stack[10];
  226|    639|    EX_CALLBACKS *ip;
  227|    639|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|    639|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 639]
  ------------------
  230|      0|        return 0;
  231|       |
  232|    639|    ip = get_and_lock(global, class_index, 1);
  233|    639|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 639]
  ------------------
  234|      0|        return 0;
  235|       |
  236|    639|    ad->ctx = ctx;
  237|    639|    ad->sk = NULL;
  238|    639|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|    639|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 639]
  ------------------
  240|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            storage = stack;
  242|      0|        else
  243|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  244|      0|        if (storage != NULL)
  ------------------
  |  Branch (244:13): [True: 0, False: 0]
  ------------------
  245|      0|            for (i = 0; i < mx; i++)
  ------------------
  |  Branch (245:25): [True: 0, False: 0]
  ------------------
  246|      0|                storage[i] = sk_EX_CALLBACK_value(ip->meth, i);
  247|      0|    }
  248|    639|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|    639|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 639]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|    639|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 639]
  ------------------
  253|      0|        if (storage[i] != NULL && storage[i]->new_func != NULL) {
  ------------------
  |  Branch (253:13): [True: 0, False: 0]
  |  Branch (253:35): [True: 0, False: 0]
  ------------------
  254|      0|            ptr = CRYPTO_get_ex_data(ad, i);
  255|      0|            storage[i]->new_func(obj, ptr, ad, i,
  256|      0|                                 storage[i]->argl, storage[i]->argp);
  257|      0|        }
  258|      0|    }
  259|    639|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 639, False: 0]
  ------------------
  260|    639|        OPENSSL_free(storage);
  ------------------
  |  |  115|    639|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|    639|    return 1;
  262|    639|}
CRYPTO_new_ex_data:
  265|    639|{
  266|    639|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|    639|}
CRYPTO_free_ex_data:
  368|    639|{
  369|    639|    int mx, i;
  370|    639|    EX_CALLBACKS *ip;
  371|    639|    void *ptr;
  372|    639|    const EX_CALLBACK *f;
  373|    639|    struct ex_callback_entry stack[10];
  374|    639|    struct ex_callback_entry *storage = NULL;
  375|    639|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|    639|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 639]
  ------------------
  378|      0|        goto err;
  379|       |
  380|    639|    ip = get_and_lock(global, class_index, 1);
  381|    639|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 639]
  ------------------
  382|      0|        goto err;
  383|       |
  384|    639|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|    639|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 639]
  ------------------
  386|      0|        if (mx < (int)OSSL_NELEM(stack))
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  ------------------
  387|      0|            storage = stack;
  388|      0|        else
  389|      0|            storage = OPENSSL_malloc(sizeof(*storage) * mx);
  ------------------
  |  |  102|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  390|      0|        if (storage != NULL)
  ------------------
  |  Branch (390:13): [True: 0, False: 0]
  ------------------
  391|      0|            for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (391:25): [True: 0, False: 0]
  ------------------
  392|      0|                storage[i].excb = sk_EX_CALLBACK_value(ip->meth, i);
  393|      0|                storage[i].index = i;
  394|      0|            }
  395|      0|    }
  396|    639|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|    639|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 639]
  ------------------
  399|       |        /* Sort according to priority. High priority first */
  400|      0|        qsort(storage, mx, sizeof(*storage), ex_callback_compare);
  401|      0|        for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (401:21): [True: 0, False: 0]
  ------------------
  402|      0|            f = storage[i].excb;
  403|       |
  404|      0|            if (f != NULL && f->free_func != NULL) {
  ------------------
  |  Branch (404:17): [True: 0, False: 0]
  |  Branch (404:30): [True: 0, False: 0]
  ------------------
  405|      0|                ptr = CRYPTO_get_ex_data(ad, storage[i].index);
  406|      0|                f->free_func(obj, ptr, ad, storage[i].index, f->argl, f->argp);
  407|      0|            }
  408|      0|        }
  409|      0|    }
  410|       |
  411|    639|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 639, False: 0]
  ------------------
  412|    639|        OPENSSL_free(storage);
  ------------------
  |  |  115|    639|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|    639| err:
  414|    639|    sk_void_free(ad->sk);
  ------------------
  |  |  204|    639|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|    639|    ad->sk = NULL;
  416|    639|    ad->ctx = NULL;
  417|    639|}
ex_data.c:get_and_lock:
   33|  1.27k|{
   34|  1.27k|    EX_CALLBACKS *ip;
   35|       |
   36|  1.27k|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  248|  1.27k|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 1.27k]
  |  Branch (36:28): [True: 0, False: 1.27k]
  ------------------
   37|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|       |
   41|  1.27k|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 1.27k]
  ------------------
   42|       |        /*
   43|       |         * If we get here, someone (who?) cleaned up the lock, so just
   44|       |         * treat it as an error.
   45|       |         */
   46|      0|         return NULL;
   47|      0|    }
   48|       |
   49|  1.27k|    if (read) {
  ------------------
  |  Branch (49:9): [True: 1.27k, False: 0]
  ------------------
   50|  1.27k|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 1.27k]
  ------------------
   51|      0|            return NULL;
   52|  1.27k|    } else {
   53|      0|        if (!CRYPTO_THREAD_write_lock(global->ex_data_lock))
  ------------------
  |  Branch (53:13): [True: 0, False: 0]
  ------------------
   54|      0|            return NULL;
   55|      0|    }
   56|       |
   57|  1.27k|    ip = &global->ex_data[class_index];
   58|  1.27k|    return ip;
   59|  1.27k|}

ossl_safe_getenv:
   19|      1|{
   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|      1|#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
   92|      1|# if __GLIBC_PREREQ(2, 17)
   93|      1|#  define SECURE_GETENV
   94|      1|    return secure_getenv(name);
   95|      1|# endif
   96|      1|#endif
   97|       |
   98|       |#ifndef SECURE_GETENV
   99|       |    if (OPENSSL_issetugid())
  100|       |        return NULL;
  101|       |    return getenv(name);
  102|       |#endif
  103|      1|}

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

ossl_ht_new:
  176|      1|{
  177|      1|    HT *new = OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  178|       |
  179|      1|    if (new == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 1]
  ------------------
  180|      0|        return NULL;
  181|       |
  182|      1|    new->atomic_lock = CRYPTO_THREAD_lock_new();
  183|      1|    if (new->atomic_lock == NULL)
  ------------------
  |  Branch (183:9): [True: 0, False: 1]
  ------------------
  184|      0|        goto err;
  185|       |
  186|      1|    memcpy(&new->config, conf, sizeof(*conf));
  187|       |
  188|      1|    if (new->config.init_neighborhoods != 0) {
  ------------------
  |  Branch (188:9): [True: 1, False: 0]
  ------------------
  189|      1|        new->wpd.neighborhood_len = new->config.init_neighborhoods;
  190|       |        /* round up to the next power of 2 */
  191|      1|        new->wpd.neighborhood_len--;
  192|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 1;
  193|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 2;
  194|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 4;
  195|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 8;
  196|      1|        new->wpd.neighborhood_len |= new->wpd.neighborhood_len >> 16;
  197|      1|        new->wpd.neighborhood_len++;
  198|      1|    } 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|      1|    if (new->config.ht_free_fn == NULL)
  ------------------
  |  Branch (202:9): [True: 1, False: 0]
  ------------------
  203|      1|        new->config.ht_free_fn = internal_free_nop;
  204|       |
  205|      1|    new->md = OPENSSL_zalloc(sizeof(*new->md));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  206|      1|    if (new->md == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 1]
  ------------------
  207|      0|        goto err;
  208|       |
  209|      1|    new->md->neighborhoods =
  210|      1|        alloc_new_neighborhood_list(new->wpd.neighborhood_len,
  211|      1|                                    &new->md->neighborhood_ptr_to_free);
  212|      1|    if (new->md->neighborhoods == NULL)
  ------------------
  |  Branch (212:9): [True: 0, False: 1]
  ------------------
  213|      0|        goto err;
  214|      1|    new->md->neighborhood_mask = new->wpd.neighborhood_len - 1;
  215|       |
  216|      1|    new->lock = ossl_rcu_lock_new(1, conf->ctx);
  217|      1|    if (new->lock == NULL)
  ------------------
  |  Branch (217:9): [True: 0, False: 1]
  ------------------
  218|      0|        goto err;
  219|       |
  220|      1|    if (new->config.ht_hash_fn == NULL)
  ------------------
  |  Branch (220:9): [True: 1, False: 0]
  ------------------
  221|      1|        new->config.ht_hash_fn = ossl_fnv1a_hash;
  222|       |
  223|      1|    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|      1|}
ossl_ht_write_lock:
  246|      1|{
  247|      1|    ossl_rcu_write_lock(htable->lock);
  248|      1|    htable->wpd.need_sync = 0;
  249|      1|}
ossl_ht_write_unlock:
  252|      1|{
  253|      1|    int need_sync = htable->wpd.need_sync;
  254|       |
  255|      1|    htable->wpd.need_sync = 0;
  256|      1|    ossl_rcu_write_unlock(htable->lock);
  257|      1|    if (need_sync)
  ------------------
  |  Branch (257:9): [True: 1, False: 0]
  ------------------
  258|      1|        ossl_synchronize_rcu(htable->lock);
  259|      1|}
ossl_ht_free:
  320|      1|{
  321|      1|    if (h == NULL)
  ------------------
  |  Branch (321:9): [True: 0, False: 1]
  ------------------
  322|      0|        return;
  323|       |
  324|      1|    ossl_ht_write_lock(h);
  325|      1|    ossl_ht_flush_internal(h);
  326|      1|    ossl_ht_write_unlock(h);
  327|       |    /* Freeing the lock does a final sync for us */
  328|      1|    CRYPTO_THREAD_lock_free(h->atomic_lock);
  329|      1|    ossl_rcu_lock_free(h->lock);
  330|      1|    OPENSSL_free(h->md->neighborhood_ptr_to_free);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  331|      1|    OPENSSL_free(h->md);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  332|      1|    OPENSSL_free(h);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  333|      1|    return;
  334|      1|}
ossl_ht_insert:
  629|    600|{
  630|    600|    struct ht_internal_value_st *newval = NULL;
  631|    600|    uint64_t hash;
  632|    600|    int rc = 0;
  633|    600|    int i;
  634|       |
  635|    600|    if (data->value == NULL)
  ------------------
  |  Branch (635:9): [True: 0, False: 600]
  ------------------
  636|      0|        goto out;
  637|       |
  638|    600|    newval = alloc_new_value(h, key, data->value, data->type_id);
  639|    600|    if (newval == NULL)
  ------------------
  |  Branch (639:9): [True: 0, False: 600]
  ------------------
  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|    600|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  647|       |
  648|    600|    for (i = 0;
  649|    600|         (rc = ossl_ht_insert_locked(h, hash, newval, olddata)) == -1
  ------------------
  |  Branch (649:10): [True: 0, False: 600]
  ------------------
  650|    600|         && i < 4;
  ------------------
  |  Branch (650:13): [True: 0, False: 0]
  ------------------
  651|    600|         ++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|    600|    if (rc <= 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 600]
  ------------------
  658|      0|        free_value(newval);
  659|       |
  660|    600|out:
  661|    600|    return rc;
  662|    600|}
ossl_ht_get:
  665|  5.85k|{
  666|  5.85k|    struct ht_mutable_data_st *md;
  667|  5.85k|    uint64_t hash;
  668|  5.85k|    uint64_t neigh_idx_start;
  669|  5.85k|    uint64_t neigh_idx;
  670|  5.85k|    struct ht_internal_value_st *ival = NULL;
  671|  5.85k|    size_t j;
  672|  5.85k|    uint64_t ehash;
  673|  5.85k|    int lockless_reads = h->config.lockless_reads;
  674|       |
  675|  5.85k|    hash = h->config.ht_hash_fn(key->keybuf, key->keysize);
  676|       |
  677|  5.85k|    md = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|  5.85k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  678|  5.85k|    neigh_idx = neigh_idx_start = hash & md->neighborhood_mask;
  679|  5.85k|    do {
  680|  5.85k|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|  5.85k|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  681|  6.40k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|  6.40k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|  6.40k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (681:21): [True: 6.40k, False: 0]
  ------------------
  682|  6.40k|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|  6.40k|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  683|  6.40k|            if (ival == NULL) {
  ------------------
  |  Branch (683:17): [True: 945, False: 5.46k]
  ------------------
  684|    945|                if (lockless_reads)
  ------------------
  |  Branch (684:21): [True: 945, False: 0]
  ------------------
  685|       |                    /* lockless_reads implies no deletion, we can break out */
  686|    945|                    return NULL;
  687|      0|                continue;
  688|    945|            }
  689|  5.46k|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (689:17): [True: 0, False: 5.46k]
  ------------------
  690|  5.46k|                                    &ehash, h->atomic_lock))
  691|      0|                return NULL;
  692|  5.46k|            if (compare_hash(hash, ehash) && match_key(&ival->value.key, key))
  ------------------
  |  Branch (692:17): [True: 4.91k, False: 551]
  |  Branch (692:46): [True: 4.91k, False: 0]
  ------------------
  693|  4.91k|                return (HT_VALUE *)ival;
  694|  5.46k|        }
  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|  5.85k|}
hashtable.c:internal_free_nop:
  171|    600|{
  172|    600|    return;
  173|    600|}
hashtable.c:alloc_new_neighborhood_list:
  154|      2|{
  155|      2|    struct ht_neighborhood_st *ret;
  156|       |
  157|      2|    ret = OPENSSL_aligned_alloc(sizeof(struct ht_neighborhood_st) * len,
  ------------------
  |  |  106|      2|        CRYPTO_aligned_alloc(num, alignment, freeptr, \
  |  |  107|      2|                             OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                                            OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  158|      2|                                CACHE_LINE_BYTES, freeptr);
  159|       |
  160|       |    /* fall back to regular malloc */
  161|      2|    if (ret == NULL) {
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  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|      2|    memset(ret, 0, sizeof(struct ht_neighborhood_st) * len);
  167|      2|    return ret;
  168|      2|}
hashtable.c:ossl_ht_flush_internal:
  284|      1|{
  285|      1|    struct ht_mutable_data_st *newmd = NULL;
  286|      1|    struct ht_mutable_data_st *oldmd = NULL;
  287|       |
  288|      1|    newmd = OPENSSL_zalloc(sizeof(*newmd));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  289|      1|    if (newmd == NULL)
  ------------------
  |  Branch (289:9): [True: 0, False: 1]
  ------------------
  290|      0|        return 0;
  291|       |
  292|      1|    newmd->neighborhoods = alloc_new_neighborhood_list(DEFAULT_NEIGH_LEN,
  ------------------
  |  |   95|      1|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      1|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  293|      1|                                                       &newmd->neighborhood_ptr_to_free);
  294|      1|    if (newmd->neighborhoods == NULL) {
  ------------------
  |  Branch (294:9): [True: 0, False: 1]
  ------------------
  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|      1|    newmd->neighborhood_mask = DEFAULT_NEIGH_LEN - 1;
  ------------------
  |  |   95|      1|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      1|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  300|       |
  301|       |    /* Swap the old and new mutable data sets */
  302|      1|    oldmd = ossl_rcu_deref(&h->md);
  ------------------
  |  |   30|      1|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  303|      1|    ossl_rcu_assign_ptr(&h->md, &newmd);
  ------------------
  |  |   31|      1|#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|      1|    h->wpd.value_count = 0;
  307|      1|    h->wpd.neighborhood_len = DEFAULT_NEIGH_LEN;
  ------------------
  |  |   95|      1|#define DEFAULT_NEIGH_LEN (1 << DEFAULT_NEIGH_LEN_LOG)
  |  |  ------------------
  |  |  |  |   94|      1|#define DEFAULT_NEIGH_LEN_LOG 4
  |  |  ------------------
  ------------------
  308|       |
  309|      1|    ossl_rcu_call(h->lock, free_oldmd, oldmd);
  310|      1|    h->wpd.need_sync = 1;
  311|      1|    return 1;
  312|      1|}
hashtable.c:free_oldmd:
  262|      1|{
  263|      1|    struct ht_mutable_data_st *oldmd = arg;
  264|      1|    size_t i, j;
  265|      1|    size_t neighborhood_len = (size_t)oldmd->neighborhood_mask + 1;
  266|      1|    struct ht_internal_value_st *v;
  267|       |
  268|  2.04k|    for (i = 0; i < neighborhood_len; i++) {
  ------------------
  |  Branch (268:17): [True: 2.04k, False: 1]
  ------------------
  269|  2.04k|        PREFETCH_NEIGHBORHOOD(oldmd->neighborhoods[i + 1]);
  ------------------
  |  |   83|  2.04k|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  270|  10.2k|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|  10.2k|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|  10.2k|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (270:21): [True: 8.19k, False: 2.04k]
  ------------------
  271|  8.19k|            if (oldmd->neighborhoods[i].entries[j].value != NULL) {
  ------------------
  |  Branch (271:17): [True: 600, False: 7.59k]
  ------------------
  272|    600|                v = oldmd->neighborhoods[i].entries[j].value;
  273|    600|                v->ht->config.ht_free_fn((HT_VALUE *)v);
  274|    600|                free_value(v);
  275|    600|            }
  276|  8.19k|        }
  277|  2.04k|    }
  278|       |
  279|      1|    OPENSSL_free(oldmd->neighborhood_ptr_to_free);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  280|      1|    OPENSSL_free(oldmd);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  281|      1|}
hashtable.c:alloc_new_value:
  597|    600|{
  598|    600|    struct ht_internal_value_st *tmp;
  599|    600|    size_t nvsize = sizeof(*tmp);
  600|       |
  601|    600|    if (h->config.collision_check == 1)
  ------------------
  |  Branch (601:9): [True: 600, False: 0]
  ------------------
  602|    600|        nvsize += key->keysize;
  603|       |
  604|    600|    tmp = OPENSSL_malloc(nvsize);
  ------------------
  |  |  102|    600|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    600|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    600|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  605|       |
  606|    600|    if (tmp == NULL)
  ------------------
  |  Branch (606:9): [True: 0, False: 600]
  ------------------
  607|      0|        return NULL;
  608|       |
  609|    600|    tmp->ht = h;
  610|    600|    tmp->value.value = data;
  611|    600|    tmp->value.type_id = type;
  612|    600|    tmp->value.key.keybuf = NULL;
  613|    600|    if (h->config.collision_check) {
  ------------------
  |  Branch (613:9): [True: 600, False: 0]
  ------------------
  614|    600|        tmp->value.key.keybuf = (uint8_t *)(tmp + 1);
  615|    600|        tmp->value.key.keysize = key->keysize;
  616|    600|        memcpy(tmp->value.key.keybuf, key->keybuf, key->keysize);
  617|    600|    }
  618|       |
  619|       |
  620|    600|    return tmp;
  621|    600|}
hashtable.c:ossl_ht_insert_locked:
  532|    600|{
  533|    600|    struct ht_mutable_data_st *md = h->md;
  534|    600|    uint64_t neigh_idx_start = hash & md->neighborhood_mask;
  535|    600|    uint64_t neigh_idx = neigh_idx_start;
  536|    600|    size_t j;
  537|    600|    uint64_t ihash;
  538|    600|    HT_VALUE *ival;
  539|    600|    size_t empty_idx = SIZE_MAX;
  540|    600|    int lockless_reads = h->config.lockless_reads;
  541|       |
  542|    600|    do {
  543|    600|        PREFETCH_NEIGHBORHOOD(md->neighborhoods[neigh_idx]);
  ------------------
  |  |   83|    600|# define PREFETCH_NEIGHBORHOOD(x) __builtin_prefetch(x.entries)
  ------------------
  544|       |
  545|    684|        for (j = 0; j < NEIGHBORHOOD_LEN; j++) {
  ------------------
  |  |  103|    684|#define NEIGHBORHOOD_LEN (CACHE_LINE_BYTES / sizeof(struct ht_neighborhood_entry_st))
  |  |  ------------------
  |  |  |  |  100|    684|#define CACHE_LINE_BYTES 64
  |  |  ------------------
  ------------------
  |  Branch (545:21): [True: 684, False: 0]
  ------------------
  546|    684|            ival = ossl_rcu_deref(&md->neighborhoods[neigh_idx].entries[j].value);
  ------------------
  |  |   30|    684|#define ossl_rcu_deref(p) ossl_rcu_uptr_deref((void **)p)
  ------------------
  547|    684|            if (ival == NULL) {
  ------------------
  |  Branch (547:17): [True: 600, False: 84]
  ------------------
  548|    600|                empty_idx = j;
  549|       |                /* lockless_reads implies no deletion, we can break out */
  550|    600|                if (lockless_reads)
  ------------------
  |  Branch (550:21): [True: 600, False: 0]
  ------------------
  551|    600|                    goto not_found;
  552|      0|                continue;
  553|    600|            }
  554|     84|            if (!CRYPTO_atomic_load(&md->neighborhoods[neigh_idx].entries[j].hash,
  ------------------
  |  Branch (554:17): [True: 0, False: 84]
  ------------------
  555|     84|                                    &ihash, h->atomic_lock))
  556|      0|                return 0;
  557|     84|            if (compare_hash(hash, ihash) && match_key(&newval->value.key,
  ------------------
  |  Branch (557:17): [True: 0, False: 84]
  |  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|     84|        }
  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|    600| not_found:
  582|       |    /* If we get to here, its just an insert */
  583|    600|    if (empty_idx == SIZE_MAX)
  ------------------
  |  Branch (583:9): [True: 0, False: 600]
  ------------------
  584|      0|        return -1; /* out of space */
  585|    600|    if (!CRYPTO_atomic_store(&md->neighborhoods[neigh_idx].entries[empty_idx].hash,
  ------------------
  |  Branch (585:9): [True: 0, False: 600]
  ------------------
  586|    600|                             hash, h->atomic_lock))
  587|      0|        return 0;
  588|    600|    h->wpd.value_count++;
  589|    600|    ossl_rcu_assign_ptr(&md->neighborhoods[neigh_idx].entries[empty_idx].value,
  ------------------
  |  |   31|    600|#define ossl_rcu_assign_ptr(p,v) ossl_rcu_assign_uptr((void **)p, (void **)v)
  ------------------
  590|    600|                        &newval);
  591|    600|    return 1;
  592|    600|}
hashtable.c:free_value:
  624|    600|{
  625|    600|    OPENSSL_free(v);
  ------------------
  |  |  115|    600|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    600|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    600|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  626|    600|}
hashtable.c:compare_hash:
  405|  5.54k|{
  406|  5.54k|    return (hash1 == hash2);
  407|  5.54k|}
hashtable.c:match_key:
  516|  4.91k|{
  517|       |    /*
  518|       |     * keys match if they are both present, the same size
  519|       |     * and compare equal in memory
  520|       |     */
  521|  4.91k|    PREFETCH(a->keybuf);
  ------------------
  |  |   84|  4.91k|# define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  522|  4.91k|    PREFETCH(b->keybuf);
  ------------------
  |  |   84|  4.91k|# define PREFETCH(x) __builtin_prefetch(x)
  ------------------
  523|  4.91k|    if (a->keybuf != NULL && b->keybuf != NULL && a->keysize == b->keysize)
  ------------------
  |  Branch (523:9): [True: 4.91k, False: 0]
  |  Branch (523:30): [True: 4.91k, False: 0]
  |  Branch (523:51): [True: 4.91k, False: 0]
  ------------------
  524|  4.91k|        return !memcmp(a->keybuf, b->keybuf, a->keysize);
  525|       |
  526|      0|    return 1;
  527|  4.91k|}

HMAC_Init_ex:
   27|    201|{
   28|    201|    int rv = 0, reset = 0;
   29|    201|    int i, j;
   30|    201|    unsigned char pad[HMAC_MAX_MD_CBLOCK_SIZE];
   31|    201|    unsigned int keytmp_length;
   32|    201|    unsigned char keytmp[HMAC_MAX_MD_CBLOCK_SIZE];
   33|       |
   34|       |    /* If we are changing MD then we must have a key */
   35|    201|    if (md != NULL && md != ctx->md && (key == NULL || len < 0))
  ------------------
  |  Branch (35:9): [True: 201, False: 0]
  |  Branch (35:23): [True: 201, False: 0]
  |  Branch (35:41): [True: 0, False: 201]
  |  Branch (35:56): [True: 0, False: 201]
  ------------------
   36|      0|        return 0;
   37|       |
   38|    201|    if (md != NULL)
  ------------------
  |  Branch (38:9): [True: 201, False: 0]
  ------------------
   39|    201|        ctx->md = md;
   40|      0|    else if (ctx->md != NULL)
  ------------------
  |  Branch (40:14): [True: 0, False: 0]
  ------------------
   41|      0|        md = ctx->md;
   42|      0|    else
   43|      0|        return 0;
   44|       |
   45|       |    /*
   46|       |     * The HMAC construction is not allowed to be used with the
   47|       |     * extendable-output functions (XOF) shake128 and shake256.
   48|       |     */
   49|    201|    if (EVP_MD_xof(md))
  ------------------
  |  Branch (49:9): [True: 0, False: 201]
  ------------------
   50|      0|        return 0;
   51|       |
   52|       |#ifdef OPENSSL_HMAC_S390X
   53|       |    rv = s390x_HMAC_init(ctx, key, len, impl);
   54|       |    if (rv >= 1)
   55|       |        return rv;
   56|       |#endif
   57|       |
   58|    201|    if (key != NULL) {
  ------------------
  |  Branch (58:9): [True: 201, False: 0]
  ------------------
   59|    201|        reset = 1;
   60|       |
   61|    201|        j = EVP_MD_get_block_size(md);
   62|    201|        if (!ossl_assert(j <= (int)sizeof(keytmp)))
  ------------------
  |  |   52|    201|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    201|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (62:13): [True: 0, False: 201]
  ------------------
   63|      0|            return 0;
   64|    201|        if (j < 0)
  ------------------
  |  Branch (64:13): [True: 0, False: 201]
  ------------------
   65|      0|            return 0;
   66|    201|        if (j < len) {
  ------------------
  |  Branch (66:13): [True: 0, False: 201]
  ------------------
   67|      0|            if (!EVP_DigestInit_ex(ctx->md_ctx, md, impl)
  ------------------
  |  Branch (67:17): [True: 0, False: 0]
  ------------------
   68|      0|                    || !EVP_DigestUpdate(ctx->md_ctx, key, len)
  ------------------
  |  Branch (68:24): [True: 0, False: 0]
  ------------------
   69|      0|                    || !EVP_DigestFinal_ex(ctx->md_ctx, keytmp,
  ------------------
  |  Branch (69:24): [True: 0, False: 0]
  ------------------
   70|      0|                                           &keytmp_length))
   71|      0|                return 0;
   72|    201|        } else {
   73|    201|            if (len < 0 || len > (int)sizeof(keytmp))
  ------------------
  |  Branch (73:17): [True: 0, False: 201]
  |  Branch (73:28): [True: 0, False: 201]
  ------------------
   74|      0|                return 0;
   75|    201|            memcpy(keytmp, key, len);
   76|    201|            keytmp_length = len;
   77|    201|        }
   78|    201|        if (keytmp_length != HMAC_MAX_MD_CBLOCK_SIZE)
  ------------------
  |  |   18|    201|#define HMAC_MAX_MD_CBLOCK_SIZE     144
  ------------------
  |  Branch (78:13): [True: 201, False: 0]
  ------------------
   79|    201|            memset(&keytmp[keytmp_length], 0,
   80|    201|                   HMAC_MAX_MD_CBLOCK_SIZE - keytmp_length);
  ------------------
  |  |   18|    201|#define HMAC_MAX_MD_CBLOCK_SIZE     144
  ------------------
   81|       |
   82|  29.1k|        for (i = 0; i < HMAC_MAX_MD_CBLOCK_SIZE; i++)
  ------------------
  |  |   18|  29.1k|#define HMAC_MAX_MD_CBLOCK_SIZE     144
  ------------------
  |  Branch (82:21): [True: 28.9k, False: 201]
  ------------------
   83|  28.9k|            pad[i] = 0x36 ^ keytmp[i];
   84|    201|        if (!EVP_DigestInit_ex(ctx->i_ctx, md, impl)
  ------------------
  |  Branch (84:13): [True: 0, False: 201]
  ------------------
   85|    201|                || !EVP_DigestUpdate(ctx->i_ctx, pad,
  ------------------
  |  Branch (85:20): [True: 0, False: 201]
  ------------------
   86|    201|                                     EVP_MD_get_block_size(md)))
   87|      0|            goto err;
   88|       |
   89|  29.1k|        for (i = 0; i < HMAC_MAX_MD_CBLOCK_SIZE; i++)
  ------------------
  |  |   18|  29.1k|#define HMAC_MAX_MD_CBLOCK_SIZE     144
  ------------------
  |  Branch (89:21): [True: 28.9k, False: 201]
  ------------------
   90|  28.9k|            pad[i] = 0x5c ^ keytmp[i];
   91|    201|        if (!EVP_DigestInit_ex(ctx->o_ctx, md, impl)
  ------------------
  |  Branch (91:13): [True: 0, False: 201]
  ------------------
   92|    201|                || !EVP_DigestUpdate(ctx->o_ctx, pad,
  ------------------
  |  Branch (92:20): [True: 0, False: 201]
  ------------------
   93|    201|                                     EVP_MD_get_block_size(md)))
   94|      0|            goto err;
   95|    201|    }
   96|    201|    if (!EVP_MD_CTX_copy_ex(ctx->md_ctx, ctx->i_ctx))
  ------------------
  |  Branch (96:9): [True: 0, False: 201]
  ------------------
   97|      0|        goto err;
   98|    201|    rv = 1;
   99|    201| err:
  100|    201|    if (reset) {
  ------------------
  |  Branch (100:9): [True: 201, False: 0]
  ------------------
  101|    201|        OPENSSL_cleanse(keytmp, sizeof(keytmp));
  102|    201|        OPENSSL_cleanse(pad, sizeof(pad));
  103|    201|    }
  104|    201|    return rv;
  105|    201|}
HMAC_Update:
  117|    402|{
  118|    402|    if (!ctx->md)
  ------------------
  |  Branch (118:9): [True: 0, False: 402]
  ------------------
  119|      0|        return 0;
  120|       |
  121|       |#ifdef OPENSSL_HMAC_S390X
  122|       |    if (ctx->plat.s390x.fc)
  123|       |        return s390x_HMAC_update(ctx, data, len);
  124|       |#endif
  125|       |
  126|    402|    return EVP_DigestUpdate(ctx->md_ctx, data, len);
  127|    402|}
HMAC_Final:
  130|    201|{
  131|    201|    unsigned int i;
  132|    201|    unsigned char buf[EVP_MAX_MD_SIZE];
  133|       |
  134|    201|    if (!ctx->md)
  ------------------
  |  Branch (134:9): [True: 0, False: 201]
  ------------------
  135|      0|        goto err;
  136|       |
  137|       |#ifdef OPENSSL_HMAC_S390X
  138|       |    if (ctx->plat.s390x.fc)
  139|       |        return s390x_HMAC_final(ctx, md, len);
  140|       |#endif
  141|       |
  142|    201|    if (!EVP_DigestFinal_ex(ctx->md_ctx, buf, &i))
  ------------------
  |  Branch (142:9): [True: 0, False: 201]
  ------------------
  143|      0|        goto err;
  144|    201|    if (!EVP_MD_CTX_copy_ex(ctx->md_ctx, ctx->o_ctx))
  ------------------
  |  Branch (144:9): [True: 0, False: 201]
  ------------------
  145|      0|        goto err;
  146|    201|    if (!EVP_DigestUpdate(ctx->md_ctx, buf, i))
  ------------------
  |  Branch (146:9): [True: 0, False: 201]
  ------------------
  147|      0|        goto err;
  148|    201|    if (!EVP_DigestFinal_ex(ctx->md_ctx, md, len))
  ------------------
  |  Branch (148:9): [True: 0, False: 201]
  ------------------
  149|      0|        goto err;
  150|    201|    return 1;
  151|      0| err:
  152|      0|    return 0;
  153|    201|}
HMAC_size:
  156|    201|{
  157|    201|    int size = EVP_MD_get_size((ctx)->md);
  158|       |
  159|    201|    return (size < 0) ? 0 : size;
  ------------------
  |  Branch (159:12): [True: 0, False: 201]
  ------------------
  160|    201|}
HMAC_CTX_new:
  163|    738|{
  164|    738|    HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(HMAC_CTX));
  ------------------
  |  |  104|    738|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    738|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    738|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  165|       |
  166|    738|    if (ctx != NULL) {
  ------------------
  |  Branch (166:9): [True: 738, False: 0]
  ------------------
  167|    738|        if (!HMAC_CTX_reset(ctx)) {
  ------------------
  |  Branch (167:13): [True: 0, False: 738]
  ------------------
  168|      0|            HMAC_CTX_free(ctx);
  169|      0|            return NULL;
  170|      0|        }
  171|    738|    }
  172|    738|    return ctx;
  173|    738|}
HMAC_CTX_free:
  188|    738|{
  189|    738|    if (ctx != NULL) {
  ------------------
  |  Branch (189:9): [True: 738, False: 0]
  ------------------
  190|    738|        hmac_ctx_cleanup(ctx);
  191|    738|        EVP_MD_CTX_free(ctx->i_ctx);
  192|    738|        EVP_MD_CTX_free(ctx->o_ctx);
  193|    738|        EVP_MD_CTX_free(ctx->md_ctx);
  194|    738|        OPENSSL_free(ctx);
  ------------------
  |  |  115|    738|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    738|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    738|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  195|    738|    }
  196|    738|}
HMAC_CTX_reset:
  216|    738|{
  217|    738|    hmac_ctx_cleanup(ctx);
  218|    738|    if (!hmac_ctx_alloc_mds(ctx)) {
  ------------------
  |  Branch (218:9): [True: 0, False: 738]
  ------------------
  219|      0|        hmac_ctx_cleanup(ctx);
  220|      0|        return 0;
  221|      0|    }
  222|    738|    return 1;
  223|    738|}
hmac.c:hmac_ctx_cleanup:
  176|  1.47k|{
  177|  1.47k|    EVP_MD_CTX_reset(ctx->i_ctx);
  178|  1.47k|    EVP_MD_CTX_reset(ctx->o_ctx);
  179|  1.47k|    EVP_MD_CTX_reset(ctx->md_ctx);
  180|  1.47k|    ctx->md = NULL;
  181|       |
  182|       |#ifdef OPENSSL_HMAC_S390X
  183|       |    s390x_HMAC_CTX_cleanup(ctx);
  184|       |#endif
  185|  1.47k|}
hmac.c:hmac_ctx_alloc_mds:
  199|    738|{
  200|    738|    if (ctx->i_ctx == NULL)
  ------------------
  |  Branch (200:9): [True: 738, False: 0]
  ------------------
  201|    738|        ctx->i_ctx = EVP_MD_CTX_new();
  202|    738|    if (ctx->i_ctx == NULL)
  ------------------
  |  Branch (202:9): [True: 0, False: 738]
  ------------------
  203|      0|        return 0;
  204|    738|    if (ctx->o_ctx == NULL)
  ------------------
  |  Branch (204:9): [True: 738, False: 0]
  ------------------
  205|    738|        ctx->o_ctx = EVP_MD_CTX_new();
  206|    738|    if (ctx->o_ctx == NULL)
  ------------------
  |  Branch (206:9): [True: 0, False: 738]
  ------------------
  207|      0|        return 0;
  208|    738|    if (ctx->md_ctx == NULL)
  ------------------
  |  Branch (208:9): [True: 738, False: 0]
  ------------------
  209|    738|        ctx->md_ctx = EVP_MD_CTX_new();
  210|    738|    if (ctx->md_ctx == NULL)
  ------------------
  |  Branch (210:9): [True: 0, False: 738]
  ------------------
  211|      0|        return 0;
  212|    738|    return 1;
  213|    738|}

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

ossl_indicator_set_callback_new:
   22|      1|{
   23|      1|    INDICATOR_CB *cb;
   24|       |
   25|      1|    cb = OPENSSL_zalloc(sizeof(*cb));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   26|      1|    return cb;
   27|      1|}
ossl_indicator_set_callback_free:
   30|      1|{
   31|      1|    OPENSSL_free(cb);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   32|      1|}

OPENSSL_cleanup:
  378|      1|{
  379|      1|    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|      1|    if (!base_inited)
  ------------------
  |  Branch (387:9): [True: 0, False: 1]
  ------------------
  388|      0|        return;
  389|       |
  390|       |    /* Might be explicitly called and also by atexit */
  391|      1|    if (stopped)
  ------------------
  |  Branch (391:9): [True: 0, False: 1]
  ------------------
  392|      0|        return;
  393|      1|    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|      1|    OPENSSL_thread_stop();
  400|       |
  401|      1|    currhandler = stop_handlers;
  402|      1|    while (currhandler != NULL) {
  ------------------
  |  Branch (402:12): [True: 0, False: 1]
  ------------------
  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|      1|    stop_handlers = NULL;
  409|       |
  410|      1|    CRYPTO_THREAD_lock_free(optsdone_lock);
  411|      1|    optsdone_lock = NULL;
  412|      1|    CRYPTO_THREAD_lock_free(init_lock);
  413|      1|    init_lock = NULL;
  414|       |
  415|      1|    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|      1|#ifndef OPENSSL_NO_COMP
  423|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zlib_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  424|      1|    ossl_comp_zlib_cleanup();
  425|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_brotli_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  426|      1|    ossl_comp_brotli_cleanup();
  427|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_comp_zstd_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  428|      1|    ossl_comp_zstd_cleanup();
  429|      1|#endif
  430|       |
  431|      1|    if (async_inited) {
  ------------------
  |  Branch (431:9): [True: 0, False: 1]
  ------------------
  432|      0|        OSSL_TRACE(INIT, "OPENSSL_cleanup: async_deinit()\n");
  ------------------
  |  |  288|      0|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      0|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  433|      0|        async_deinit();
  434|      0|    }
  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|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_rand_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  448|      1|    ossl_rand_cleanup_int();
  449|       |
  450|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_config_modules_free()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  451|      1|    ossl_config_modules_free();
  452|       |
  453|      1|#ifndef OPENSSL_NO_ENGINE
  454|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: engine_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  455|      1|    engine_cleanup_int();
  456|      1|#endif
  457|       |
  458|      1|#ifndef OPENSSL_NO_DEPRECATED_3_0
  459|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_store_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  460|      1|    ossl_store_cleanup_int();
  461|      1|#endif
  462|       |
  463|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_lib_ctx_default_deinit()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  464|      1|    ossl_lib_ctx_default_deinit();
  465|       |
  466|      1|    ossl_cleanup_thread();
  467|       |
  468|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: bio_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  469|      1|    bio_cleanup();
  470|       |
  471|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: evp_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  472|      1|    evp_cleanup_int();
  473|       |
  474|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_obj_cleanup_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  475|      1|    ossl_obj_cleanup_int();
  476|       |
  477|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: err_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  478|      1|    err_cleanup();
  479|       |
  480|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: CRYPTO_secure_malloc_done()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  481|      1|    CRYPTO_secure_malloc_done();
  482|       |
  483|      1|#ifndef OPENSSL_NO_CMP
  484|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: OSSL_CMP_log_close()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  485|      1|    OSSL_CMP_log_close();
  486|      1|#endif
  487|       |
  488|      1|    OSSL_TRACE(INIT, "OPENSSL_cleanup: ossl_trace_cleanup()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  489|      1|    ossl_trace_cleanup();
  490|       |
  491|      1|    base_inited = 0;
  492|      1|}
OPENSSL_init_crypto:
  500|   403M|{
  501|   403M|    uint64_t tmp;
  502|   403M|    int aloaddone = 0;
  503|       |
  504|       |   /* Applications depend on 0 being returned when cleanup was already done */
  505|   403M|    if (stopped) {
  ------------------
  |  Branch (505:9): [True: 0, False: 403M]
  ------------------
  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|   403M|    if (CRYPTO_atomic_load(&optsdone, &tmp, NULL)) {
  ------------------
  |  Branch (524:9): [True: 403M, False: 0]
  ------------------
  525|   403M|        if ((tmp & opts) == opts)
  ------------------
  |  Branch (525:13): [True: 403M, False: 9.92k]
  ------------------
  526|   403M|            return 1;
  527|  9.92k|        aloaddone = 1;
  528|  9.92k|    }
  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|  9.92k|    if (!RUN_ONCE(&base, ossl_init_base))
  ------------------
  |  |  130|  9.92k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 9.92k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (544:9): [True: 0, False: 9.92k]
  ------------------
  545|      0|        return 0;
  546|       |
  547|  9.92k|    if (opts & OPENSSL_INIT_BASE_ONLY)
  ------------------
  |  |   31|  9.92k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (547:9): [True: 9.91k, False: 3]
  ------------------
  548|  9.91k|        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|      3|    if (!aloaddone) {
  ------------------
  |  Branch (555:9): [True: 0, False: 3]
  ------------------
  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|      3|    if ((opts & OPENSSL_INIT_NO_ATEXIT) != 0) {
  ------------------
  |  |  485|      3|# define OPENSSL_INIT_NO_ATEXIT              0x00080000L
  ------------------
  |  Branch (568:9): [True: 0, False: 3]
  ------------------
  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|      3|    } else if (!RUN_ONCE(&register_atexit, ossl_init_register_atexit)) {
  ------------------
  |  |  130|      3|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (572:16): [True: 0, False: 3]
  ------------------
  573|      0|        return 0;
  574|      0|    }
  575|       |
  576|      3|    if (!RUN_ONCE(&load_crypto_nodelete, ossl_init_load_crypto_nodelete))
  ------------------
  |  |  130|      3|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (576:9): [True: 0, False: 3]
  ------------------
  577|      0|        return 0;
  578|       |
  579|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  466|      3|# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
  ------------------
  |  Branch (579:9): [True: 0, False: 3]
  ------------------
  580|      3|            && !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|      3|                             ossl_init_no_load_crypto_strings,
  582|      3|                             ossl_init_load_crypto_strings))
  583|      0|        return 0;
  584|       |
  585|      3|    if ((opts & OPENSSL_INIT_LOAD_CRYPTO_STRINGS)
  ------------------
  |  |  467|      3|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  |  Branch (585:9): [True: 1, False: 2]
  ------------------
  586|      3|            && !RUN_ONCE(&load_crypto_strings, ossl_init_load_crypto_strings))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (586:16): [True: 0, False: 1]
  ------------------
  587|      0|        return 0;
  588|       |
  589|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_SSL_STRINGS)
  ------------------
  |  | 2806|      3|# define OPENSSL_INIT_NO_LOAD_SSL_STRINGS    0x00100000L
  ------------------
  |  Branch (589:9): [True: 0, False: 3]
  ------------------
  590|      3|        && !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|      3|                         ossl_init_load_ssl_strings))
  592|      0|        return 0;
  593|       |
  594|      3|    if ((opts & OPENSSL_INIT_LOAD_SSL_STRINGS)
  ------------------
  |  | 2807|      3|# define OPENSSL_INIT_LOAD_SSL_STRINGS       0x00200000L
  ------------------
  |  Branch (594:9): [True: 0, False: 3]
  ------------------
  595|      3|        && !RUN_ONCE(&ssl_strings, ossl_init_load_ssl_strings))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (595:12): [True: 0, False: 0]
  ------------------
  596|      0|        return 0;
  597|       |
  598|      3|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_CIPHERS)
  ------------------
  |  |  470|      3|# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS     0x00000010L
  ------------------
  |  Branch (598:9): [True: 0, False: 3]
  ------------------
  599|      3|            && !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|      3|                             ossl_init_add_all_ciphers))
  601|      0|        return 0;
  602|       |
  603|      3|    if ((opts & OPENSSL_INIT_ADD_ALL_CIPHERS)
  ------------------
  |  |  468|      3|# define OPENSSL_INIT_ADD_ALL_CIPHERS        0x00000004L
  ------------------
  |  Branch (603:9): [True: 1, False: 2]
  ------------------
  604|      3|            && !RUN_ONCE(&add_all_ciphers, ossl_init_add_all_ciphers))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (604:16): [True: 0, False: 1]
  ------------------
  605|      0|        return 0;
  606|       |
  607|      3|    if ((opts & OPENSSL_INIT_NO_ADD_ALL_DIGESTS)
  ------------------
  |  |  471|      3|# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS     0x00000020L
  ------------------
  |  Branch (607:9): [True: 0, False: 3]
  ------------------
  608|      3|            && !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|      3|                             ossl_init_add_all_digests))
  610|      0|        return 0;
  611|       |
  612|      3|    if ((opts & OPENSSL_INIT_ADD_ALL_DIGESTS)
  ------------------
  |  |  469|      3|# define OPENSSL_INIT_ADD_ALL_DIGESTS        0x00000008L
  ------------------
  |  Branch (612:9): [True: 1, False: 2]
  ------------------
  613|      3|            && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (613:16): [True: 0, False: 1]
  ------------------
  614|      0|        return 0;
  615|       |
  616|      3|    if ((opts & OPENSSL_INIT_ATFORK)
  ------------------
  |  |  483|      3|# define OPENSSL_INIT_ATFORK                 0x00020000L
  ------------------
  |  Branch (616:9): [True: 0, False: 3]
  ------------------
  617|      3|            && !openssl_init_fork_handlers())
  ------------------
  |  Branch (617:16): [True: 0, False: 0]
  ------------------
  618|      0|        return 0;
  619|       |
  620|      3|    if ((opts & OPENSSL_INIT_NO_LOAD_CONFIG)
  ------------------
  |  |  473|      3|# define OPENSSL_INIT_NO_LOAD_CONFIG         0x00000080L
  ------------------
  |  Branch (620:9): [True: 0, False: 3]
  ------------------
  621|      3|            && !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|      3|    if (opts & OPENSSL_INIT_LOAD_CONFIG) {
  ------------------
  |  |  472|      3|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  |  Branch (624:9): [True: 1, False: 2]
  ------------------
  625|      1|        int loading = CRYPTO_THREAD_get_local(&in_init_config_local) != NULL;
  626|       |
  627|       |        /* If called recursively from OBJ_ calls, just skip it. */
  628|      1|        if (!loading) {
  ------------------
  |  Branch (628:13): [True: 1, False: 0]
  ------------------
  629|      1|            int ret;
  630|       |
  631|      1|            if (!CRYPTO_THREAD_set_local(&in_init_config_local, (void *)-1))
  ------------------
  |  Branch (631:17): [True: 0, False: 1]
  ------------------
  632|      0|                return 0;
  633|      1|            if (settings == NULL) {
  ------------------
  |  Branch (633:17): [True: 1, False: 0]
  ------------------
  634|      1|                ret = RUN_ONCE(&config, ossl_init_config);
  ------------------
  |  |  130|      1|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  635|      1|            } 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|      1|            if (ret <= 0)
  ------------------
  |  Branch (645:17): [True: 0, False: 1]
  ------------------
  646|      0|                return 0;
  647|      1|        }
  648|      1|    }
  649|       |
  650|      3|    if ((opts & OPENSSL_INIT_ASYNC)
  ------------------
  |  |  474|      3|# define OPENSSL_INIT_ASYNC                  0x00000100L
  ------------------
  |  Branch (650:9): [True: 0, False: 3]
  ------------------
  651|      3|            && !RUN_ONCE(&async, ossl_init_async))
  ------------------
  |  |  130|      0|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (651:16): [True: 0, False: 0]
  ------------------
  652|      0|        return 0;
  653|       |
  654|      3|#ifndef OPENSSL_NO_ENGINE
  655|      3|    if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
  ------------------
  |  |  477|      3|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  |  Branch (655:9): [True: 0, False: 3]
  ------------------
  656|      3|            && !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|      3|# ifndef OPENSSL_NO_RDRAND
  659|      3|    if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
  ------------------
  |  |  475|      3|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  ------------------
  |  Branch (659:9): [True: 0, False: 3]
  ------------------
  660|      3|            && !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|      3|# endif
  663|      3|    if ((opts & OPENSSL_INIT_ENGINE_DYNAMIC)
  ------------------
  |  |  476|      3|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  ------------------
  |  Branch (663:9): [True: 0, False: 3]
  ------------------
  664|      3|            && !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|      3|# 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|      3|#  if !defined(OPENSSL_NO_PADLOCKENG)
  673|      3|    if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
  ------------------
  |  |  480|      3|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  ------------------
  |  Branch (673:9): [True: 0, False: 3]
  ------------------
  674|      3|            && !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|      3|#  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|      3|#  if !defined(OPENSSL_NO_AFALGENG)
  683|      3|    if ((opts & OPENSSL_INIT_ENGINE_AFALG)
  ------------------
  |  |  481|      3|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  |  Branch (683:9): [True: 0, False: 3]
  ------------------
  684|      3|            && !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|      3|#  endif
  687|      3|# endif
  688|      3|    if (opts & (OPENSSL_INIT_ENGINE_ALL_BUILTIN
  ------------------
  |  |  497|      3|    (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  475|      3|# define OPENSSL_INIT_ENGINE_RDRAND          0x00000200L
  |  |  ------------------
  |  |                   (OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
  |  |  ------------------
  |  |  |  |  476|      3|# define OPENSSL_INIT_ENGINE_DYNAMIC         0x00000400L
  |  |  ------------------
  |  |  498|      3|    | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  478|      3|# define OPENSSL_INIT_ENGINE_CRYPTODEV       0x00001000L
  |  |  ------------------
  |  |                   | OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
  |  |  ------------------
  |  |  |  |  479|      3|# define OPENSSL_INIT_ENGINE_CAPI            0x00002000L
  |  |  ------------------
  |  |  499|      3|    OPENSSL_INIT_ENGINE_PADLOCK)
  |  |  ------------------
  |  |  |  |  480|      3|# define OPENSSL_INIT_ENGINE_PADLOCK         0x00004000L
  |  |  ------------------
  ------------------
  |  Branch (688:9): [True: 0, False: 3]
  ------------------
  689|      3|                | OPENSSL_INIT_ENGINE_OPENSSL
  ------------------
  |  |  477|      3|# define OPENSSL_INIT_ENGINE_OPENSSL         0x00000800L
  ------------------
  690|      3|                | OPENSSL_INIT_ENGINE_AFALG)) {
  ------------------
  |  |  481|      3|# define OPENSSL_INIT_ENGINE_AFALG           0x00008000L
  ------------------
  691|      0|        ENGINE_register_all_complete();
  692|      0|    }
  693|      3|#endif
  694|       |
  695|      3|    if (!CRYPTO_atomic_or(&optsdone, opts, &tmp, optsdone_lock))
  ------------------
  |  Branch (695:9): [True: 0, False: 3]
  ------------------
  696|      0|        return 0;
  697|       |
  698|      3|    return 1;
  699|      3|}
init.c:ossl_init_base:
   58|      1|{
   59|       |    /* no need to init trace */
   60|       |
   61|      1|    OSSL_TRACE(INIT, "ossl_init_base: setting up stop handlers\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   62|       |#ifndef OPENSSL_NO_CRYPTO_MDEBUG
   63|       |    ossl_malloc_setup_failures();
   64|       |#endif
   65|       |
   66|      1|    if ((optsdone_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (66:9): [True: 0, False: 1]
  ------------------
   67|      1|        || (init_lock = CRYPTO_THREAD_lock_new()) == NULL)
  ------------------
  |  Branch (67:12): [True: 0, False: 1]
  ------------------
   68|      0|        goto err;
   69|       |
   70|      1|    OPENSSL_cpuid_setup();
   71|       |
   72|      1|    if (!ossl_init_thread())
  ------------------
  |  Branch (72:9): [True: 0, False: 1]
  ------------------
   73|      0|        goto err;
   74|       |
   75|      1|    if (!CRYPTO_THREAD_init_local(&in_init_config_local, NULL))
  ------------------
  |  Branch (75:9): [True: 0, False: 1]
  ------------------
   76|      0|        goto err;
   77|       |
   78|      1|    base_inited = 1;
   79|      1|    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|      1|}
init.c:ossl_init_register_atexit:
  101|      1|{
  102|      1|#ifndef OPENSSL_NO_ATEXIT
  103|       |# ifdef OPENSSL_INIT_DEBUG
  104|       |    fprintf(stderr, "OPENSSL_INIT: ossl_init_register_atexit()\n");
  105|       |# endif
  106|      1|# 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|      1|    if (atexit(OPENSSL_cleanup) != 0)
  ------------------
  |  Branch (112:9): [True: 0, False: 1]
  ------------------
  113|      0|        return 0;
  114|      1|#  endif
  115|      1|# endif
  116|      1|#endif
  117|       |
  118|      1|    return 1;
  119|      1|}
init.c:ossl_init_load_crypto_nodelete:
  133|      1|{
  134|      1|    OSSL_TRACE(INIT, "ossl_init_load_crypto_nodelete()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  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|      1|    return 1;
  181|      1|}
init.c:ossl_init_load_crypto_strings:
  186|      1|{
  187|      1|    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|      1|#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT)
  193|      1|    void *err;
  194|       |
  195|      1|    if (!err_shelve_state(&err))
  ------------------
  |  Branch (195:9): [True: 0, False: 1]
  ------------------
  196|      0|        return 0;
  197|       |
  198|      1|    OSSL_TRACE(INIT, "ossl_err_load_crypto_strings()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  199|      1|    ret = ossl_err_load_crypto_strings();
  200|       |
  201|      1|    err_unshelve_state(err);
  202|      1|#endif
  203|      1|    return ret;
  204|      1|}
init.c:ossl_init_add_all_ciphers:
  237|      1|{
  238|       |    /*
  239|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  240|       |     * pulling in all the ciphers during static linking
  241|       |     */
  242|      1|#ifndef OPENSSL_NO_AUTOALGINIT
  243|      1|    OSSL_TRACE(INIT, "openssl_add_all_ciphers_int()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  244|      1|    openssl_add_all_ciphers_int();
  245|      1|#endif
  246|      1|    return 1;
  247|      1|}
init.c:ossl_init_add_all_digests:
  258|      1|{
  259|       |    /*
  260|       |     * OPENSSL_NO_AUTOALGINIT is provided here to prevent at compile time
  261|       |     * pulling in all the ciphers during static linking
  262|       |     */
  263|      1|#ifndef OPENSSL_NO_AUTOALGINIT
  264|      1|    OSSL_TRACE(INIT, "openssl_add_all_digests()\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
  265|      1|    openssl_add_all_digests_int();
  266|      1|#endif
  267|      1|    return 1;
  268|      1|}
init.c:ossl_init_config:
  281|      1|{
  282|      1|    int ret = ossl_config_int(NULL);
  283|       |
  284|      1|    config_inited = 1;
  285|      1|    return ret;
  286|      1|}

ossl_init_thread:
  203|      1|{
  204|      1|    if (!CRYPTO_THREAD_init_local(&destructor_key.value,
  ------------------
  |  Branch (204:9): [True: 0, False: 1]
  ------------------
  205|      1|                                  init_thread_destructor))
  206|      0|        return 0;
  207|       |
  208|      1|    return 1;
  209|      1|}
ossl_cleanup_thread:
  212|      1|{
  213|      1|    init_thread_deregister(NULL, 1);
  214|      1|    CRYPTO_THREAD_cleanup_local(&destructor_key.value);
  215|      1|    destructor_key.sane = -1;
  216|      1|}
OPENSSL_thread_stop:
  230|      1|{
  231|      1|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (231:9): [True: 1, False: 0]
  ------------------
  232|      1|        THREAD_EVENT_HANDLER **hands
  233|      1|            = init_get_thread_local(&destructor_key.value, 0, 0);
  234|      1|        init_thread_stop(NULL, hands);
  235|       |
  236|      1|        init_thread_remove_handlers(hands);
  237|      1|        OPENSSL_free(hands);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  238|      1|    }
  239|      1|}
ossl_ctx_thread_stop:
  242|      1|{
  243|      1|    if (destructor_key.sane != -1) {
  ------------------
  |  Branch (243:9): [True: 1, False: 0]
  ------------------
  244|      1|        THREAD_EVENT_HANDLER **hands
  245|      1|            = init_get_thread_local(&destructor_key.value, 0, 1);
  246|      1|        init_thread_stop(ctx, hands);
  247|      1|    }
  248|      1|}
ossl_init_thread_start:
  369|      2|{
  370|      2|    THREAD_EVENT_HANDLER **hands;
  371|      2|    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|      2|    CRYPTO_THREAD_LOCAL *local = &destructor_key.value;
  390|      2|#endif
  391|       |
  392|      2|    hands = init_get_thread_local(local, 1, 0);
  393|      2|    if (hands == NULL)
  ------------------
  |  Branch (393:9): [True: 0, False: 2]
  ------------------
  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|      2|    hand = OPENSSL_malloc(sizeof(*hand));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  409|      2|    if (hand == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 2]
  ------------------
  410|      0|        return 0;
  411|       |
  412|      2|    hand->handfn = handfn;
  413|      2|    hand->arg = arg;
  414|      2|#ifndef FIPS_MODULE
  415|      2|    hand->index = index;
  416|      2|#endif
  417|      2|    hand->next = *hands;
  418|      2|    *hands = hand;
  419|       |
  420|      2|    return 1;
  421|      2|}
ossl_init_thread_deregister:
  477|      1|{
  478|      1|    return init_thread_deregister(index, 0);
  479|      1|}
initthread.c:init_get_thread_local:
   95|      4|{
   96|      4|    THREAD_EVENT_HANDLER **hands = CRYPTO_THREAD_get_local(local);
   97|       |
   98|      4|    if (alloc) {
  ------------------
  |  Branch (98:9): [True: 2, False: 2]
  ------------------
   99|      2|        if (hands == NULL) {
  ------------------
  |  Branch (99:13): [True: 1, False: 1]
  ------------------
  100|       |
  101|      1|            if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (101:17): [True: 0, False: 1]
  ------------------
  102|      0|                return NULL;
  103|       |
  104|      1|            if (!CRYPTO_THREAD_set_local(local, hands)) {
  ------------------
  |  Branch (104:17): [True: 0, False: 1]
  ------------------
  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|      1|#ifndef FIPS_MODULE
  110|      1|            if (!init_thread_push_handlers(hands)) {
  ------------------
  |  Branch (110:17): [True: 0, False: 1]
  ------------------
  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|      1|#endif
  116|      1|        }
  117|      2|    } else if (!keep) {
  ------------------
  |  Branch (117:16): [True: 1, False: 1]
  ------------------
  118|      1|        CRYPTO_THREAD_set_local(local, NULL);
  119|      1|    }
  120|       |
  121|      4|    return hands;
  122|      4|}
initthread.c:init_thread_push_handlers:
  155|      1|{
  156|      1|    int ret;
  157|      1|    GLOBAL_TEVENT_REGISTER *gtr;
  158|       |
  159|      1|    gtr = get_global_tevent_register();
  160|      1|    if (gtr == NULL)
  ------------------
  |  Branch (160:9): [True: 0, False: 1]
  ------------------
  161|      0|        return 0;
  162|       |
  163|      1|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (163:9): [True: 0, False: 1]
  ------------------
  164|      0|        return 0;
  165|      1|    ret = (sk_THREAD_EVENT_HANDLER_PTR_push(gtr->skhands, hands) != 0);
  166|      1|    CRYPTO_THREAD_unlock(gtr->lock);
  167|       |
  168|      1|    return ret;
  169|      1|}
initthread.c:get_global_tevent_register:
   78|      5|{
   79|      5|    if (!RUN_ONCE(&tevent_register_runonce, create_global_tevent_register))
  ------------------
  |  |  130|      5|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 5, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (79:9): [True: 0, False: 5]
  ------------------
   80|      0|        return NULL;
   81|      5|    return glob_tevent_reg;
   82|      5|}
initthread.c:create_global_tevent_register:
   59|      1|{
   60|      1|    glob_tevent_reg = OPENSSL_zalloc(sizeof(*glob_tevent_reg));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   61|      1|    if (glob_tevent_reg == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 1]
  ------------------
   62|      0|        return 0;
   63|       |
   64|      1|    glob_tevent_reg->skhands = sk_THREAD_EVENT_HANDLER_PTR_new_null();
   65|      1|    glob_tevent_reg->lock = CRYPTO_THREAD_lock_new();
   66|      1|    if (glob_tevent_reg->skhands == NULL || glob_tevent_reg->lock == NULL) {
  ------------------
  |  Branch (66:9): [True: 0, False: 1]
  |  Branch (66:45): [True: 0, False: 1]
  ------------------
   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|      1|    return 1;
   75|      1|}
initthread.c:init_thread_remove_handlers:
  172|      1|{
  173|      1|    GLOBAL_TEVENT_REGISTER *gtr;
  174|      1|    int i;
  175|       |
  176|      1|    gtr = get_global_tevent_register();
  177|      1|    if (gtr == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 1]
  ------------------
  178|      0|        return;
  179|      1|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (179:9): [True: 0, False: 1]
  ------------------
  180|      0|        return;
  181|      1|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (181:17): [True: 1, False: 0]
  ------------------
  182|      1|        THREAD_EVENT_HANDLER **hands
  183|      1|            = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i);
  184|       |
  185|      1|        if (hands == handsin) {
  ------------------
  |  Branch (185:13): [True: 1, False: 0]
  ------------------
  186|      1|            sk_THREAD_EVENT_HANDLER_PTR_delete(gtr->skhands, i);
  187|      1|            CRYPTO_THREAD_unlock(gtr->lock);
  188|      1|            return;
  189|      1|        }
  190|      1|    }
  191|      0|    CRYPTO_THREAD_unlock(gtr->lock);
  192|      0|    return;
  193|      1|}
initthread.c:init_thread_stop:
  325|      2|{
  326|      2|    THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp;
  327|      2|#ifndef FIPS_MODULE
  328|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  329|      2|#endif
  330|       |
  331|       |    /* Can't do much about this */
  332|      2|    if (hands == NULL)
  ------------------
  |  Branch (332:9): [True: 1, False: 1]
  ------------------
  333|      1|        return;
  334|       |
  335|      1|#ifndef FIPS_MODULE
  336|      1|    gtr = get_global_tevent_register();
  337|      1|    if (gtr == NULL)
  ------------------
  |  Branch (337:9): [True: 0, False: 1]
  ------------------
  338|      0|        return;
  339|       |
  340|      1|    if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (340:9): [True: 0, False: 1]
  ------------------
  341|      0|        return;
  342|      1|#endif
  343|       |
  344|      1|    curr = *hands;
  345|      3|    while (curr != NULL) {
  ------------------
  |  Branch (345:12): [True: 2, False: 1]
  ------------------
  346|      2|        if (arg != NULL && curr->arg != arg) {
  ------------------
  |  Branch (346:13): [True: 0, False: 2]
  |  Branch (346:28): [True: 0, False: 0]
  ------------------
  347|      0|            prev = curr;
  348|      0|            curr = curr->next;
  349|      0|            continue;
  350|      0|        }
  351|      2|        curr->handfn(curr->arg);
  352|      2|        if (prev == NULL)
  ------------------
  |  Branch (352:13): [True: 2, False: 0]
  ------------------
  353|      2|            *hands = curr->next;
  354|      0|        else
  355|      0|            prev->next = curr->next;
  356|       |
  357|      2|        tmp = curr;
  358|      2|        curr = curr->next;
  359|       |
  360|      2|        OPENSSL_free(tmp);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  361|      2|    }
  362|      1|#ifndef FIPS_MODULE
  363|      1|    CRYPTO_THREAD_unlock(gtr->lock);
  364|      1|#endif
  365|      1|}
initthread.c:init_thread_deregister:
  425|      2|{
  426|      2|    GLOBAL_TEVENT_REGISTER *gtr;
  427|      2|    int i;
  428|       |
  429|      2|    gtr = get_global_tevent_register();
  430|      2|    if (gtr == NULL)
  ------------------
  |  Branch (430:9): [True: 0, False: 2]
  ------------------
  431|      0|        return 0;
  432|      2|    if (!all) {
  ------------------
  |  Branch (432:9): [True: 1, False: 1]
  ------------------
  433|      1|        if (!CRYPTO_THREAD_write_lock(gtr->lock))
  ------------------
  |  Branch (433:13): [True: 0, False: 1]
  ------------------
  434|      0|            return 0;
  435|      1|    } else {
  436|      1|        glob_tevent_reg = NULL;
  437|      1|    }
  438|      2|    for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) {
  ------------------
  |  Branch (438:17): [True: 0, False: 2]
  ------------------
  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|      2|    if (all) {
  ------------------
  |  Branch (466:9): [True: 1, False: 1]
  ------------------
  467|      1|        CRYPTO_THREAD_lock_free(gtr->lock);
  468|      1|        sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands);
  469|      1|        OPENSSL_free(gtr);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  470|      1|    } else {
  471|      1|        CRYPTO_THREAD_unlock(gtr->lock);
  472|      1|    }
  473|      2|    return 1;
  474|      2|}

OPENSSL_LH_set_thunks:
   52|    276|{
   53|       |
   54|    276|    if (lh == NULL)
  ------------------
  |  Branch (54:9): [True: 0, False: 276]
  ------------------
   55|      0|        return NULL;
   56|    276|    lh->compw = cw;
   57|    276|    lh->hashw = hw;
   58|    276|    lh->daw = daw;
   59|    276|    lh->daaw = daaw;
   60|    276|    return lh;
   61|    276|}
OPENSSL_LH_new:
   64|    276|{
   65|    276|    OPENSSL_LHASH *ret;
   66|       |
   67|    276|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  104|    276|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    276|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    276|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (67:9): [True: 0, False: 276]
  ------------------
   68|      0|        return NULL;
   69|    276|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |  104|    276|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    276|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    276|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (69:9): [True: 0, False: 276]
  ------------------
   70|      0|        goto err;
   71|    276|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (71:18): [True: 0, False: 276]
  ------------------
   72|    276|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (72:18): [True: 0, False: 276]
  ------------------
   73|    276|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|    276|#define MIN_NODES       16
  ------------------
   74|    276|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|    276|#define MIN_NODES       16
  ------------------
   75|    276|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|    276|#define MIN_NODES       16
  ------------------
   76|    276|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|    276|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   85|    276|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   77|    276|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|    276|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   85|    276|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   78|    276|    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|    276|}
OPENSSL_LH_free:
   87|    277|{
   88|    277|    if (lh == NULL)
  ------------------
  |  Branch (88:9): [True: 1, False: 276]
  ------------------
   89|      1|        return;
   90|       |
   91|    276|    OPENSSL_LH_flush(lh);
   92|    276|    OPENSSL_free(lh->b);
  ------------------
  |  |  115|    276|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    276|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    276|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|    276|    OPENSSL_free(lh);
  ------------------
  |  |  115|    276|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    276|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    276|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|    276|}
OPENSSL_LH_flush:
   97|    276|{
   98|    276|    unsigned int i;
   99|    276|    OPENSSL_LH_NODE *n, *nn;
  100|       |
  101|    276|    if (lh == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 276]
  ------------------
  102|      0|        return;
  103|       |
  104|  3.35k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (104:17): [True: 3.07k, False: 276]
  ------------------
  105|  3.07k|        n = lh->b[i];
  106|  4.63k|        while (n != NULL) {
  ------------------
  |  Branch (106:16): [True: 1.56k, False: 3.07k]
  ------------------
  107|  1.56k|            nn = n->next;
  108|  1.56k|            OPENSSL_free(n);
  ------------------
  |  |  115|  1.56k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.56k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.56k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  109|  1.56k|            n = nn;
  110|  1.56k|        }
  111|  3.07k|        lh->b[i] = NULL;
  112|  3.07k|    }
  113|       |
  114|    276|    lh->num_items = 0;
  115|    276|}
OPENSSL_LH_insert:
  118|  4.77k|{
  119|  4.77k|    unsigned long hash;
  120|  4.77k|    OPENSSL_LH_NODE *nn, **rn;
  121|  4.77k|    void *ret;
  122|       |
  123|  4.77k|    lh->error = 0;
  124|  4.77k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   85|  4.77k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (124:9): [True: 867, False: 3.91k]
  |  Branch (124:76): [True: 0, False: 867]
  ------------------
  125|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  126|       |
  127|  4.77k|    rn = getrn(lh, data, &hash);
  128|       |
  129|  4.77k|    if (*rn == NULL) {
  ------------------
  |  Branch (129:9): [True: 1.80k, False: 2.97k]
  ------------------
  130|  1.80k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |  102|  1.80k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.80k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.80k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (130:13): [True: 0, False: 1.80k]
  ------------------
  131|      0|            lh->error++;
  132|      0|            return NULL;
  133|      0|        }
  134|  1.80k|        nn->data = data;
  135|  1.80k|        nn->next = NULL;
  136|  1.80k|        nn->hash = hash;
  137|  1.80k|        *rn = nn;
  138|  1.80k|        ret = NULL;
  139|  1.80k|        lh->num_items++;
  140|  2.97k|    } else {                    /* replace same key */
  141|  2.97k|        ret = (*rn)->data;
  142|  2.97k|        (*rn)->data = data;
  143|  2.97k|    }
  144|  4.77k|    return ret;
  145|  4.77k|}
OPENSSL_LH_delete:
  148|    242|{
  149|    242|    unsigned long hash;
  150|    242|    OPENSSL_LH_NODE *nn, **rn;
  151|    242|    void *ret;
  152|       |
  153|    242|    lh->error = 0;
  154|    242|    rn = getrn(lh, data, &hash);
  155|       |
  156|    242|    if (*rn == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 242]
  ------------------
  157|      0|        return NULL;
  158|    242|    } else {
  159|    242|        nn = *rn;
  160|    242|        *rn = nn->next;
  161|    242|        ret = nn->data;
  162|    242|        OPENSSL_free(nn);
  ------------------
  |  |  115|    242|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    242|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    242|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|    242|    }
  164|       |
  165|    242|    lh->num_items--;
  166|    242|    if ((lh->num_nodes > MIN_NODES) &&
  ------------------
  |  |   39|    242|#define MIN_NODES       16
  ------------------
  |  Branch (166:9): [True: 242, False: 0]
  ------------------
  167|    242|        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
  ------------------
  |  |   85|    242|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (167:9): [True: 1, False: 241]
  ------------------
  168|      1|        contract(lh);
  169|       |
  170|    242|    return ret;
  171|    242|}
OPENSSL_LH_retrieve:
  174|  4.01k|{
  175|  4.01k|    unsigned long hash;
  176|  4.01k|    OPENSSL_LH_NODE **rn;
  177|       |
  178|  4.01k|    if (lh->error != 0)
  ------------------
  |  Branch (178:9): [True: 0, False: 4.01k]
  ------------------
  179|      0|        lh->error = 0;
  180|       |
  181|  4.01k|    rn = getrn(lh, data, &hash);
  182|       |
  183|  4.01k|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (183:12): [True: 271, False: 3.74k]
  ------------------
  184|  4.01k|}
OPENSSL_LH_doall:
  217|    278|{
  218|    278|    if (lh == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 278]
  ------------------
  219|      0|        return;
  220|       |
  221|    278|    doall_util_fn(lh, 0, lh->daw, func, (OPENSSL_LH_DOALL_FUNCARG)NULL,
  222|    278|                  (OPENSSL_LH_DOALL_FUNCARG_THUNK)NULL, NULL);
  223|    278|}
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|  3.34k|{
  363|  3.34k|    unsigned long ret = 0;
  364|  3.34k|    long n;
  365|  3.34k|    unsigned long v;
  366|  3.34k|    int r;
  367|       |
  368|  3.34k|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (368:9): [True: 0, False: 3.34k]
  |  Branch (368:24): [True: 3.04k, False: 300]
  ------------------
  369|  3.04k|        return ret;
  370|       |
  371|    300|    n = 0x100;
  372|  4.81k|    while (*c) {
  ------------------
  |  Branch (372:12): [True: 4.51k, False: 300]
  ------------------
  373|  4.51k|        v = n | (*c);
  374|  4.51k|        n += 0x100;
  375|  4.51k|        r = (int)((v >> 2) ^ v) & 0x0f;
  376|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  377|  4.51k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  378|  4.51k|        ret &= 0xFFFFFFFFL;
  379|  4.51k|        ret ^= v * v;
  380|  4.51k|        c++;
  381|  4.51k|    }
  382|    300|    return (ret >> 16) ^ ret;
  383|  3.34k|}
ossl_lh_strcasehash:
  400|  1.31k|{
  401|  1.31k|    unsigned long ret = 0;
  402|  1.31k|    long n;
  403|  1.31k|    unsigned long v;
  404|  1.31k|    int r;
  405|       |#if defined(CHARSET_EBCDIC) && !defined(CHARSET_EBCDIC_TEST)
  406|       |    const long int case_adjust = ~0x40;
  407|       |#else
  408|  1.31k|    const long int case_adjust = ~0x20;
  409|  1.31k|#endif
  410|       |
  411|  1.31k|    if (c == NULL || *c == '\0')
  ------------------
  |  Branch (411:9): [True: 0, False: 1.31k]
  |  Branch (411:22): [True: 0, False: 1.31k]
  ------------------
  412|      0|        return ret;
  413|       |
  414|  16.9k|    for (n = 0x100; *c != '\0'; n += 0x100) {
  ------------------
  |  Branch (414:21): [True: 15.6k, False: 1.31k]
  ------------------
  415|  15.6k|        v = n | (case_adjust & *c);
  416|  15.6k|        r = (int)((v >> 2) ^ v) & 0x0f;
  417|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  418|  15.6k|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  419|  15.6k|        ret &= 0xFFFFFFFFL;
  420|  15.6k|        ret ^= v * v;
  421|  15.6k|        c++;
  422|  15.6k|    }
  423|  1.31k|    return (ret >> 16) ^ ret;
  424|  1.31k|}
OPENSSL_LH_get_down_load:
  432|      4|{
  433|      4|    return lh->down_load;
  434|      4|}
OPENSSL_LH_set_down_load:
  437|      7|{
  438|      7|    lh->down_load = down_load;
  439|      7|}
OPENSSL_LH_error:
  442|    284|{
  443|    284|    return lh->error;
  444|    284|}
lhash.c:doall_util_fn:
  192|    280|{
  193|    280|    int i;
  194|    280|    OPENSSL_LH_NODE *a, *n;
  195|       |
  196|    280|    if (lh == NULL)
  ------------------
  |  Branch (196:9): [True: 0, False: 280]
  ------------------
  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|  3.20k|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (203:33): [True: 2.92k, False: 280]
  ------------------
  204|  2.92k|        a = lh->b[i];
  205|  3.99k|        while (a != NULL) {
  ------------------
  |  Branch (205:16): [True: 1.06k, False: 2.92k]
  ------------------
  206|  1.06k|            n = a->next;
  207|  1.06k|            if (use_arg)
  ------------------
  |  Branch (207:17): [True: 484, False: 585]
  ------------------
  208|    484|                wfunc_arg(a->data, arg, func_arg);
  209|    585|            else
  210|    585|                wfunc(a->data, func);
  211|  1.06k|            a = n;
  212|  1.06k|        }
  213|  2.92k|    }
  214|    280|}
lhash.c:expand:
  244|    867|{
  245|    867|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  246|    867|    unsigned int p, pmax, nni, j;
  247|    867|    unsigned long hash;
  248|       |
  249|    867|    nni = lh->num_alloc_nodes;
  250|    867|    p = lh->p;
  251|    867|    pmax = lh->pmax;
  252|    867|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (252:9): [True: 9, False: 858]
  ------------------
  253|      9|        j = nni * 2;
  254|      9|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  109|      9|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  255|      9|        if (n == NULL) {
  ------------------
  |  Branch (255:13): [True: 0, False: 9]
  ------------------
  256|      0|            lh->error++;
  257|      0|            return 0;
  258|      0|        }
  259|      9|        lh->b = n;
  260|      9|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  261|      9|        lh->pmax = nni;
  262|      9|        lh->num_alloc_nodes = j;
  263|      9|        lh->p = 0;
  264|    858|    } else {
  265|    858|        lh->p++;
  266|    858|    }
  267|       |
  268|    867|    lh->num_nodes++;
  269|    867|    n1 = &(lh->b[p]);
  270|    867|    n2 = &(lh->b[p + pmax]);
  271|    867|    *n2 = NULL;
  272|       |
  273|  3.93k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (273:20): [True: 3.06k, False: 867]
  ------------------
  274|  3.06k|        hash = np->hash;
  275|  3.06k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (275:13): [True: 551, False: 2.51k]
  ------------------
  276|    551|            *n1 = (*n1)->next;
  277|    551|            np->next = *n2;
  278|    551|            *n2 = np;
  279|    551|        } else
  280|  2.51k|            n1 = &((*n1)->next);
  281|  3.06k|        np = *n1;
  282|  3.06k|    }
  283|       |
  284|    867|    return 1;
  285|    867|}
lhash.c:contract:
  288|      1|{
  289|      1|    OPENSSL_LH_NODE **n, *n1, *np;
  290|       |
  291|      1|    np = lh->b[lh->p + lh->pmax - 1];
  292|      1|    lh->b[lh->p + lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
  293|      1|    if (lh->p == 0) {
  ------------------
  |  Branch (293:9): [True: 0, False: 1]
  ------------------
  294|      0|        n = OPENSSL_realloc(lh->b,
  ------------------
  |  |  109|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  295|      0|                            (unsigned int)(sizeof(OPENSSL_LH_NODE *) * lh->pmax));
  296|      0|        if (n == NULL) {
  ------------------
  |  Branch (296:13): [True: 0, False: 0]
  ------------------
  297|       |            /* fputs("realloc error in lhash", stderr); */
  298|      0|            lh->error++;
  299|      0|        } else {
  300|      0|            lh->b = n;
  301|      0|        }
  302|      0|        lh->num_alloc_nodes /= 2;
  303|      0|        lh->pmax /= 2;
  304|      0|        lh->p = lh->pmax - 1;
  305|      0|    } else
  306|      1|        lh->p--;
  307|       |
  308|      1|    lh->num_nodes--;
  309|       |
  310|      1|    n1 = lh->b[(int)lh->p];
  311|      1|    if (n1 == NULL)
  ------------------
  |  Branch (311:9): [True: 1, False: 0]
  ------------------
  312|      1|        lh->b[(int)lh->p] = np;
  313|      0|    else {
  314|      0|        while (n1->next != NULL)
  ------------------
  |  Branch (314:16): [True: 0, False: 0]
  ------------------
  315|      0|            n1 = n1->next;
  316|      0|        n1->next = np;
  317|      0|    }
  318|      1|}
lhash.c:getrn:
  322|  9.03k|{
  323|  9.03k|    OPENSSL_LH_NODE **ret, *n1;
  324|  9.03k|    unsigned long hash, nn;
  325|       |
  326|  9.03k|    if (lh->hashw != NULL)
  ------------------
  |  Branch (326:9): [True: 9.03k, False: 0]
  ------------------
  327|  9.03k|        hash = lh->hashw(data, lh->hash);
  328|      0|    else
  329|      0|        hash = lh->hash(data);
  330|       |
  331|  9.03k|    *rhash = hash;
  332|       |
  333|  9.03k|    nn = hash % lh->pmax;
  334|  9.03k|    if (nn < lh->p)
  ------------------
  |  Branch (334:9): [True: 3.03k, False: 6.00k]
  ------------------
  335|  3.03k|        nn = hash % lh->num_alloc_nodes;
  336|       |
  337|  9.03k|    ret = &(lh->b[(int)nn]);
  338|  17.5k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (338:21): [True: 15.5k, False: 2.07k]
  ------------------
  339|  15.5k|        if (n1->hash != hash) {
  ------------------
  |  Branch (339:13): [True: 8.39k, False: 7.11k]
  ------------------
  340|  8.39k|            ret = &(n1->next);
  341|  8.39k|            continue;
  342|  8.39k|        }
  343|       |
  344|  7.11k|        if (lh->compw != NULL) {
  ------------------
  |  Branch (344:13): [True: 7.11k, False: 0]
  ------------------
  345|  7.11k|            if (lh->compw(n1->data, data, lh->comp) == 0)
  ------------------
  |  Branch (345:17): [True: 6.96k, False: 158]
  ------------------
  346|  6.96k|                break;
  347|  7.11k|        } else {
  348|      0|            if (lh->comp(n1->data, data) == 0)
  ------------------
  |  Branch (348:17): [True: 0, False: 0]
  ------------------
  349|      0|                break;
  350|      0|        }
  351|    158|        ret = &(n1->next);
  352|    158|    }
  353|  9.03k|    return ret;
  354|  9.03k|}

CRYPTO_malloc:
  187|   420k|{
  188|   420k|    void *ptr;
  189|       |
  190|   420k|    INCREMENT(malloc_count);
  191|   420k|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (191:9): [True: 0, False: 420k]
  ------------------
  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|   420k|    if (num == 0)
  ------------------
  |  Branch (198:9): [True: 0, False: 420k]
  ------------------
  199|      0|        return NULL;
  200|       |
  201|   420k|    FAILTEST();
  202|   420k|    if (allow_customize) {
  ------------------
  |  Branch (202:9): [True: 1, False: 420k]
  ------------------
  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|      1|        allow_customize = 0;
  209|      1|    }
  210|       |
  211|   420k|    ptr = malloc(num);
  212|   420k|    if (ptr != NULL)
  ------------------
  |  Branch (212:9): [True: 420k, False: 0]
  ------------------
  213|   420k|        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|   420k|}
CRYPTO_zalloc:
  228|   409k|{
  229|   409k|    void *ret;
  230|       |
  231|   409k|    ret = CRYPTO_malloc(num, file, line);
  232|   409k|    if (ret != NULL)
  ------------------
  |  Branch (232:9): [True: 409k, False: 0]
  ------------------
  233|   409k|        memset(ret, 0, num);
  234|       |
  235|   409k|    return ret;
  236|   409k|}
CRYPTO_aligned_alloc:
  240|      2|{
  241|      2|    void *ret;
  242|       |
  243|      2|    *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|      2|    if (malloc_impl == CRYPTO_malloc) {
  ------------------
  |  Branch (251:9): [True: 2, False: 0]
  ------------------
  252|      2|#if defined(_BSD_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)
  253|      2|        if (posix_memalign(&ret, alignment, num))
  ------------------
  |  Branch (253:13): [True: 0, False: 2]
  ------------------
  254|      0|            return NULL;
  255|      2|        *freeptr = ret;
  256|      2|        return ret;
  257|       |#elif defined(_ISOC11_SOURCE)
  258|       |        ret = *freeptr = aligned_alloc(alignment, num);
  259|       |        return ret;
  260|       |#endif
  261|      2|    }
  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|     29|{
  302|     29|    INCREMENT(realloc_count);
  303|     29|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (303:9): [True: 0, False: 29]
  ------------------
  304|      0|        return realloc_impl(str, num, file, line);
  305|       |
  306|     29|    if (str == NULL)
  ------------------
  |  Branch (306:9): [True: 2, False: 27]
  ------------------
  307|      2|        return CRYPTO_malloc(num, file, line);
  308|       |
  309|     27|    if (num == 0) {
  ------------------
  |  Branch (309:9): [True: 0, False: 27]
  ------------------
  310|      0|        CRYPTO_free(str, file, line);
  311|      0|        return NULL;
  312|      0|    }
  313|       |
  314|     27|    FAILTEST();
  315|     27|    return realloc(str, num);
  316|     27|}
CRYPTO_free:
  346|   825k|{
  347|   825k|    INCREMENT(free_count);
  348|   825k|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (348:9): [True: 0, False: 825k]
  ------------------
  349|      0|        free_impl(str, file, line);
  350|      0|        return;
  351|      0|    }
  352|       |
  353|   825k|    free(str);
  354|   825k|}
CRYPTO_clear_free:
  357|  2.58k|{
  358|  2.58k|    if (str == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 2.58k]
  ------------------
  359|      0|        return;
  360|  2.58k|    if (num)
  ------------------
  |  Branch (360:9): [True: 2.58k, False: 0]
  ------------------
  361|  2.58k|        OPENSSL_cleanse(str, num);
  362|  2.58k|    CRYPTO_free(str, file, line);
  363|  2.58k|}

CRYPTO_secure_malloc_done:
  132|      1|{
  133|      1|#ifndef OPENSSL_NO_SECURE_MEMORY
  134|      1|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (134:9): [True: 1, False: 0]
  ------------------
  135|      1|        sh_done();
  136|      1|        secure_mem_initialized = 0;
  137|      1|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  138|      1|        sec_malloc_lock = NULL;
  139|      1|        return 1;
  140|      1|    }
  141|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  142|      0|    return 0;
  143|      1|}
CRYPTO_secure_malloc:
  155|    205|{
  156|    205|#ifndef OPENSSL_NO_SECURE_MEMORY
  157|    205|    void *ret = NULL;
  158|    205|    size_t actual_size;
  159|    205|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   47|    205|# define CRYPTO_R_SECURE_MALLOC_FAILURE                   111
  ------------------
  160|       |
  161|    205|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (161:9): [True: 205, False: 0]
  ------------------
  162|    205|        return CRYPTO_malloc(num, file, line);
  163|    205|    }
  164|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock)) {
  ------------------
  |  Branch (164:9): [True: 0, False: 0]
  ------------------
  165|      0|        reason = ERR_R_CRYPTO_LIB;
  ------------------
  |  |  327|      0|# define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  |  |  ------------------
  |  |               # define ERR_R_CRYPTO_LIB       (ERR_LIB_CRYPTO/* 15 */ | ERR_RFLAG_COMMON)
  |  |  ------------------
  |  |  |  |  237|      0|# define ERR_RFLAG_COMMON               (0x2 << ERR_RFLAGS_OFFSET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|      0|# define ERR_RFLAGS_OFFSET              18L
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|      0|        goto err;
  167|      0|    }
  168|      0|    ret = sh_malloc(num);
  169|      0|    actual_size = ret ? sh_actual_size(ret) : 0;
  ------------------
  |  Branch (169:19): [True: 0, False: 0]
  ------------------
  170|      0|    secure_mem_used += actual_size;
  171|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  172|      0| err:
  173|      0|    if (ret == NULL && (file != NULL || line != 0)) {
  ------------------
  |  Branch (173:9): [True: 0, False: 0]
  |  Branch (173:25): [True: 0, False: 0]
  |  Branch (173:41): [True: 0, False: 0]
  ------------------
  174|      0|        ERR_new();
  175|      0|        ERR_set_debug(file, line, NULL);
  176|      0|        ERR_set_error(ERR_LIB_CRYPTO, reason, NULL);
  ------------------
  |  |   85|      0|# define ERR_LIB_CRYPTO          15
  ------------------
  177|      0|    }
  178|      0|    return ret;
  179|       |#else
  180|       |    return CRYPTO_malloc(num, file, line);
  181|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  182|      0|}
CRYPTO_secure_zalloc:
  185|      4|{
  186|      4|#ifndef OPENSSL_NO_SECURE_MEMORY
  187|      4|    if (secure_mem_initialized)
  ------------------
  |  Branch (187:9): [True: 0, False: 4]
  ------------------
  188|       |        /* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
  189|      0|        return CRYPTO_secure_malloc(num, file, line);
  190|      4|#endif
  191|      4|    return CRYPTO_zalloc(num, file, line);
  192|      4|}
CRYPTO_secure_clear_free:
  219|    999|{
  220|    999|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|    999|    size_t actual_size;
  222|       |
  223|    999|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 790, False: 209]
  ------------------
  224|    790|        return;
  225|    209|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 209, False: 0]
  ------------------
  226|    209|        OPENSSL_cleanse(ptr, num);
  227|    209|        CRYPTO_free(ptr, file, line);
  228|    209|        return;
  229|    209|    }
  230|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  ------------------
  231|      0|        return;
  232|      0|    actual_size = sh_actual_size(ptr);
  233|      0|    CLEAR(ptr, actual_size);
  ------------------
  |  |   82|      0|#define CLEAR(p, s) OPENSSL_cleanse(p, s)
  ------------------
  234|      0|    secure_mem_used -= actual_size;
  235|      0|    sh_free(ptr);
  236|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  237|       |#else
  238|       |    if (ptr == NULL)
  239|       |        return;
  240|       |    OPENSSL_cleanse(ptr, num);
  241|       |    CRYPTO_free(ptr, file, line);
  242|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  243|      0|}
CRYPTO_secure_allocated:
  246|    965|{
  247|    965|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|    965|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 965, False: 0]
  ------------------
  249|    965|        return 0;
  250|       |    /*
  251|       |     * Only read accesses to the arena take place in sh_allocated() and this
  252|       |     * is only changed by the sh_init() and sh_done() calls which are not
  253|       |     * locked.  Hence, it is safe to make this check without a lock too.
  254|       |     */
  255|      0|    return sh_allocated(ptr);
  256|       |#else
  257|       |    return 0;
  258|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  259|    965|}
mem_sec.c:sh_done:
  599|      1|{
  600|      1|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  601|      1|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  602|      1|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  603|      1|#if !defined(_WIN32)
  604|      1|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (604:9): [True: 1, False: 0]
  |  Branch (604:40): [True: 0, False: 1]
  ------------------
  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|      1|    memset(&sh, 0, sizeof(sh));
  611|      1|}

CRYPTO_ctr128_encrypt_ctr32:
  155|  1.32k|{
  156|  1.32k|    unsigned int n, ctr32;
  157|       |
  158|  1.32k|   n = *num;
  159|       |
  160|  1.32k|    while (n && len) {
  ------------------
  |  Branch (160:12): [True: 0, False: 1.32k]
  |  Branch (160:17): [True: 0, False: 0]
  ------------------
  161|      0|        *(out++) = *(in++) ^ ecount_buf[n];
  162|      0|        --len;
  163|      0|        n = (n + 1) % 16;
  164|      0|    }
  165|       |
  166|  1.32k|    ctr32 = GETU32(ivec + 12);
  ------------------
  |  |  103|  1.32k|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
  167|  2.64k|    while (len >= 16) {
  ------------------
  |  Branch (167:12): [True: 1.32k, False: 1.32k]
  ------------------
  168|  1.32k|        size_t blocks = len / 16;
  169|       |        /*
  170|       |         * 1<<28 is just a not-so-small yet not-so-large number...
  171|       |         * Below condition is practically never met, but it has to
  172|       |         * be checked for code correctness.
  173|       |         */
  174|  1.32k|        if (sizeof(size_t) > sizeof(unsigned int) && blocks > (1U << 28))
  ------------------
  |  Branch (174:13): [Folded - Ignored]
  |  Branch (174:54): [True: 0, False: 1.32k]
  ------------------
  175|      0|            blocks = (1U << 28);
  176|       |        /*
  177|       |         * As (*func) operates on 32-bit counter, caller
  178|       |         * has to handle overflow. 'if' below detects the
  179|       |         * overflow, which is then handled by limiting the
  180|       |         * amount of blocks to the exact overflow point...
  181|       |         */
  182|  1.32k|        ctr32 += (u32)blocks;
  183|  1.32k|        if (ctr32 < blocks) {
  ------------------
  |  Branch (183:13): [True: 0, False: 1.32k]
  ------------------
  184|      0|            blocks -= ctr32;
  185|      0|            ctr32 = 0;
  186|      0|        }
  187|  1.32k|        (*func) (in, out, blocks, key, ivec);
  188|       |        /* (*ctr) does not update ivec, caller does: */
  189|  1.32k|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |  104|  1.32k|# define PUTU32(p,v)     ((p)[0]=(u8)((v)>>24),(p)[1]=(u8)((v)>>16),(p)[2]=(u8)((v)>>8),(p)[3]=(u8)(v))
  ------------------
  190|       |        /* ... overflow was detected, propagate carry. */
  191|  1.32k|        if (ctr32 == 0)
  ------------------
  |  Branch (191:13): [True: 0, False: 1.32k]
  ------------------
  192|      0|            ctr96_inc(ivec);
  193|  1.32k|        blocks *= 16;
  194|  1.32k|        len -= blocks;
  195|  1.32k|        out += blocks;
  196|  1.32k|        in += blocks;
  197|  1.32k|    }
  198|  1.32k|    if (len) {
  ------------------
  |  Branch (198:9): [True: 280, False: 1.04k]
  ------------------
  199|    280|        memset(ecount_buf, 0, 16);
  200|    280|        (*func) (ecount_buf, ecount_buf, 1, key, ivec);
  201|    280|        ++ctr32;
  202|    280|        PUTU32(ivec + 12, ctr32);
  ------------------
  |  |  104|    280|# define PUTU32(p,v)     ((p)[0]=(u8)((v)>>24),(p)[1]=(u8)((v)>>16),(p)[2]=(u8)((v)>>8),(p)[3]=(u8)(v))
  ------------------
  203|    280|        if (ctr32 == 0)
  ------------------
  |  Branch (203:13): [True: 0, False: 280]
  ------------------
  204|      0|            ctr96_inc(ivec);
  205|  2.52k|        while (len--) {
  ------------------
  |  Branch (205:16): [True: 2.24k, False: 280]
  ------------------
  206|  2.24k|            out[n] = in[n] ^ ecount_buf[n];
  207|  2.24k|            ++n;
  208|  2.24k|        }
  209|    280|    }
  210|       |
  211|  1.32k|    *num = n;
  212|  1.32k|}

openssl_fopen:
   39|      1|{
   40|      1|    FILE *file = NULL;
   41|       |# if defined(_WIN32) && defined(CP_UTF8)
   42|       |    int sz, len_0;
   43|       |    DWORD flags;
   44|       |# endif
   45|       |
   46|      1|    if (filename == NULL)
  ------------------
  |  Branch (46:9): [True: 0, False: 1]
  ------------------
   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|      1|    file = fopen(filename, mode);
  119|      1|# endif
  120|      1|    return file;
  121|      1|}

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

OBJ_NAME_init:
   64|  1.22k|{
   65|  1.22k|    return RUN_ONCE(&init, o_names_init);
  ------------------
  |  |  130|  1.22k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.22k, False: 0]
  |  |  ------------------
  ------------------
   66|  1.22k|}
OBJ_NAME_get:
  152|    556|{
  153|    556|    OBJ_NAME on, *ret;
  154|    556|    int num = 0, alias;
  155|    556|    const char *value = NULL;
  156|       |
  157|    556|    if (name == NULL)
  ------------------
  |  Branch (157:9): [True: 0, False: 556]
  ------------------
  158|      0|        return NULL;
  159|    556|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (159:9): [True: 0, False: 556]
  ------------------
  160|      0|        return NULL;
  161|    556|    if (!CRYPTO_THREAD_read_lock(obj_lock))
  ------------------
  |  Branch (161:9): [True: 0, False: 556]
  ------------------
  162|      0|        return NULL;
  163|       |
  164|    556|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    556|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  165|    556|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    556|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  166|       |
  167|    556|    on.name = name;
  168|    556|    on.type = type;
  169|       |
  170|    651|    for (;;) {
  171|    651|        ret = lh_OBJ_NAME_retrieve(names_lh, &on);
  172|    651|        if (ret == NULL)
  ------------------
  |  Branch (172:13): [True: 157, False: 494]
  ------------------
  173|    157|            break;
  174|    494|        if ((ret->alias) && !alias) {
  ------------------
  |  Branch (174:13): [True: 95, False: 399]
  |  Branch (174:29): [True: 95, False: 0]
  ------------------
  175|     95|            if (++num > 10)
  ------------------
  |  Branch (175:17): [True: 0, False: 95]
  ------------------
  176|      0|                break;
  177|     95|            on.name = ret->data;
  178|    399|        } else {
  179|    399|            value = ret->data;
  180|    399|            break;
  181|    399|        }
  182|    494|    }
  183|       |
  184|    556|    CRYPTO_THREAD_unlock(obj_lock);
  185|    556|    return value;
  186|    556|}
OBJ_NAME_add:
  189|    424|{
  190|    424|    OBJ_NAME *onp, *ret;
  191|    424|    int alias, ok = 0;
  192|       |
  193|    424|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (193:9): [True: 0, False: 424]
  ------------------
  194|      0|        return 0;
  195|       |
  196|    424|    alias = type & OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  197|    424|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    424|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  198|       |
  199|    424|    onp = OPENSSL_malloc(sizeof(*onp));
  ------------------
  |  |  102|    424|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    424|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    424|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  200|    424|    if (onp == NULL)
  ------------------
  |  Branch (200:9): [True: 0, False: 424]
  ------------------
  201|      0|        return 0;
  202|       |
  203|    424|    onp->name = name;
  204|    424|    onp->alias = alias;
  205|    424|    onp->type = type;
  206|    424|    onp->data = data;
  207|       |
  208|    424|    if (!CRYPTO_THREAD_write_lock(obj_lock)) {
  ------------------
  |  Branch (208:9): [True: 0, False: 424]
  ------------------
  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|    424|    ret = lh_OBJ_NAME_insert(names_lh, onp);
  214|    424|    if (ret != NULL) {
  ------------------
  |  Branch (214:9): [True: 182, False: 242]
  ------------------
  215|       |        /* free things */
  216|    182|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (216:13): [True: 0, False: 182]
  ------------------
  217|    182|            && (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|    182|        OPENSSL_free(ret);
  ------------------
  |  |  115|    182|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    182|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    182|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  227|    242|    } else {
  228|    242|        if (lh_OBJ_NAME_error(names_lh)) {
  ------------------
  |  Branch (228:13): [True: 0, False: 242]
  ------------------
  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|    242|    }
  234|       |
  235|    424|    ok = 1;
  236|       |
  237|    424|unlock:
  238|    424|    CRYPTO_THREAD_unlock(obj_lock);
  239|    424|    return ok;
  240|    424|}
OBJ_NAME_remove:
  243|    242|{
  244|    242|    OBJ_NAME on, *ret;
  245|    242|    int ok = 0;
  246|       |
  247|    242|    if (!OBJ_NAME_init())
  ------------------
  |  Branch (247:9): [True: 0, False: 242]
  ------------------
  248|      0|        return 0;
  249|       |
  250|    242|    if (!CRYPTO_THREAD_write_lock(obj_lock))
  ------------------
  |  Branch (250:9): [True: 0, False: 242]
  ------------------
  251|      0|        return 0;
  252|       |
  253|    242|    type &= ~OBJ_NAME_ALIAS;
  ------------------
  |  |   33|    242|# define OBJ_NAME_ALIAS                  0x8000
  ------------------
  254|    242|    on.name = name;
  255|    242|    on.type = type;
  256|    242|    ret = lh_OBJ_NAME_delete(names_lh, &on);
  257|    242|    if (ret != NULL) {
  ------------------
  |  Branch (257:9): [True: 242, False: 0]
  ------------------
  258|       |        /* free things */
  259|    242|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (259:13): [True: 0, False: 242]
  ------------------
  260|    242|            && (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|    242|        OPENSSL_free(ret);
  ------------------
  |  |  115|    242|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    242|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    242|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  270|    242|        ok = 1;
  271|    242|    }
  272|       |
  273|    242|    CRYPTO_THREAD_unlock(obj_lock);
  274|    242|    return ok;
  275|    242|}
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|      4|{
  369|      4|    unsigned long down_load;
  370|       |
  371|      4|    if (names_lh == NULL)
  ------------------
  |  Branch (371:9): [True: 0, False: 4]
  ------------------
  372|      0|        return;
  373|       |
  374|      4|    free_type = type;
  375|      4|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  376|      4|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  377|       |
  378|      4|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  379|      4|    if (type < 0) {
  ------------------
  |  Branch (379:9): [True: 1, False: 3]
  ------------------
  380|      1|        lh_OBJ_NAME_free(names_lh);
  381|      1|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  382|      1|        CRYPTO_THREAD_lock_free(obj_lock);
  383|      1|        names_lh = NULL;
  384|      1|        name_funcs_stack = NULL;
  385|      1|        obj_lock = NULL;
  386|      1|    } else
  387|      3|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  388|      4|}
o_names.c:o_names_init:
   51|      1|{
   52|      1|    names_lh = NULL;
   53|      1|    obj_lock = CRYPTO_THREAD_lock_new();
   54|      1|    if (obj_lock != NULL)
  ------------------
  |  Branch (54:9): [True: 1, False: 0]
  ------------------
   55|      1|        names_lh = lh_OBJ_NAME_new(obj_name_hash, obj_name_cmp);
   56|      1|    if (names_lh == NULL) {
  ------------------
  |  Branch (56:9): [True: 0, False: 1]
  ------------------
   57|      0|        CRYPTO_THREAD_lock_free(obj_lock);
   58|      0|        obj_lock = NULL;
   59|      0|    }
   60|      1|    return names_lh != NULL && obj_lock != NULL;
  ------------------
  |  Branch (60:12): [True: 1, False: 0]
  |  Branch (60:32): [True: 1, False: 0]
  ------------------
   61|      1|}
o_names.c:obj_name_hash:
  136|  1.31k|{
  137|  1.31k|    unsigned long ret;
  138|       |
  139|  1.31k|    if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 1.31k]
  ------------------
  140|  1.31k|        && (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.31k|    } else {
  145|  1.31k|        ret = ossl_lh_strcasehash(a->name);
  146|  1.31k|    }
  147|  1.31k|    ret ^= a->type;
  148|  1.31k|    return ret;
  149|  1.31k|}
o_names.c:obj_name_cmp:
  120|    918|{
  121|    918|    int ret;
  122|       |
  123|    918|    ret = a->type - b->type;
  124|    918|    if (ret == 0) {
  ------------------
  |  Branch (124:9): [True: 918, False: 0]
  ------------------
  125|    918|        if ((name_funcs_stack != NULL)
  ------------------
  |  Branch (125:13): [True: 0, False: 918]
  ------------------
  126|    918|            && (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|    918|            ret = OPENSSL_strcasecmp(a->name, b->name);
  131|    918|    }
  132|    918|    return ret;
  133|    918|}
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|    543|{
  355|    543|    if (onp == NULL)
  ------------------
  |  Branch (355:9): [True: 0, False: 543]
  ------------------
  356|      0|        return;
  357|       |
  358|    543|    if (free_type < 0 || free_type == onp->type)
  ------------------
  |  Branch (358:9): [True: 0, False: 543]
  |  Branch (358:26): [True: 242, False: 301]
  ------------------
  359|    242|        OBJ_NAME_remove(onp->name, onp->type);
  360|    543|}

ossl_obj_cleanup_int:
  212|      1|{
  213|      1|    if (added != NULL) {
  ------------------
  |  Branch (213:9): [True: 0, False: 1]
  ------------------
  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|      1|    objs_free_locks();
  222|      1|}
OBJ_nid2obj:
  331|  1.67k|{
  332|  1.67k|    ADDED_OBJ ad, *adp = NULL;
  333|  1.67k|    ASN1_OBJECT ob;
  334|       |
  335|  1.67k|    if (n == NID_undef
  ------------------
  |  |   18|  3.34k|#define NID_undef                       0
  ------------------
  |  Branch (335:9): [True: 0, False: 1.67k]
  ------------------
  336|  1.67k|        || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  | 1353|  3.34k|#define NUM_NID 1496
  ------------------
                      || (n > 0 && n < NUM_NID && nid_objs[n].nid != NID_undef))
  ------------------
  |  |   18|  1.67k|#define NID_undef                       0
  ------------------
  |  Branch (336:13): [True: 1.67k, False: 0]
  |  Branch (336:22): [True: 1.67k, False: 0]
  |  Branch (336:37): [True: 1.67k, False: 0]
  ------------------
  337|  1.67k|        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|    396|{
  358|    396|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  359|       |
  360|    396|    return ob == NULL ? NULL : ob->sn;
  ------------------
  |  Branch (360:12): [True: 0, False: 396]
  ------------------
  361|    396|}
OBJ_nid2ln:
  364|    909|{
  365|    909|    ASN1_OBJECT *ob = OBJ_nid2obj(n);
  366|       |
  367|    909|    return ob == NULL ? NULL : ob->ln;
  ------------------
  |  Branch (367:12): [True: 0, False: 909]
  ------------------
  368|    909|}
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_ln2nid:
  637|  1.04k|{
  638|  1.04k|    ASN1_OBJECT o;
  639|  1.04k|    const ASN1_OBJECT *oo = &o;
  640|  1.04k|    ADDED_OBJ ad, *adp;
  641|  1.04k|    const unsigned int *op;
  642|  1.04k|    int nid = NID_undef;
  ------------------
  |  |   18|  1.04k|#define NID_undef                       0
  ------------------
  643|       |
  644|  1.04k|    o.ln = s;
  645|  1.04k|    op = OBJ_bsearch_ln(&oo, ln_objs, NUM_LN);
  ------------------
  |  | 4344|  1.04k|#define NUM_LN 1487
  ------------------
  646|  1.04k|    if (op != NULL)
  ------------------
  |  Branch (646:9): [True: 990, False: 55]
  ------------------
  647|    990|        return nid_objs[*op].nid;
  648|     55|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (648:9): [True: 0, False: 55]
  ------------------
  649|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  650|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  651|      0|    }
  652|     55|    if (added != NULL) {
  ------------------
  |  Branch (652:9): [True: 0, False: 55]
  ------------------
  653|      0|        ad.type = ADDED_LNAME;
  ------------------
  |  |   32|      0|#define ADDED_LNAME     2
  ------------------
  654|      0|        ad.obj = &o;
  655|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  656|      0|        if (adp != NULL)
  ------------------
  |  Branch (656:13): [True: 0, False: 0]
  ------------------
  657|      0|            nid = adp->obj->nid;
  658|      0|    }
  659|     55|    ossl_obj_unlock(1);
  660|     55|    return nid;
  661|     55|}
OBJ_sn2nid:
  664|  1.05k|{
  665|  1.05k|    ASN1_OBJECT o;
  666|  1.05k|    const ASN1_OBJECT *oo = &o;
  667|  1.05k|    ADDED_OBJ ad, *adp;
  668|  1.05k|    const unsigned int *op;
  669|  1.05k|    int nid = NID_undef;
  ------------------
  |  |   18|  1.05k|#define NID_undef                       0
  ------------------
  670|       |
  671|  1.05k|    o.sn = s;
  672|  1.05k|    op = OBJ_bsearch_sn(&oo, sn_objs, NUM_SN);
  ------------------
  |  | 2853|  1.05k|#define NUM_SN 1487
  ------------------
  673|  1.05k|    if (op != NULL)
  ------------------
  |  Branch (673:9): [True: 28, False: 1.02k]
  ------------------
  674|     28|        return nid_objs[*op].nid;
  675|  1.02k|    if (!ossl_obj_read_lock(1)) {
  ------------------
  |  Branch (675:9): [True: 0, False: 1.02k]
  ------------------
  676|      0|        ERR_raise(ERR_LIB_OBJ, ERR_R_UNABLE_TO_GET_READ_LOCK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  677|      0|        return NID_undef;
  ------------------
  |  |   18|      0|#define NID_undef                       0
  ------------------
  678|      0|    }
  679|  1.02k|    if (added != NULL) {
  ------------------
  |  Branch (679:9): [True: 0, False: 1.02k]
  ------------------
  680|      0|        ad.type = ADDED_SNAME;
  ------------------
  |  |   31|      0|#define ADDED_SNAME     1
  ------------------
  681|      0|        ad.obj = &o;
  682|      0|        adp = lh_ADDED_OBJ_retrieve(added, &ad);
  683|      0|        if (adp != NULL)
  ------------------
  |  Branch (683:13): [True: 0, False: 0]
  ------------------
  684|      0|            nid = adp->obj->nid;
  685|      0|    }
  686|  1.02k|    ossl_obj_unlock(1);
  687|  1.02k|    return nid;
  688|  1.02k|}
OBJ_bsearch_:
  692|  4.19k|{
  693|  4.19k|    return OBJ_bsearch_ex_(key, base, num, size, cmp, 0);
  694|  4.19k|}
OBJ_bsearch_ex_:
  700|  4.19k|{
  701|  4.19k|    const char *p = ossl_bsearch(key, base, num, size, cmp, flags);
  702|       |
  703|       |#ifdef CHARSET_EBCDIC
  704|       |    /*
  705|       |     * THIS IS A KLUDGE - Because the *_obj is sorted in ASCII order, and I
  706|       |     * don't have perl (yet), we revert to a *LINEAR* search when the object
  707|       |     * wasn't found in the binary search.
  708|       |     */
  709|       |    if (p == NULL) {
  710|       |        const char *base_ = base;
  711|       |        int l, h, i = 0, c = 0;
  712|       |        char *p1;
  713|       |
  714|       |        for (i = 0; i < num; ++i) {
  715|       |            p1 = &(base_[i * size]);
  716|       |            c = (*cmp) (key, p1);
  717|       |            if (c == 0
  718|       |                || (c < 0 && (flags & OBJ_BSEARCH_VALUE_ON_NOMATCH)))
  719|       |                return p1;
  720|       |        }
  721|       |    }
  722|       |#endif
  723|  4.19k|    return p;
  724|  4.19k|}
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|      1|{
   50|      1|    CRYPTO_THREAD_lock_free(ossl_obj_lock);
   51|      1|    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|      1|}
obj_dat.c:ossl_obj_read_lock:
   93|  1.07k|{
   94|  1.07k|    if (!lock)
  ------------------
  |  Branch (94:9): [True: 0, False: 1.07k]
  ------------------
   95|      0|        return 1;
   96|  1.07k|    if (!ossl_init_added_lock())
  ------------------
  |  Branch (96:9): [True: 0, False: 1.07k]
  ------------------
   97|      0|        return 0;
   98|  1.07k|    return CRYPTO_THREAD_read_lock(ossl_obj_lock);
   99|  1.07k|}
obj_dat.c:ossl_init_added_lock:
   75|  1.07k|{
   76|  1.07k|#ifndef OPENSSL_NO_AUTOLOAD_CONFIG
   77|       |    /* Make sure we've loaded config before checking for any "added" objects */
   78|  1.07k|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|  1.07k|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
   79|  1.07k|#endif
   80|  1.07k|    return RUN_ONCE(&ossl_obj_lock_init, obj_lock_initialise);
  ------------------
  |  |  130|  1.07k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.07k, False: 0]
  |  |  ------------------
  ------------------
   81|  1.07k|}
obj_dat.c:obj_lock_initialise:
   59|      1|{
   60|      1|    ossl_obj_lock = CRYPTO_THREAD_lock_new();
   61|      1|    if (ossl_obj_lock == NULL)
  ------------------
  |  Branch (61:9): [True: 0, False: 1]
  ------------------
   62|      0|        return 0;
   63|       |
   64|       |#ifdef TSAN_REQUIRES_LOCKING
   65|       |    ossl_obj_nid_lock = CRYPTO_THREAD_lock_new();
   66|       |    if (ossl_obj_nid_lock == NULL) {
   67|       |        objs_free_locks();
   68|       |        return 0;
   69|       |    }
   70|       |#endif
   71|      1|    return 1;
   72|      1|}
obj_dat.c:ossl_obj_unlock:
  102|  1.07k|{
  103|  1.07k|    if (lock)
  ------------------
  |  Branch (103:9): [True: 1.07k, False: 0]
  ------------------
  104|  1.07k|        CRYPTO_THREAD_unlock(ossl_obj_lock);
  105|  1.07k|}
obj_dat.c:ln_cmp:
  115|  10.1k|{
  116|  10.1k|    return strcmp((*a)->ln, nid_objs[*b].ln);
  117|  10.1k|}
obj_dat.c:sn_cmp:
  108|  11.5k|{
  109|  11.5k|    return strcmp((*a)->sn, nid_objs[*b].sn);
  110|  11.5k|}

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

OBJ_sigid_free:
  215|      1|{
  216|      1|    sk_nid_triple_pop_free(sig_app, sid_free);
  217|      1|    sk_nid_triple_free(sigx_app);
  218|      1|    CRYPTO_THREAD_lock_free(sig_lock);
  219|      1|    sig_app = NULL;
  220|      1|    sigx_app = NULL;
  221|      1|    sig_lock = NULL;
  222|      1|}

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

WPACKET_allocate_bytes:
   20|  20.4M|{
   21|  20.4M|    if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
  ------------------
  |  Branch (21:9): [True: 0, False: 20.4M]
  ------------------
   22|      0|        return 0;
   23|       |
   24|  20.4M|    pkt->written += len;
   25|  20.4M|    pkt->curr += len;
   26|  20.4M|    return 1;
   27|  20.4M|}
WPACKET_reserve_bytes:
   47|  20.4M|{
   48|       |    /* Internal API, so should not fail */
   49|  20.4M|    if (!ossl_assert(pkt->subs != NULL && len != 0))
  ------------------
  |  |   52|  40.8M|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 20.4M, False: 0]
  |  |  |  Branch (52:43): [True: 20.4M, False: 0]
  |  |  ------------------
  |  |   53|  20.4M|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (49:9): [True: 0, False: 20.4M]
  ------------------
   50|      0|        return 0;
   51|       |
   52|  20.4M|    if (pkt->maxsize - pkt->written < len)
  ------------------
  |  Branch (52:9): [True: 0, False: 20.4M]
  ------------------
   53|      0|        return 0;
   54|       |
   55|  20.4M|    if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) {
  ------------------
  |  Branch (55:9): [True: 0, False: 20.4M]
  |  Branch (55:29): [True: 0, False: 0]
  ------------------
   56|      0|        size_t newlen;
   57|      0|        size_t reflen;
   58|       |
   59|      0|        reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
  ------------------
  |  Branch (59:18): [True: 0, False: 0]
  ------------------
   60|       |
   61|      0|        if (reflen > SIZE_MAX / 2) {
  ------------------
  |  Branch (61:13): [True: 0, False: 0]
  ------------------
   62|      0|            newlen = SIZE_MAX;
   63|      0|        } else {
   64|      0|            newlen = reflen * 2;
   65|      0|            if (newlen < DEFAULT_BUF_SIZE)
  ------------------
  |  |   17|      0|#define DEFAULT_BUF_SIZE    256
  ------------------
  |  Branch (65:17): [True: 0, False: 0]
  ------------------
   66|      0|                newlen = DEFAULT_BUF_SIZE;
  ------------------
  |  |   17|      0|#define DEFAULT_BUF_SIZE    256
  ------------------
   67|      0|        }
   68|      0|        if (BUF_MEM_grow(pkt->buf, newlen) == 0)
  ------------------
  |  Branch (68:13): [True: 0, False: 0]
  ------------------
   69|      0|            return 0;
   70|      0|    }
   71|  20.4M|    if (allocbytes != NULL) {
  ------------------
  |  Branch (71:9): [True: 20.4M, False: 0]
  ------------------
   72|  20.4M|        *allocbytes = WPACKET_get_curr(pkt);
   73|  20.4M|        if (pkt->endfirst && *allocbytes != NULL)
  ------------------
  |  Branch (73:13): [True: 1.91k, False: 20.4M]
  |  Branch (73:30): [True: 1.91k, False: 0]
  ------------------
   74|  1.91k|            *allocbytes -= len;
   75|  20.4M|    }
   76|       |
   77|  20.4M|    return 1;
   78|  20.4M|}
WPACKET_init_static_len:
  131|   390k|{
  132|   390k|    size_t max = maxmaxsize(lenbytes);
  133|       |
  134|       |    /* Internal API, so should not fail */
  135|   390k|    if (!ossl_assert(buf != NULL && len > 0))
  ------------------
  |  |   52|   781k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 390k, False: 0]
  |  |  |  Branch (52:43): [True: 390k, False: 0]
  |  |  ------------------
  |  |   53|   390k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (135:9): [True: 0, False: 390k]
  ------------------
  136|      0|        return 0;
  137|       |
  138|   390k|    pkt->staticbuf = buf;
  139|   390k|    pkt->buf = NULL;
  140|   390k|    pkt->maxsize = (max < len) ? max : len;
  ------------------
  |  Branch (140:20): [True: 0, False: 390k]
  ------------------
  141|   390k|    pkt->endfirst = 0;
  142|       |
  143|   390k|    return wpacket_intern_init_len(pkt, lenbytes);
  144|   390k|}
WPACKET_init_der:
  147|    639|{
  148|       |    /* Internal API, so should not fail */
  149|    639|    if (!ossl_assert(buf != NULL && len > 0))
  ------------------
  |  |   52|  1.27k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |  ------------------
  |  |  |  Branch (52:43): [True: 639, False: 0]
  |  |  |  Branch (52:43): [True: 639, False: 0]
  |  |  ------------------
  |  |   53|    639|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (149:9): [True: 0, False: 639]
  ------------------
  150|      0|        return 0;
  151|       |
  152|    639|    pkt->staticbuf = buf;
  153|    639|    pkt->buf = NULL;
  154|    639|    pkt->maxsize = len;
  155|    639|    pkt->endfirst = 1;
  156|       |
  157|    639|    return wpacket_intern_init_len(pkt, 0);
  158|    639|}
WPACKET_close:
  335|    639|{
  336|       |    /*
  337|       |     * Internal API, so should not fail - but we do negative testing of this
  338|       |     * so no assert (otherwise the tests fail)
  339|       |     */
  340|    639|    if (pkt->subs == NULL || pkt->subs->parent == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 639]
  |  Branch (340:30): [True: 0, False: 639]
  ------------------
  341|      0|        return 0;
  342|       |
  343|    639|    return wpacket_intern_close(pkt, pkt->subs, 1);
  344|    639|}
WPACKET_finish:
  347|   391k|{
  348|   391k|    int ret;
  349|       |
  350|       |    /*
  351|       |     * Internal API, so should not fail - but we do negative testing of this
  352|       |     * so no assert (otherwise the tests fail)
  353|       |     */
  354|   391k|    if (pkt->subs == NULL || pkt->subs->parent != NULL)
  ------------------
  |  Branch (354:9): [True: 0, False: 391k]
  |  Branch (354:30): [True: 0, False: 391k]
  ------------------
  355|      0|        return 0;
  356|       |
  357|   391k|    ret = wpacket_intern_close(pkt, pkt->subs, 1);
  358|   391k|    if (ret) {
  ------------------
  |  Branch (358:9): [True: 391k, False: 0]
  ------------------
  359|   391k|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  115|   391k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   391k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   391k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  360|   391k|        pkt->subs = NULL;
  361|   391k|    }
  362|       |
  363|   391k|    return ret;
  364|   391k|}
WPACKET_start_sub_packet_len__:
  367|    639|{
  368|    639|    WPACKET_SUB *sub;
  369|    639|    unsigned char *lenchars;
  370|       |
  371|       |    /* Internal API, so should not fail */
  372|    639|    if (!ossl_assert(pkt->subs != NULL))
  ------------------
  |  |   52|    639|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|    639|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (372:9): [True: 0, False: 639]
  ------------------
  373|      0|        return 0;
  374|       |
  375|       |    /* We don't support lenbytes greater than 0 when doing endfirst writing */
  376|    639|    if (lenbytes > 0 && pkt->endfirst)
  ------------------
  |  Branch (376:9): [True: 0, False: 639]
  |  Branch (376:25): [True: 0, False: 0]
  ------------------
  377|      0|        return 0;
  378|       |
  379|    639|    if ((sub = OPENSSL_zalloc(sizeof(*sub))) == NULL)
  ------------------
  |  |  104|    639|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (379:9): [True: 0, False: 639]
  ------------------
  380|      0|        return 0;
  381|       |
  382|    639|    sub->parent = pkt->subs;
  383|    639|    pkt->subs = sub;
  384|    639|    sub->pwritten = pkt->written + lenbytes;
  385|    639|    sub->lenbytes = lenbytes;
  386|       |
  387|    639|    if (lenbytes == 0) {
  ------------------
  |  Branch (387:9): [True: 639, False: 0]
  ------------------
  388|    639|        sub->packet_len = 0;
  389|    639|        return 1;
  390|    639|    }
  391|       |
  392|      0|    sub->packet_len = pkt->written;
  393|       |
  394|      0|    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars))
  ------------------
  |  Branch (394:9): [True: 0, False: 0]
  ------------------
  395|      0|        return 0;
  396|       |
  397|      0|    return 1;
  398|      0|}
WPACKET_start_sub_packet:
  401|    639|{
  402|    639|    return WPACKET_start_sub_packet_len__(pkt, 0);
  403|    639|}
WPACKET_put_bytes__:
  406|  1.27k|{
  407|  1.27k|    unsigned char *data;
  408|       |
  409|       |    /* Internal API, so should not fail */
  410|  1.27k|    if (!ossl_assert(size <= sizeof(uint64_t))
  ------------------
  |  |   52|  2.55k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.55k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (410:9): [True: 0, False: 1.27k]
  ------------------
  411|  1.27k|            || !WPACKET_allocate_bytes(pkt, size, &data)
  ------------------
  |  Branch (411:16): [True: 0, False: 1.27k]
  ------------------
  412|  1.27k|            || !put_value(data, val, size))
  ------------------
  |  Branch (412:16): [True: 0, False: 1.27k]
  ------------------
  413|      0|        return 0;
  414|       |
  415|  1.27k|    return 1;
  416|  1.27k|}
WPACKET_memcpy:
  460|   133k|{
  461|   133k|    unsigned char *dest;
  462|       |
  463|   133k|    if (len == 0)
  ------------------
  |  Branch (463:9): [True: 0, False: 133k]
  ------------------
  464|      0|        return 1;
  465|       |
  466|   133k|    if (!WPACKET_allocate_bytes(pkt, len, &dest))
  ------------------
  |  Branch (466:9): [True: 0, False: 133k]
  ------------------
  467|      0|        return 0;
  468|       |
  469|   133k|    if (dest != NULL)
  ------------------
  |  Branch (469:9): [True: 133k, False: 0]
  ------------------
  470|   133k|        memcpy(dest, src, len);
  471|       |
  472|   133k|    return 1;
  473|   133k|}
WPACKET_get_total_written:
  487|   392k|{
  488|       |    /* Internal API, so should not fail */
  489|   392k|    if (!ossl_assert(written != NULL))
  ------------------
  |  |   52|   392k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|   392k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (489:9): [True: 0, False: 392k]
  ------------------
  490|      0|        return 0;
  491|       |
  492|   392k|    *written = pkt->written;
  493|       |
  494|   392k|    return 1;
  495|   392k|}
WPACKET_get_curr:
  509|  20.4M|{
  510|  20.4M|    unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|  20.4M|#define GETBUF(p)   (((p)->staticbuf != NULL) \
  |  |  ------------------
  |  |  |  Branch (40:22): [True: 20.4M, False: 0]
  |  |  ------------------
  |  |   41|  20.4M|                     ? (p)->staticbuf \
  |  |   42|  20.4M|                     : ((p)->buf != NULL \
  |  |  ------------------
  |  |  |  Branch (42:25): [True: 0, False: 0]
  |  |  ------------------
  |  |   43|      0|                        ? (unsigned char *)(p)->buf->data \
  |  |   44|      0|                        : NULL))
  ------------------
  511|       |
  512|  20.4M|    if (buf == NULL)
  ------------------
  |  Branch (512:9): [True: 0, False: 20.4M]
  ------------------
  513|      0|        return NULL;
  514|       |
  515|  20.4M|    if (pkt->endfirst)
  ------------------
  |  Branch (515:9): [True: 2.55k, False: 20.4M]
  ------------------
  516|  2.55k|        return buf + pkt->maxsize - pkt->curr;
  517|       |
  518|  20.4M|    return buf + pkt->curr;
  519|  20.4M|}
WPACKET_cleanup:
  527|    639|{
  528|    639|    WPACKET_SUB *sub, *parent;
  529|       |
  530|    639|    for (sub = pkt->subs; sub != NULL; sub = parent) {
  ------------------
  |  Branch (530:27): [True: 0, False: 639]
  ------------------
  531|      0|        parent = sub->parent;
  532|      0|        OPENSSL_free(sub);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  533|      0|    }
  534|    639|    pkt->subs = NULL;
  535|    639|}
packet.c:maxmaxsize:
   96|   390k|{
   97|   390k|    if (lenbytes >= sizeof(size_t) || lenbytes == 0)
  ------------------
  |  Branch (97:9): [True: 0, False: 390k]
  |  Branch (97:39): [True: 390k, False: 0]
  ------------------
   98|   390k|        return SIZE_MAX;
   99|       |
  100|      0|    return ((size_t)1 << (lenbytes * 8)) - 1 + lenbytes;
  101|   390k|}
packet.c:wpacket_intern_init_len:
  104|   391k|{
  105|   391k|    unsigned char *lenchars;
  106|       |
  107|   391k|    pkt->curr = 0;
  108|   391k|    pkt->written = 0;
  109|       |
  110|   391k|    if ((pkt->subs = OPENSSL_zalloc(sizeof(*pkt->subs))) == NULL)
  ------------------
  |  |  104|   391k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   391k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   391k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (110:9): [True: 0, False: 391k]
  ------------------
  111|      0|        return 0;
  112|       |
  113|   391k|    if (lenbytes == 0)
  ------------------
  |  Branch (113:9): [True: 391k, False: 0]
  ------------------
  114|   391k|        return 1;
  115|       |
  116|      0|    pkt->subs->pwritten = lenbytes;
  117|      0|    pkt->subs->lenbytes = lenbytes;
  118|       |
  119|      0|    if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) {
  ------------------
  |  Branch (119:9): [True: 0, False: 0]
  ------------------
  120|      0|        OPENSSL_free(pkt->subs);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  121|      0|        pkt->subs = NULL;
  122|      0|        return 0;
  123|      0|    }
  124|      0|    pkt->subs->packet_len = 0;
  125|       |
  126|      0|    return 1;
  127|      0|}
packet.c:wpacket_intern_close:
  251|   391k|{
  252|   391k|    size_t packlen = pkt->written - sub->pwritten;
  253|       |
  254|   391k|    if (packlen == 0
  ------------------
  |  Branch (254:9): [True: 0, False: 391k]
  ------------------
  255|   391k|            && (sub->flags & WPACKET_FLAGS_NON_ZERO_LENGTH) != 0)
  ------------------
  |  |  686|      0|#define WPACKET_FLAGS_NON_ZERO_LENGTH           1
  ------------------
  |  Branch (255:16): [True: 0, False: 0]
  ------------------
  256|      0|        return 0;
  257|       |
  258|   391k|    if (packlen == 0
  ------------------
  |  Branch (258:9): [True: 0, False: 391k]
  ------------------
  259|   391k|            && sub->flags & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) {
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  |  Branch (259:16): [True: 0, False: 0]
  ------------------
  260|       |        /* We can't handle this case. Return an error */
  261|      0|        if (!doclose)
  ------------------
  |  Branch (261:13): [True: 0, False: 0]
  ------------------
  262|      0|            return 0;
  263|       |
  264|       |        /* Deallocate any bytes allocated for the length of the WPACKET */
  265|      0|        if ((pkt->curr - sub->lenbytes) == sub->packet_len) {
  ------------------
  |  Branch (265:13): [True: 0, False: 0]
  ------------------
  266|      0|            pkt->written -= sub->lenbytes;
  267|      0|            pkt->curr -= sub->lenbytes;
  268|      0|        }
  269|       |
  270|       |        /* Don't write out the packet length */
  271|      0|        sub->packet_len = 0;
  272|      0|        sub->lenbytes = 0;
  273|      0|    }
  274|       |
  275|       |    /* Write out the WPACKET length if needed */
  276|   391k|    if (sub->lenbytes > 0) {
  ------------------
  |  Branch (276:9): [True: 0, False: 391k]
  ------------------
  277|      0|        unsigned char *buf = GETBUF(pkt);
  ------------------
  |  |   40|      0|#define GETBUF(p)   (((p)->staticbuf != NULL) \
  |  |  ------------------
  |  |  |  Branch (40:22): [True: 0, False: 0]
  |  |  ------------------
  |  |   41|      0|                     ? (p)->staticbuf \
  |  |   42|      0|                     : ((p)->buf != NULL \
  |  |  ------------------
  |  |  |  Branch (42:25): [True: 0, False: 0]
  |  |  ------------------
  |  |   43|      0|                        ? (unsigned char *)(p)->buf->data \
  |  |   44|      0|                        : NULL))
  ------------------
  278|       |
  279|      0|        if (buf != NULL) {
  ------------------
  |  Branch (279:13): [True: 0, False: 0]
  ------------------
  280|      0|#if !defined OPENSSL_NO_QUIC && !defined FIPS_MODULE
  281|      0|            if ((sub->flags & WPACKET_FLAGS_QUIC_VLINT) == 0) {
  ------------------
  |  |  695|      0|#define WPACKET_FLAGS_QUIC_VLINT                4
  ------------------
  |  Branch (281:17): [True: 0, False: 0]
  ------------------
  282|      0|                if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes))
  ------------------
  |  Branch (282:21): [True: 0, False: 0]
  ------------------
  283|      0|                    return 0;
  284|      0|            } else {
  285|      0|                if (!put_quic_value(&buf[sub->packet_len], packlen, sub->lenbytes))
  ------------------
  |  Branch (285:21): [True: 0, False: 0]
  ------------------
  286|      0|                    return 0;
  287|      0|            }
  288|       |#else
  289|       |            if (!put_value(&buf[sub->packet_len], packlen, sub->lenbytes))
  290|       |                return 0;
  291|       |#endif
  292|      0|        }
  293|   391k|    } else if (pkt->endfirst && sub->parent != NULL
  ------------------
  |  Branch (293:16): [True: 1.27k, False: 390k]
  |  Branch (293:33): [True: 639, False: 639]
  ------------------
  294|   391k|               && (packlen != 0
  ------------------
  |  Branch (294:20): [True: 639, False: 0]
  ------------------
  295|    639|                   || (sub->flags
  ------------------
  |  Branch (295:23): [True: 0, False: 0]
  ------------------
  296|    639|                       & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) == 0)) {
  ------------------
  |  |  692|      0|#define WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH    2
  ------------------
  297|    639|        size_t tmplen = packlen;
  298|    639|        size_t numlenbytes = 1;
  299|       |
  300|    639|        while ((tmplen = tmplen >> 8) > 0)
  ------------------
  |  Branch (300:16): [True: 0, False: 639]
  ------------------
  301|      0|            numlenbytes++;
  302|    639|        if (!WPACKET_put_bytes__(pkt, packlen, numlenbytes))
  ------------------
  |  Branch (302:13): [True: 0, False: 639]
  ------------------
  303|      0|            return 0;
  304|    639|        if (packlen > 0x7f) {
  ------------------
  |  Branch (304:13): [True: 0, False: 639]
  ------------------
  305|      0|            numlenbytes |= 0x80;
  306|      0|            if (!WPACKET_put_bytes_u8(pkt, numlenbytes))
  ------------------
  |  |  878|      0|    WPACKET_put_bytes__((pkt), (val), 1)
  ------------------
  |  Branch (306:17): [True: 0, False: 0]
  ------------------
  307|      0|                return 0;
  308|      0|        }
  309|    639|    }
  310|       |
  311|   391k|    if (doclose) {
  ------------------
  |  Branch (311:9): [True: 391k, False: 0]
  ------------------
  312|   391k|        pkt->subs = sub->parent;
  313|   391k|        OPENSSL_free(sub);
  ------------------
  |  |  115|   391k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|   391k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|   391k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  314|   391k|    }
  315|       |
  316|   391k|    return 1;
  317|   391k|}
packet.c:put_value:
  212|  1.27k|{
  213|  1.27k|    if (data == NULL)
  ------------------
  |  Branch (213:9): [True: 0, False: 1.27k]
  ------------------
  214|      0|        return 1;
  215|       |
  216|  2.55k|    for (data += len - 1; len > 0; len--) {
  ------------------
  |  Branch (216:27): [True: 1.27k, False: 1.27k]
  ------------------
  217|  1.27k|        *data = (unsigned char)(value & 0xff);
  218|  1.27k|        data--;
  219|  1.27k|        value >>= 8;
  220|  1.27k|    }
  221|       |
  222|       |    /* Check whether we could fit the value in the assigned number of bytes */
  223|  1.27k|    if (value > 0)
  ------------------
  |  Branch (223:9): [True: 0, False: 1.27k]
  ------------------
  224|      0|        return 0;
  225|       |
  226|  1.27k|    return 1;
  227|  1.27k|}

OSSL_PARAM_BLD_new:
   92|    126|{
   93|    126|    OSSL_PARAM_BLD *r = OPENSSL_zalloc(sizeof(OSSL_PARAM_BLD));
  ------------------
  |  |  104|    126|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    126|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    126|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   94|       |
   95|    126|    if (r != NULL) {
  ------------------
  |  Branch (95:9): [True: 126, False: 0]
  ------------------
   96|    126|        r->params = sk_OSSL_PARAM_BLD_DEF_new_null();
   97|    126|        if (r->params == NULL) {
  ------------------
  |  Branch (97:13): [True: 0, False: 126]
  ------------------
   98|      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__
  |  |  ------------------
  ------------------
   99|      0|            r = NULL;
  100|      0|        }
  101|    126|    }
  102|    126|    return r;
  103|    126|}
OSSL_PARAM_BLD_free:
  114|    126|{
  115|    126|    if (bld == NULL)
  ------------------
  |  Branch (115:9): [True: 0, False: 126]
  ------------------
  116|      0|        return;
  117|    126|    free_all_params(bld);
  118|    126|    sk_OSSL_PARAM_BLD_DEF_free(bld->params);
  119|    126|    OPENSSL_free(bld);
  ------------------
  |  |  115|    126|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    126|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    126|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  120|    126|}
OSSL_PARAM_BLD_push_octet_string:
  284|    252|{
  285|    252|    OSSL_PARAM_BLD_DEF *pd;
  286|    252|    int secure;
  287|       |
  288|    252|    secure = CRYPTO_secure_allocated(buf);
  289|    252|    pd = param_push(bld, key, bsize, bsize, OSSL_PARAM_OCTET_STRING, secure);
  ------------------
  |  |  123|    252|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  290|    252|    if (pd == NULL)
  ------------------
  |  Branch (290:9): [True: 0, False: 252]
  ------------------
  291|      0|        return 0;
  292|    252|    pd->string = buf;
  293|    252|    return 1;
  294|    252|}
OSSL_PARAM_BLD_to_param:
  362|    126|{
  363|    126|    OSSL_PARAM_ALIGNED_BLOCK *blk, *s = NULL;
  364|    126|    OSSL_PARAM *params, *last;
  365|    126|    const int num = sk_OSSL_PARAM_BLD_DEF_num(bld->params);
  366|    126|    const size_t p_blks = ossl_param_bytes_to_blocks((1 + num) * sizeof(*params));
  367|    126|    const size_t total = OSSL_PARAM_ALIGN_SIZE * (p_blks + bld->total_blocks);
  ------------------
  |  |   22|    126|# define OSSL_PARAM_ALIGN_SIZE  sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
  368|    126|    const size_t ss = OSSL_PARAM_ALIGN_SIZE * bld->secure_blocks;
  ------------------
  |  |   22|    126|# define OSSL_PARAM_ALIGN_SIZE  sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
  369|       |
  370|    126|    if (ss > 0) {
  ------------------
  |  Branch (370:9): [True: 0, False: 126]
  ------------------
  371|      0|        s = OPENSSL_secure_malloc(ss);
  ------------------
  |  |  123|      0|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  372|      0|        if (s == NULL) {
  ------------------
  |  Branch (372:13): [True: 0, False: 0]
  ------------------
  373|      0|            ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_SECURE_MALLOC_FAILURE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|            return NULL;
  375|      0|        }
  376|      0|    }
  377|    126|    params = OPENSSL_malloc(total);
  ------------------
  |  |  102|    126|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    126|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    126|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  378|    126|    if (params == NULL) {
  ------------------
  |  Branch (378:9): [True: 0, False: 126]
  ------------------
  379|      0|        OPENSSL_secure_free(s);
  ------------------
  |  |  127|      0|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  380|      0|        return NULL;
  381|      0|    }
  382|    126|    blk = p_blks + (OSSL_PARAM_ALIGNED_BLOCK *)(params);
  383|    126|    last = param_bld_convert(bld, params, blk, s);
  384|    126|    ossl_param_set_secure_block(last, s, ss);
  385|       |
  386|       |    /* Reset builder for reuse */
  387|    126|    bld->total_blocks = 0;
  388|    126|    bld->secure_blocks = 0;
  389|    126|    free_all_params(bld);
  390|    126|    return params;
  391|    126|}
param_build.c:free_all_params:
  106|    252|{
  107|    252|    int i, n = sk_OSSL_PARAM_BLD_DEF_num(bld->params);
  108|       |
  109|    504|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (109:17): [True: 252, False: 252]
  ------------------
  110|    252|        OPENSSL_free(sk_OSSL_PARAM_BLD_DEF_pop(bld->params));
  ------------------
  |  |  115|    252|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    252|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    252|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|    252|}
param_build.c:param_push:
   54|    252|{
   55|    252|    OSSL_PARAM_BLD_DEF *pd = OPENSSL_zalloc(sizeof(*pd));
  ------------------
  |  |  104|    252|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    252|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    252|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|       |
   57|    252|    if (pd == NULL)
  ------------------
  |  Branch (57:9): [True: 0, False: 252]
  ------------------
   58|      0|        return NULL;
   59|    252|    pd->key = key;
   60|    252|    pd->type = type;
   61|    252|    pd->size = size;
   62|    252|    pd->alloc_blocks = ossl_param_bytes_to_blocks(alloc);
   63|    252|    if ((pd->secure = secure) != 0)
  ------------------
  |  Branch (63:9): [True: 0, False: 252]
  ------------------
   64|      0|        bld->secure_blocks += pd->alloc_blocks;
   65|    252|    else
   66|    252|        bld->total_blocks += pd->alloc_blocks;
   67|    252|    if (sk_OSSL_PARAM_BLD_DEF_push(bld->params, pd) <= 0) {
  ------------------
  |  Branch (67:9): [True: 0, False: 252]
  ------------------
   68|      0|        OPENSSL_free(pd);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   69|      0|        pd = NULL;
   70|      0|    }
   71|    252|    return pd;
   72|    252|}
param_build.c:param_bld_convert:
  311|    126|{
  312|    126|    int i, num = sk_OSSL_PARAM_BLD_DEF_num(bld->params);
  313|    126|    OSSL_PARAM_BLD_DEF *pd;
  314|    126|    void *p;
  315|       |
  316|    378|    for (i = 0; i < num; i++) {
  ------------------
  |  Branch (316:17): [True: 252, False: 126]
  ------------------
  317|    252|        pd = sk_OSSL_PARAM_BLD_DEF_value(bld->params, i);
  318|    252|        param[i].key = pd->key;
  319|    252|        param[i].data_type = pd->type;
  320|    252|        param[i].data_size = pd->size;
  321|    252|        param[i].return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|    252|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
  322|       |
  323|    252|        if (pd->secure) {
  ------------------
  |  Branch (323:13): [True: 0, False: 252]
  ------------------
  324|      0|            p = secure;
  325|      0|            secure += pd->alloc_blocks;
  326|    252|        } else {
  327|    252|            p = blk;
  328|    252|            blk += pd->alloc_blocks;
  329|    252|        }
  330|    252|        param[i].data = p;
  331|    252|        if (pd->bn != NULL) {
  ------------------
  |  Branch (331:13): [True: 0, False: 252]
  ------------------
  332|       |            /* BIGNUM */
  333|      0|            if (pd->type == OSSL_PARAM_UNSIGNED_INTEGER)
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (333:17): [True: 0, False: 0]
  ------------------
  334|      0|                BN_bn2nativepad(pd->bn, (unsigned char *)p, pd->size);
  335|      0|            else
  336|      0|                BN_signed_bn2native(pd->bn, (unsigned char *)p, pd->size);
  337|    252|        } else if (pd->type == OSSL_PARAM_OCTET_PTR
  ------------------
  |  |  160|    504|# define OSSL_PARAM_OCTET_PTR            7
  ------------------
  |  Branch (337:20): [True: 0, False: 252]
  ------------------
  338|    252|                   || pd->type == OSSL_PARAM_UTF8_PTR) {
  ------------------
  |  |  141|    252|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
  |  Branch (338:23): [True: 0, False: 252]
  ------------------
  339|       |            /* PTR */
  340|      0|            *(const void **)p = pd->string;
  341|    252|        } else if (pd->type == OSSL_PARAM_OCTET_STRING
  ------------------
  |  |  123|    504|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (341:20): [True: 252, False: 0]
  ------------------
  342|    252|                   || pd->type == OSSL_PARAM_UTF8_STRING) {
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (342:23): [True: 0, False: 0]
  ------------------
  343|    252|            if (pd->string != NULL)
  ------------------
  |  Branch (343:17): [True: 252, False: 0]
  ------------------
  344|    252|                memcpy(p, pd->string, pd->size);
  345|      0|            else
  346|      0|                memset(p, 0, pd->size);
  347|    252|            if (pd->type == OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|    252|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (347:17): [True: 0, False: 252]
  ------------------
  348|      0|                ((char *)p)[pd->size] = '\0';
  349|    252|        } else {
  350|       |            /* Number, but could also be a NULL BIGNUM */
  351|      0|            if (pd->size > sizeof(pd->num))
  ------------------
  |  Branch (351:17): [True: 0, False: 0]
  ------------------
  352|      0|                memset(p, 0, pd->size);
  353|      0|            else if (pd->size > 0)
  ------------------
  |  Branch (353:22): [True: 0, False: 0]
  ------------------
  354|      0|                memcpy(p, &pd->num, pd->size);
  355|      0|        }
  356|    252|    }
  357|    126|    param[i] = OSSL_PARAM_construct_end();
  358|    126|    return param + i;
  359|    126|}

ossl_param_build_set_octet_string:
   59|    252|{
   60|    252|    if (bld != NULL)
  ------------------
  |  Branch (60:9): [True: 252, False: 0]
  ------------------
   61|    252|        return OSSL_PARAM_BLD_push_octet_string(bld, key, data, data_len);
   62|       |
   63|      0|    p = OSSL_PARAM_locate(p, key);
   64|      0|    if (p != NULL)
  ------------------
  |  Branch (64:9): [True: 0, False: 0]
  ------------------
   65|      0|        return OSSL_PARAM_set_octet_string(p, data, data_len);
   66|      0|    return 1;
   67|      0|}

OSSL_PARAM_locate:
   54|   160M|{
   55|   160M|    if (p != NULL && key != NULL)
  ------------------
  |  Branch (55:9): [True: 160M, False: 978]
  |  Branch (55:22): [True: 160M, False: 0]
  ------------------
   56|   160M|        for (; p->key != NULL; p++)
  ------------------
  |  Branch (56:16): [True: 160M, False: 6.96k]
  ------------------
   57|   160M|            if (strcmp(key, p->key) == 0)
  ------------------
  |  Branch (57:17): [True: 160M, False: 23.7k]
  ------------------
   58|   160M|                return p;
   59|  7.94k|    return NULL;
   60|   160M|}
OSSL_PARAM_locate_const:
   63|   160M|{
   64|   160M|    return OSSL_PARAM_locate((OSSL_PARAM *)p, key);
   65|   160M|}
OSSL_PARAM_modified:
   81|      3|{
   82|      3|    return p != NULL && p->return_size != OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
  |  Branch (82:12): [True: 3, False: 0]
  |  Branch (82:25): [True: 3, False: 0]
  ------------------
   83|      3|}
OSSL_PARAM_get_int:
  267|    515|{
  268|    515|#ifndef OPENSSL_SMALL_FOOTPRINT
  269|    515|    switch (sizeof(int)) {
  ------------------
  |  Branch (269:13): [Folded - Ignored]
  ------------------
  270|    515|    case sizeof(int32_t):
  ------------------
  |  Branch (270:5): [True: 515, False: 0]
  ------------------
  271|    515|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
  272|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (272:5): [True: 0, False: 515]
  ------------------
  273|      0|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
  274|    515|    }
  275|      0|#endif
  276|      0|    return general_get_int(p, val, sizeof(*val));
  277|    515|}
OSSL_PARAM_set_int:
  280|  3.32k|{
  281|  3.32k|#ifndef OPENSSL_SMALL_FOOTPRINT
  282|  3.32k|    switch (sizeof(int)) {
  ------------------
  |  Branch (282:13): [Folded - Ignored]
  ------------------
  283|  3.32k|    case sizeof(int32_t):
  ------------------
  |  Branch (283:5): [True: 3.32k, False: 0]
  ------------------
  284|  3.32k|        return OSSL_PARAM_set_int32(p, (int32_t)val);
  285|      0|    case sizeof(int64_t):
  ------------------
  |  Branch (285:5): [True: 0, False: 3.32k]
  ------------------
  286|      0|        return OSSL_PARAM_set_int64(p, (int64_t)val);
  287|  3.32k|    }
  288|      0|#endif
  289|      0|    return general_set_int(p, &val, sizeof(val));
  290|  3.32k|}
OSSL_PARAM_construct_int:
  293|  3.60k|{
  294|  3.60k|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(int));
  ------------------
  |  |  106|  3.60k|# define OSSL_PARAM_INTEGER              1
  ------------------
  295|  3.60k|}
OSSL_PARAM_get_uint:
  298|      3|{
  299|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
  300|      3|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (300:13): [Folded - Ignored]
  ------------------
  301|      3|    case sizeof(uint32_t):
  ------------------
  |  Branch (301:5): [True: 3, False: 0]
  ------------------
  302|      3|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
  303|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (303:5): [True: 0, False: 3]
  ------------------
  304|      0|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
  305|      3|    }
  306|      0|#endif
  307|      0|    return general_get_uint(p, val, sizeof(*val));
  308|      3|}
OSSL_PARAM_set_uint:
  311|  1.45k|{
  312|  1.45k|#ifndef OPENSSL_SMALL_FOOTPRINT
  313|  1.45k|    switch (sizeof(unsigned int)) {
  ------------------
  |  Branch (313:13): [Folded - Ignored]
  ------------------
  314|  1.45k|    case sizeof(uint32_t):
  ------------------
  |  Branch (314:5): [True: 1.45k, False: 0]
  ------------------
  315|  1.45k|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
  316|      0|    case sizeof(uint64_t):
  ------------------
  |  Branch (316:5): [True: 0, False: 1.45k]
  ------------------
  317|      0|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
  318|  1.45k|    }
  319|      0|#endif
  320|      0|    return general_set_uint(p, &val, sizeof(val));
  321|  1.45k|}
OSSL_PARAM_construct_uint:
  324|  1.46k|{
  325|  1.46k|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|  1.46k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  326|  1.46k|                                sizeof(unsigned int));
  327|  1.46k|}
OSSL_PARAM_get_int32:
  393|    515|{
  394|    515|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (394:9): [True: 0, False: 515]
  |  Branch (394:24): [True: 0, False: 515]
  ------------------
  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|    515|    if (p->data == NULL) {
  ------------------
  |  Branch (399:9): [True: 0, False: 515]
  ------------------
  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|    515|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|    515|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (404:9): [True: 503, False: 12]
  ------------------
  405|    503|#ifndef OPENSSL_SMALL_FOOTPRINT
  406|    503|        int64_t i64;
  407|       |
  408|    503|        switch (p->data_size) {
  ------------------
  |  Branch (408:17): [True: 0, False: 503]
  ------------------
  409|    503|        case sizeof(int32_t):
  ------------------
  |  Branch (409:9): [True: 503, False: 0]
  ------------------
  410|    503|            *val = *(const int32_t *)p->data;
  411|    503|            return 1;
  412|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (412:9): [True: 0, False: 503]
  ------------------
  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|    503|        }
  421|      0|#endif
  422|      0|        return general_get_int(p, val, sizeof(*val));
  423|       |
  424|    503|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|     12|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (424:16): [True: 12, False: 0]
  ------------------
  425|     12|#ifndef OPENSSL_SMALL_FOOTPRINT
  426|     12|        uint32_t u32;
  427|     12|        uint64_t u64;
  428|       |
  429|     12|        switch (p->data_size) {
  ------------------
  |  Branch (429:17): [True: 0, False: 12]
  ------------------
  430|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (430:9): [True: 0, False: 12]
  ------------------
  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|     12|        case sizeof(uint64_t):
  ------------------
  |  Branch (438:9): [True: 12, False: 0]
  ------------------
  439|     12|            u64 = *(const uint64_t *)p->data;
  440|     12|            if (u64 <= INT32_MAX) {
  ------------------
  |  Branch (440:17): [True: 12, False: 0]
  ------------------
  441|     12|                *val = (int32_t)u64;
  442|     12|                return 1;
  443|     12|            }
  444|      0|            err_out_of_range;
  ------------------
  |  |   25|     12|    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|     12|        }
  447|      0|#endif
  448|      0|        return general_get_int(p, val, sizeof(*val));
  449|       |
  450|     12|    } 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|    515|    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|    515|}
OSSL_PARAM_set_int32:
  473|  3.32k|{
  474|  3.32k|    if (p == NULL) {
  ------------------
  |  Branch (474:9): [True: 0, False: 3.32k]
  ------------------
  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|  3.32k|    p->return_size = 0;
  479|  3.32k|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|  3.32k|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (479:9): [True: 3.31k, False: 8]
  ------------------
  480|  3.31k|#ifndef OPENSSL_SMALL_FOOTPRINT
  481|  3.31k|        p->return_size = sizeof(int32_t); /* Minimum expected size */
  482|  3.31k|        if (p->data == NULL)
  ------------------
  |  Branch (482:13): [True: 0, False: 3.31k]
  ------------------
  483|      0|            return 1;
  484|  3.31k|        switch (p->data_size) {
  ------------------
  |  Branch (484:17): [True: 0, False: 3.31k]
  ------------------
  485|  3.31k|        case sizeof(int32_t):
  ------------------
  |  Branch (485:9): [True: 3.31k, False: 0]
  ------------------
  486|  3.31k|            *(int32_t *)p->data = val;
  487|  3.31k|            return 1;
  488|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (488:9): [True: 0, False: 3.31k]
  ------------------
  489|      0|            p->return_size = sizeof(int64_t);
  490|      0|            *(int64_t *)p->data = (int64_t)val;
  491|      0|            return 1;
  492|  3.31k|        }
  493|      0|#endif
  494|      0|        return general_set_int(p, &val, sizeof(val));
  495|  3.31k|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER && val >= 0) {
  ------------------
  |  |  107|     16|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (495:16): [True: 8, False: 0]
  |  Branch (495:63): [True: 8, False: 0]
  ------------------
  496|      8|#ifndef OPENSSL_SMALL_FOOTPRINT
  497|      8|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  498|      8|        if (p->data == NULL)
  ------------------
  |  Branch (498:13): [True: 0, False: 8]
  ------------------
  499|      0|            return 1;
  500|      8|        switch (p->data_size) {
  ------------------
  |  Branch (500:17): [True: 0, False: 8]
  ------------------
  501|      8|        case sizeof(uint32_t):
  ------------------
  |  Branch (501:9): [True: 8, False: 0]
  ------------------
  502|      8|            *(uint32_t *)p->data = (uint32_t)val;
  503|      8|            return 1;
  504|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (504:9): [True: 0, False: 8]
  ------------------
  505|      0|            p->return_size = sizeof(uint64_t);
  506|      0|            *(uint64_t *)p->data = (uint64_t)val;
  507|      0|            return 1;
  508|      8|        }
  509|      0|#endif
  510|      0|        return general_set_int(p, &val, sizeof(val));
  511|      8|    } 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|  3.32k|    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|  3.32k|}
OSSL_PARAM_get_uint32:
  547|      3|{
  548|      3|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (548:9): [True: 0, False: 3]
  |  Branch (548:24): [True: 0, False: 3]
  ------------------
  549|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  550|      0|        return 0;
  551|      0|    }
  552|       |
  553|      3|    if (p->data == NULL) {
  ------------------
  |  Branch (553:9): [True: 0, False: 3]
  ------------------
  554|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  555|      0|        return 0;
  556|      0|    }
  557|       |
  558|      3|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      3|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (558:9): [True: 3, False: 0]
  ------------------
  559|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
  560|      3|        uint64_t u64;
  561|       |
  562|      3|        switch (p->data_size) {
  ------------------
  |  Branch (562:17): [True: 0, False: 3]
  ------------------
  563|      3|        case sizeof(uint32_t):
  ------------------
  |  Branch (563:9): [True: 3, False: 0]
  ------------------
  564|      3|            *val = *(const uint32_t *)p->data;
  565|      3|            return 1;
  566|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (566:9): [True: 0, False: 3]
  ------------------
  567|      0|            u64 = *(const uint64_t *)p->data;
  568|      0|            if (u64 <= UINT32_MAX) {
  ------------------
  |  Branch (568:17): [True: 0, False: 0]
  ------------------
  569|      0|                *val = (uint32_t)u64;
  570|      0|                return 1;
  571|      0|            }
  572|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  573|      0|            return 0;
  574|      3|        }
  575|      0|#endif
  576|      0|        return general_get_uint(p, val, sizeof(*val));
  577|      3|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (577:16): [True: 0, False: 0]
  ------------------
  578|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  579|      0|        int32_t i32;
  580|      0|        int64_t i64;
  581|       |
  582|      0|        switch (p->data_size) {
  ------------------
  |  Branch (582:17): [True: 0, False: 0]
  ------------------
  583|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (583:9): [True: 0, False: 0]
  ------------------
  584|      0|            i32 = *(const int32_t *)p->data;
  585|      0|            if (i32 >= 0) {
  ------------------
  |  Branch (585:17): [True: 0, False: 0]
  ------------------
  586|      0|                *val = i32;
  587|      0|                return 1;
  588|      0|            }
  589|      0|            err_unsigned_negative;
  ------------------
  |  |   22|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  590|      0|            return 0;
  591|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (591:9): [True: 0, False: 0]
  ------------------
  592|      0|            i64 = *(const int64_t *)p->data;
  593|      0|            if (i64 >= 0 && i64 <= UINT32_MAX) {
  ------------------
  |  Branch (593:17): [True: 0, False: 0]
  |  Branch (593:29): [True: 0, False: 0]
  ------------------
  594|      0|                *val = (uint32_t)i64;
  595|      0|                return 1;
  596|      0|            }
  597|      0|            if (i64 < 0)
  ------------------
  |  Branch (597:17): [True: 0, False: 0]
  ------------------
  598|      0|                err_unsigned_negative;
  ------------------
  |  |   22|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  599|      0|            else
  600|      0|                err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  601|      0|            return 0;
  602|      0|        }
  603|      0|#endif
  604|      0|        return general_get_uint(p, val, sizeof(*val));
  605|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (605:16): [True: 0, False: 0]
  ------------------
  606|      0|#ifndef OPENSSL_SYS_UEFI
  607|      0|        double d;
  608|       |
  609|      0|        switch (p->data_size) {
  ------------------
  |  Branch (609:17): [True: 0, False: 0]
  ------------------
  610|      0|        case sizeof(double):
  ------------------
  |  Branch (610:9): [True: 0, False: 0]
  ------------------
  611|      0|            d = *(const double *)p->data;
  612|      0|            if (d >= 0 && d <= UINT32_MAX && d == (uint32_t)d) {
  ------------------
  |  Branch (612:17): [True: 0, False: 0]
  |  Branch (612:27): [True: 0, False: 0]
  |  Branch (612:46): [True: 0, False: 0]
  ------------------
  613|      0|                *val = (uint32_t)d;
  614|      0|                return 1;
  615|      0|            }
  616|      0|            err_inexact;
  ------------------
  |  |   28|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
  617|      0|            return 0;
  618|      0|        }
  619|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  620|      0|        return 0;
  621|      0|#endif
  622|      0|    }
  623|      0|    err_bad_type;
  ------------------
  |  |   35|      3|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  624|      0|    return 0;
  625|      3|}
OSSL_PARAM_set_uint32:
  628|  1.45k|{
  629|  1.45k|    if (p == NULL) {
  ------------------
  |  Branch (629:9): [True: 0, False: 1.45k]
  ------------------
  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|  1.45k|    p->return_size = 0;
  634|       |
  635|  1.45k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  1.45k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (635:9): [True: 1.45k, False: 0]
  ------------------
  636|  1.45k|#ifndef OPENSSL_SMALL_FOOTPRINT
  637|  1.45k|        p->return_size = sizeof(uint32_t); /* Minimum expected size */
  638|  1.45k|        if (p->data == NULL)
  ------------------
  |  Branch (638:13): [True: 0, False: 1.45k]
  ------------------
  639|      0|            return 1;
  640|  1.45k|        switch (p->data_size) {
  ------------------
  |  Branch (640:17): [True: 0, False: 1.45k]
  ------------------
  641|  1.45k|        case sizeof(uint32_t):
  ------------------
  |  Branch (641:9): [True: 1.45k, False: 0]
  ------------------
  642|  1.45k|            *(uint32_t *)p->data = val;
  643|  1.45k|            return 1;
  644|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (644:9): [True: 0, False: 1.45k]
  ------------------
  645|      0|            p->return_size = sizeof(uint64_t);
  646|      0|            *(uint64_t *)p->data = val;
  647|      0|            return 1;
  648|  1.45k|        }
  649|      0|#endif
  650|      0|        return general_set_uint(p, &val, sizeof(val));
  651|  1.45k|    } 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|  1.45k|    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|  1.45k|}
OSSL_PARAM_get_int64:
  705|      3|{
  706|      3|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (706:9): [True: 0, False: 3]
  |  Branch (706:24): [True: 0, False: 3]
  ------------------
  707|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  708|      0|        return 0;
  709|      0|    }
  710|       |
  711|      3|    if (p->data == NULL) {
  ------------------
  |  Branch (711:9): [True: 0, False: 3]
  ------------------
  712|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  713|      0|        return 0;
  714|      0|    }
  715|       |
  716|      3|    if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      3|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (716:9): [True: 3, False: 0]
  ------------------
  717|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
  718|      3|        switch (p->data_size) {
  ------------------
  |  Branch (718:17): [True: 0, False: 3]
  ------------------
  719|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (719:9): [True: 0, False: 3]
  ------------------
  720|      0|            *val = *(const int32_t *)p->data;
  721|      0|            return 1;
  722|      3|        case sizeof(int64_t):
  ------------------
  |  Branch (722:9): [True: 3, False: 0]
  ------------------
  723|      3|            *val = *(const int64_t *)p->data;
  724|      3|            return 1;
  725|      3|        }
  726|      0|#endif
  727|      0|        return general_get_int(p, val, sizeof(*val));
  728|      3|    } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|      0|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (728:16): [True: 0, False: 0]
  ------------------
  729|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  730|      0|        uint64_t u64;
  731|       |
  732|      0|        switch (p->data_size) {
  ------------------
  |  Branch (732:17): [True: 0, False: 0]
  ------------------
  733|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (733:9): [True: 0, False: 0]
  ------------------
  734|      0|            *val = *(const uint32_t *)p->data;
  735|      0|            return 1;
  736|      0|        case sizeof(uint64_t):
  ------------------
  |  Branch (736:9): [True: 0, False: 0]
  ------------------
  737|      0|            u64 = *(const uint64_t *)p->data;
  738|      0|            if (u64 <= INT64_MAX) {
  ------------------
  |  Branch (738:17): [True: 0, False: 0]
  ------------------
  739|      0|                *val = (int64_t)u64;
  740|      0|                return 1;
  741|      0|            }
  742|      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)
  ------------------
  743|      0|            return 0;
  744|      0|        }
  745|      0|#endif
  746|      0|        return general_get_int(p, val, sizeof(*val));
  747|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (747:16): [True: 0, False: 0]
  ------------------
  748|      0|#ifndef OPENSSL_SYS_UEFI
  749|      0|        double d;
  750|       |
  751|      0|        switch (p->data_size) {
  ------------------
  |  Branch (751:17): [True: 0, False: 0]
  ------------------
  752|      0|        case sizeof(double):
  ------------------
  |  Branch (752:9): [True: 0, False: 0]
  ------------------
  753|      0|            d = *(const double *)p->data;
  754|      0|            if (d >= INT64_MIN
  ------------------
  |  Branch (754:17): [True: 0, False: 0]
  ------------------
  755|       |                    /*
  756|       |                     * By subtracting 65535 (2^16-1) we cancel the low order
  757|       |                     * 15 bits of INT64_MAX to avoid using imprecise floating
  758|       |                     * point values.
  759|       |                     */
  760|      0|                    && d < (double)(INT64_MAX - 65535) + 65536.0
  ------------------
  |  Branch (760:24): [True: 0, False: 0]
  ------------------
  761|      0|                    && d == (int64_t)d) {
  ------------------
  |  Branch (761:24): [True: 0, False: 0]
  ------------------
  762|      0|                *val = (int64_t)d;
  763|      0|                return 1;
  764|      0|            }
  765|      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)
  ------------------
  766|      0|            return 0;
  767|      0|        }
  768|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  769|      0|        return 0;
  770|      0|#endif
  771|      0|    }
  772|      0|    err_bad_type;
  ------------------
  |  |   35|      3|    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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  773|      0|    return 0;
  774|      3|}
OSSL_PARAM_get_uint64:
  860|   160M|{
  861|   160M|    if (val == NULL || p == NULL) {
  ------------------
  |  Branch (861:9): [True: 0, False: 160M]
  |  Branch (861:24): [True: 0, False: 160M]
  ------------------
  862|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  863|      0|        return 0;
  864|      0|    }
  865|       |
  866|   160M|    if (p->data == NULL) {
  ------------------
  |  Branch (866:9): [True: 0, False: 160M]
  ------------------
  867|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  868|      0|        return 0;
  869|      0|    }
  870|       |
  871|   160M|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|   160M|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (871:9): [True: 160M, False: 0]
  ------------------
  872|   160M|#ifndef OPENSSL_SMALL_FOOTPRINT
  873|   160M|        switch (p->data_size) {
  ------------------
  |  Branch (873:17): [True: 0, False: 160M]
  ------------------
  874|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (874:9): [True: 0, False: 160M]
  ------------------
  875|      0|            *val = *(const uint32_t *)p->data;
  876|      0|            return 1;
  877|   160M|        case sizeof(uint64_t):
  ------------------
  |  Branch (877:9): [True: 160M, False: 0]
  ------------------
  878|   160M|            *val = *(const uint64_t *)p->data;
  879|   160M|            return 1;
  880|   160M|        }
  881|      0|#endif
  882|      0|        return general_get_uint(p, val, sizeof(*val));
  883|   160M|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (883:16): [True: 0, False: 0]
  ------------------
  884|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  885|      0|        int32_t i32;
  886|      0|        int64_t i64;
  887|       |
  888|      0|        switch (p->data_size) {
  ------------------
  |  Branch (888:17): [True: 0, False: 0]
  ------------------
  889|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (889:9): [True: 0, False: 0]
  ------------------
  890|      0|            i32 = *(const int32_t *)p->data;
  891|      0|            if (i32 >= 0) {
  ------------------
  |  Branch (891:17): [True: 0, False: 0]
  ------------------
  892|      0|                *val = (uint64_t)i32;
  893|      0|                return 1;
  894|      0|            }
  895|      0|            err_unsigned_negative;
  ------------------
  |  |   22|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  896|      0|            return 0;
  897|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (897:9): [True: 0, False: 0]
  ------------------
  898|      0|            i64 = *(const int64_t *)p->data;
  899|      0|            if (i64 >= 0) {
  ------------------
  |  Branch (899:17): [True: 0, False: 0]
  ------------------
  900|      0|                *val = (uint64_t)i64;
  901|      0|                return 1;
  902|      0|            }
  903|      0|            err_unsigned_negative;
  ------------------
  |  |   22|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   23|      0|              CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED)
  ------------------
  904|      0|            return 0;
  905|      0|        }
  906|      0|#endif
  907|      0|        return general_get_uint(p, val, sizeof(*val));
  908|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (908:16): [True: 0, False: 0]
  ------------------
  909|      0|#ifndef OPENSSL_SYS_UEFI
  910|      0|        double d;
  911|       |
  912|      0|        switch (p->data_size) {
  ------------------
  |  Branch (912:17): [True: 0, False: 0]
  ------------------
  913|      0|        case sizeof(double):
  ------------------
  |  Branch (913:9): [True: 0, False: 0]
  ------------------
  914|      0|            d = *(const double *)p->data;
  915|      0|            if (d >= 0
  ------------------
  |  Branch (915:17): [True: 0, False: 0]
  ------------------
  916|       |                    /*
  917|       |                     * By subtracting 65535 (2^16-1) we cancel the low order
  918|       |                     * 15 bits of UINT64_MAX to avoid using imprecise floating
  919|       |                     * point values.
  920|       |                     */
  921|      0|                    && d < (double)(UINT64_MAX - 65535) + 65536.0
  ------------------
  |  Branch (921:24): [True: 0, False: 0]
  ------------------
  922|      0|                    && d == (uint64_t)d) {
  ------------------
  |  Branch (922:24): [True: 0, False: 0]
  ------------------
  923|      0|                *val = (uint64_t)d;
  924|      0|                return 1;
  925|      0|            }
  926|      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)
  ------------------
  927|      0|            return 0;
  928|      0|        }
  929|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  930|      0|        return 0;
  931|      0|#endif
  932|      0|    }
  933|      0|    err_bad_type;
  ------------------
  |  |   35|   160M|    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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  934|      0|    return 0;
  935|   160M|}
OSSL_PARAM_set_uint64:
  938|  1.97k|{
  939|  1.97k|    if (p == NULL) {
  ------------------
  |  Branch (939:9): [True: 0, False: 1.97k]
  ------------------
  940|      0|        err_null_argument;
  ------------------
  |  |   37|      0|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  941|      0|        return 0;
  942|      0|    }
  943|  1.97k|    p->return_size = 0;
  944|       |
  945|  1.97k|    if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER) {
  ------------------
  |  |  107|  1.97k|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
  |  Branch (945:9): [True: 1.97k, False: 0]
  ------------------
  946|  1.97k|#ifndef OPENSSL_SMALL_FOOTPRINT
  947|  1.97k|        if (p->data == NULL) {
  ------------------
  |  Branch (947:13): [True: 0, False: 1.97k]
  ------------------
  948|      0|            p->return_size = sizeof(uint64_t); /* Expected size */
  949|      0|            return 1;
  950|      0|        }
  951|  1.97k|        switch (p->data_size) {
  ------------------
  |  Branch (951:17): [True: 0, False: 1.97k]
  ------------------
  952|      0|        case sizeof(uint32_t):
  ------------------
  |  Branch (952:9): [True: 0, False: 1.97k]
  ------------------
  953|      0|            if (val <= UINT32_MAX) {
  ------------------
  |  Branch (953:17): [True: 0, False: 0]
  ------------------
  954|      0|                p->return_size = sizeof(uint32_t);
  955|      0|                *(uint32_t *)p->data = (uint32_t)val;
  956|      0|                return 1;
  957|      0|            }
  958|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  959|      0|            return 0;
  960|  1.97k|        case sizeof(uint64_t):
  ------------------
  |  Branch (960:9): [True: 1.97k, False: 0]
  ------------------
  961|  1.97k|            p->return_size = sizeof(uint64_t);
  962|  1.97k|            *(uint64_t *)p->data = val;
  963|  1.97k|            return 1;
  964|  1.97k|        }
  965|      0|#endif
  966|      0|        return general_set_uint(p, &val, sizeof(val));
  967|  1.97k|    } else if (p->data_type == OSSL_PARAM_INTEGER) {
  ------------------
  |  |  106|      0|# define OSSL_PARAM_INTEGER              1
  ------------------
  |  Branch (967:16): [True: 0, False: 0]
  ------------------
  968|      0|#ifndef OPENSSL_SMALL_FOOTPRINT
  969|      0|        if (p->data == NULL) {
  ------------------
  |  Branch (969:13): [True: 0, False: 0]
  ------------------
  970|      0|            p->return_size = sizeof(int64_t); /* Expected size */
  971|      0|            return 1;
  972|      0|        }
  973|      0|        switch (p->data_size) {
  ------------------
  |  Branch (973:17): [True: 0, False: 0]
  ------------------
  974|      0|        case sizeof(int32_t):
  ------------------
  |  Branch (974:9): [True: 0, False: 0]
  ------------------
  975|      0|            if (val <= INT32_MAX) {
  ------------------
  |  Branch (975:17): [True: 0, False: 0]
  ------------------
  976|      0|                p->return_size = sizeof(int32_t);
  977|      0|                *(int32_t *)p->data = (int32_t)val;
  978|      0|                return 1;
  979|      0|            }
  980|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  981|      0|            return 0;
  982|      0|        case sizeof(int64_t):
  ------------------
  |  Branch (982:9): [True: 0, False: 0]
  ------------------
  983|      0|            if (val <= INT64_MAX) {
  ------------------
  |  Branch (983:17): [True: 0, False: 0]
  ------------------
  984|      0|                p->return_size = sizeof(int64_t);
  985|      0|                *(int64_t *)p->data = (int64_t)val;
  986|      0|                return 1;
  987|      0|            }
  988|      0|            err_out_of_range;
  ------------------
  |  |   25|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   26|      0|              CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION)
  ------------------
  989|      0|            return 0;
  990|      0|        }
  991|      0|#endif
  992|      0|        return general_set_uint(p, &val, sizeof(val));
  993|      0|    } else if (p->data_type == OSSL_PARAM_REAL) {
  ------------------
  |  |  112|      0|# define OSSL_PARAM_REAL                 3
  ------------------
  |  Branch (993:16): [True: 0, False: 0]
  ------------------
  994|      0|#ifndef OPENSSL_SYS_UEFI
  995|      0|        switch (p->data_size) {
  ------------------
  |  Branch (995:17): [True: 0, False: 0]
  ------------------
  996|      0|        case sizeof(double):
  ------------------
  |  Branch (996:9): [True: 0, False: 0]
  ------------------
  997|      0|            if ((val >> real_shift()) == 0) {
  ------------------
  |  Branch (997:17): [True: 0, False: 0]
  ------------------
  998|      0|                p->return_size = sizeof(double);
  999|      0|                *(double *)p->data = (double)val;
 1000|      0|                return 1;
 1001|      0|            }
 1002|      0|            err_inexact;
  ------------------
  |  |   28|      0|    ERR_raise(ERR_LIB_CRYPTO, \
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   29|      0|              CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY)
  ------------------
 1003|      0|            return 0;
 1004|      0|        }
 1005|      0|        err_unsupported_real;
  ------------------
  |  |   39|      0|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1006|      0|        return 0;
 1007|      0|#endif
 1008|      0|    }
 1009|      0|    err_bad_type;
  ------------------
  |  |   35|  1.97k|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE)
  |  |  ------------------
  |  |  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      0|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1010|      0|    return 0;
 1011|  1.97k|}
OSSL_PARAM_get_size_t:
 1020|   160M|{
 1021|   160M|#ifndef OPENSSL_SMALL_FOOTPRINT
 1022|   160M|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1022:13): [Folded - Ignored]
  ------------------
 1023|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1023:5): [True: 0, False: 160M]
  ------------------
 1024|      0|        return OSSL_PARAM_get_uint32(p, (uint32_t *)val);
 1025|   160M|    case sizeof(uint64_t):
  ------------------
  |  Branch (1025:5): [True: 160M, False: 0]
  ------------------
 1026|   160M|        return OSSL_PARAM_get_uint64(p, (uint64_t *)val);
 1027|   160M|    }
 1028|      0|#endif
 1029|      0|    return general_get_uint(p, val, sizeof(*val));
 1030|   160M|}
OSSL_PARAM_set_size_t:
 1033|  1.97k|{
 1034|  1.97k|#ifndef OPENSSL_SMALL_FOOTPRINT
 1035|  1.97k|    switch (sizeof(size_t)) {
  ------------------
  |  Branch (1035:13): [Folded - Ignored]
  ------------------
 1036|      0|    case sizeof(uint32_t):
  ------------------
  |  Branch (1036:5): [True: 0, False: 1.97k]
  ------------------
 1037|      0|        return OSSL_PARAM_set_uint32(p, (uint32_t)val);
 1038|  1.97k|    case sizeof(uint64_t):
  ------------------
  |  Branch (1038:5): [True: 1.97k, False: 0]
  ------------------
 1039|  1.97k|        return OSSL_PARAM_set_uint64(p, (uint64_t)val);
 1040|  1.97k|    }
 1041|      0|#endif
 1042|      0|    return general_set_uint(p, &val, sizeof(val));
 1043|  1.97k|}
OSSL_PARAM_construct_size_t:
 1046|   160M|{
 1047|   160M|    return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER, buf,
  ------------------
  |  |  107|   160M|# define OSSL_PARAM_UNSIGNED_INTEGER     2
  ------------------
 1048|   160M|                                sizeof(size_t));
 1049|   160M|}
OSSL_PARAM_get_time_t:
 1052|      3|{
 1053|      3|#ifndef OPENSSL_SMALL_FOOTPRINT
 1054|      3|    switch (sizeof(time_t)) {
  ------------------
  |  Branch (1054:13): [Folded - Ignored]
  ------------------
 1055|      0|    case sizeof(int32_t):
  ------------------
  |  Branch (1055:5): [True: 0, False: 3]
  ------------------
 1056|      0|        return OSSL_PARAM_get_int32(p, (int32_t *)val);
 1057|      3|    case sizeof(int64_t):
  ------------------
  |  Branch (1057:5): [True: 3, False: 0]
  ------------------
 1058|      3|        return OSSL_PARAM_get_int64(p, (int64_t *)val);
 1059|      3|    }
 1060|      0|#endif
 1061|      0|    return general_get_int(p, val, sizeof(*val));
 1062|      3|}
OSSL_PARAM_construct_time_t:
 1078|      3|{
 1079|      3|    return ossl_param_construct(key, OSSL_PARAM_INTEGER, buf, sizeof(time_t));
  ------------------
  |  |  106|      3|# define OSSL_PARAM_INTEGER              1
  ------------------
 1080|      3|}
OSSL_PARAM_get_octet_string:
 1412|    332|{
 1413|    332|    return get_string_internal(p, val, &max_len, used_len,
 1414|    332|                               OSSL_PARAM_OCTET_STRING);
  ------------------
  |  |  123|    332|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
 1415|    332|}
OSSL_PARAM_construct_utf8_string:
 1462|    207|{
 1463|    207|    if (buf != NULL && bsize == 0)
  ------------------
  |  Branch (1463:9): [True: 207, False: 0]
  |  Branch (1463:24): [True: 207, False: 0]
  ------------------
 1464|    207|        bsize = strlen(buf);
 1465|    207|    return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize);
  ------------------
  |  |  117|    207|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
 1466|    207|}
OSSL_PARAM_construct_octet_string:
 1470|    146|{
 1471|    146|    return ossl_param_construct(key, OSSL_PARAM_OCTET_STRING, buf, bsize);
  ------------------
  |  |  123|    146|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
 1472|    146|}
OSSL_PARAM_construct_end:
 1661|   160M|{
 1662|   160M|    OSSL_PARAM end = OSSL_PARAM_END;
  ------------------
  |  |   25|   160M|    { NULL, 0, NULL, 0, 0 }
  ------------------
 1663|       |
 1664|   160M|    return end;
 1665|   160M|}
params.c:ossl_param_construct:
   69|   160M|{
   70|   160M|    OSSL_PARAM res;
   71|       |
   72|   160M|    res.key = key;
   73|   160M|    res.data_type = data_type;
   74|   160M|    res.data = data;
   75|   160M|    res.data_size = data_size;
   76|   160M|    res.return_size = OSSL_PARAM_UNMODIFIED;
  ------------------
  |  |   22|   160M|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  ------------------
   77|   160M|    return res;
   78|   160M|}
params.c:get_string_internal:
 1332|    332|{
 1333|    332|    size_t sz, alloc_sz;
 1334|       |
 1335|    332|    if ((val == NULL && used_len == NULL) || p == NULL) {
  ------------------
  |  Branch (1335:10): [True: 0, False: 332]
  |  Branch (1335:25): [True: 0, False: 0]
  |  Branch (1335:46): [True: 0, False: 332]
  ------------------
 1336|      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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1337|      0|        return 0;
 1338|      0|    }
 1339|    332|    if (p->data_type != type) {
  ------------------
  |  Branch (1339:9): [True: 0, False: 332]
  ------------------
 1340|      0|        err_bad_type;
  ------------------
  |  |   35|      0|    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)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1341|      0|        return 0;
 1342|      0|    }
 1343|       |
 1344|    332|    sz = p->data_size;
 1345|       |    /*
 1346|       |     * If the input size is 0, or the input string needs NUL byte
 1347|       |     * termination, allocate an extra byte.
 1348|       |     */
 1349|    332|    alloc_sz = sz + (type == OSSL_PARAM_UTF8_STRING || sz == 0);
  ------------------
  |  |  117|    664|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (1349:22): [True: 0, False: 332]
  |  Branch (1349:56): [True: 0, False: 332]
  ------------------
 1350|       |
 1351|    332|    if (used_len != NULL)
  ------------------
  |  Branch (1351:9): [True: 332, False: 0]
  ------------------
 1352|    332|        *used_len = sz;
 1353|       |
 1354|    332|    if (p->data == NULL) {
  ------------------
  |  Branch (1354:9): [True: 7, False: 325]
  ------------------
 1355|      7|        err_null_argument;
  ------------------
  |  |   37|      7|    ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER)
  |  |  ------------------
  |  |  |  |  401|      7|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      7|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|      7|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|      7|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|      7|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      7|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|      7|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1356|      7|        return 0;
 1357|      7|    }
 1358|       |
 1359|    325|    if (val == NULL)
  ------------------
  |  Branch (1359:9): [True: 0, False: 325]
  ------------------
 1360|      0|        return 1;
 1361|       |
 1362|    325|    if (*val == NULL) {
  ------------------
  |  Branch (1362:9): [True: 0, False: 325]
  ------------------
 1363|      0|        char *const q = OPENSSL_malloc(alloc_sz);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
 1364|       |
 1365|      0|        if (q == NULL)
  ------------------
  |  Branch (1365:13): [True: 0, False: 0]
  ------------------
 1366|      0|            return 0;
 1367|      0|        *val = q;
 1368|      0|        *max_len = alloc_sz;
 1369|      0|    }
 1370|       |
 1371|    325|    if (*max_len < sz) {
  ------------------
  |  Branch (1371:9): [True: 29, False: 296]
  ------------------
 1372|     29|        err_too_small;
  ------------------
  |  |   33|     29|    ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER)
  |  |  ------------------
  |  |  |  |  401|     29|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|     29|    (ERR_new(),                                                 \
  |  |  |  |  |  |  404|     29|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  302|     29|#   define OPENSSL_FILE __FILE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  303|     29|#   define OPENSSL_LINE __LINE__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|     29|#    define OPENSSL_FUNC __func__
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  405|     29|     ERR_set_error)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1373|     29|        return 0;
 1374|     29|    }
 1375|    296|    memcpy(*val, p->data, sz);
 1376|    296|    return 1;
 1377|    325|}

ossl_param_bytes_to_blocks:
   30|  1.00k|{
   31|  1.00k|    return (bytes + OSSL_PARAM_ALIGN_SIZE - 1) / OSSL_PARAM_ALIGN_SIZE;
  ------------------
  |  |   22|  1.00k|# define OSSL_PARAM_ALIGN_SIZE  sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
                  return (bytes + OSSL_PARAM_ALIGN_SIZE - 1) / OSSL_PARAM_ALIGN_SIZE;
  ------------------
  |  |   22|  1.00k|# define OSSL_PARAM_ALIGN_SIZE  sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
   32|  1.00k|}
ossl_param_set_secure_block:
   49|    252|{
   50|    252|    last->key = NULL;
   51|    252|    last->data_size = secure_buffer_sz;
   52|    252|    last->data = secure_buffer;
   53|    252|    last->data_type = OSSL_PARAM_ALLOCATED_END;
  ------------------
  |  |   15|    252|#define OSSL_PARAM_ALLOCATED_END    127
  ------------------
   54|    252|}
OSSL_PARAM_dup:
   99|    126|{
  100|    126|    size_t param_blocks;
  101|    126|    OSSL_PARAM_BUF buf[OSSL_PARAM_BUF_MAX];
  102|    126|    OSSL_PARAM *last, *dst;
  103|    126|    int param_count = 1; /* Include terminator in the count */
  104|       |
  105|    126|    if (src == NULL) {
  ------------------
  |  Branch (105:9): [True: 0, False: 126]
  ------------------
  106|      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)
  |  |  ------------------
  ------------------
  107|      0|        return NULL;
  108|      0|    }
  109|       |
  110|    126|    memset(buf, 0, sizeof(buf));
  111|       |
  112|       |    /* First Pass: get the param_count and block sizes required */
  113|    126|    (void)ossl_param_dup(src, NULL, buf, &param_count);
  114|       |
  115|    126|    param_blocks = ossl_param_bytes_to_blocks(param_count * sizeof(*src));
  116|       |    /*
  117|       |     * The allocated buffer consists of an array of OSSL_PARAM followed by
  118|       |     * aligned data bytes that the array elements will point to.
  119|       |     */
  120|    126|    if (!ossl_param_buf_alloc(&buf[OSSL_PARAM_BUF_PUBLIC], param_blocks, 0))
  ------------------
  |  |   18|    126|#define OSSL_PARAM_BUF_PUBLIC 0
  ------------------
  |  Branch (120:9): [True: 0, False: 126]
  ------------------
  121|      0|        return NULL;
  122|       |
  123|       |    /* Allocate a secure memory buffer if required */
  124|    126|    if (buf[OSSL_PARAM_BUF_SECURE].blocks > 0
  ------------------
  |  |   19|    126|#define OSSL_PARAM_BUF_SECURE 1
  ------------------
  |  Branch (124:9): [True: 0, False: 126]
  ------------------
  125|    126|        && !ossl_param_buf_alloc(&buf[OSSL_PARAM_BUF_SECURE], 0, 1)) {
  ------------------
  |  |   19|      0|#define OSSL_PARAM_BUF_SECURE 1
  ------------------
  |  Branch (125:12): [True: 0, False: 0]
  ------------------
  126|      0|        OPENSSL_free(buf[OSSL_PARAM_BUF_PUBLIC].alloc);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  127|      0|        return NULL;
  128|      0|    }
  129|       |
  130|    126|    dst = (OSSL_PARAM *)buf[OSSL_PARAM_BUF_PUBLIC].alloc;
  ------------------
  |  |   18|    126|#define OSSL_PARAM_BUF_PUBLIC 0
  ------------------
  131|    126|    last = ossl_param_dup(src, dst, buf, NULL);
  132|       |    /* Store the allocated secure memory buffer in the last param block */
  133|    126|    ossl_param_set_secure_block(last, buf[OSSL_PARAM_BUF_SECURE].alloc,
  ------------------
  |  |   19|    126|#define OSSL_PARAM_BUF_SECURE 1
  ------------------
  134|    126|                                buf[OSSL_PARAM_BUF_SECURE].alloc_sz);
  ------------------
  |  |   19|    126|#define OSSL_PARAM_BUF_SECURE 1
  ------------------
  135|    126|    return dst;
  136|    126|}
OSSL_PARAM_free:
  226|    252|{
  227|    252|    if (params != NULL) {
  ------------------
  |  Branch (227:9): [True: 252, False: 0]
  ------------------
  228|    252|        OSSL_PARAM *p;
  229|       |
  230|    756|        for (p = params; p->key != NULL; p++)
  ------------------
  |  Branch (230:26): [True: 504, False: 252]
  ------------------
  231|    504|            ;
  232|    252|        if (p->data_type == OSSL_PARAM_ALLOCATED_END)
  ------------------
  |  |   15|    252|#define OSSL_PARAM_ALLOCATED_END    127
  ------------------
  |  Branch (232:13): [True: 252, False: 0]
  ------------------
  233|    252|            OPENSSL_secure_clear_free(p->data, p->data_size);
  ------------------
  |  |  129|    252|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    252|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    252|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  234|    252|        OPENSSL_free(params);
  ------------------
  |  |  115|    252|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    252|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    252|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  235|    252|    }
  236|    252|}
params_dup.c:ossl_param_dup:
   59|    252|{
   60|    252|    const OSSL_PARAM *in;
   61|    252|    int has_dst = (dst != NULL);
   62|    252|    int is_secure;
   63|    252|    size_t param_sz, blks;
   64|       |
   65|    756|    for (in = src; in->key != NULL; in++) {
  ------------------
  |  Branch (65:20): [True: 504, False: 252]
  ------------------
   66|    504|        is_secure = CRYPTO_secure_allocated(in->data);
   67|    504|        if (has_dst) {
  ------------------
  |  Branch (67:13): [True: 252, False: 252]
  ------------------
   68|    252|            *dst = *in;
   69|    252|            dst->data = buf[is_secure].cur;
   70|    252|        }
   71|       |
   72|    504|        if (in->data_type == OSSL_PARAM_OCTET_PTR
  ------------------
  |  |  160|  1.00k|# define OSSL_PARAM_OCTET_PTR            7
  ------------------
  |  Branch (72:13): [True: 0, False: 504]
  ------------------
   73|    504|            || in->data_type == OSSL_PARAM_UTF8_PTR) {
  ------------------
  |  |  141|    504|# define OSSL_PARAM_UTF8_PTR             6
  ------------------
  |  Branch (73:16): [True: 0, False: 504]
  ------------------
   74|      0|            param_sz = sizeof(in->data);
   75|      0|            if (has_dst)
  ------------------
  |  Branch (75:17): [True: 0, False: 0]
  ------------------
   76|      0|                *((const void **)dst->data) = *(const void **)in->data;
   77|    504|        } else {
   78|    504|            param_sz = in->data_size;
   79|    504|            if (has_dst)
  ------------------
  |  Branch (79:17): [True: 252, False: 252]
  ------------------
   80|    252|                memcpy(dst->data, in->data, param_sz);
   81|    504|        }
   82|    504|        if (in->data_type == OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|    504|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (82:13): [True: 0, False: 504]
  ------------------
   83|      0|            param_sz++; /* NULL terminator */
   84|    504|        blks = ossl_param_bytes_to_blocks(param_sz);
   85|       |
   86|    504|        if (has_dst) {
  ------------------
  |  Branch (86:13): [True: 252, False: 252]
  ------------------
   87|    252|            dst++;
   88|    252|            buf[is_secure].cur += blks;
   89|    252|        } else {
   90|    252|            buf[is_secure].blocks += blks;
   91|    252|        }
   92|    504|        if (param_count != NULL)
  ------------------
  |  Branch (92:13): [True: 252, False: 252]
  ------------------
   93|    252|            ++*param_count;
   94|    504|    }
   95|    252|    return dst;
   96|    252|}
params_dup.c:ossl_param_buf_alloc:
   36|    126|{
   37|    126|    size_t sz = OSSL_PARAM_ALIGN_SIZE * (extra_blocks + out->blocks);
  ------------------
  |  |   22|    126|# define OSSL_PARAM_ALIGN_SIZE  sizeof(OSSL_PARAM_ALIGNED_BLOCK)
  ------------------
   38|       |
   39|    126|    out->alloc = is_secure ? OPENSSL_secure_zalloc(sz) : OPENSSL_zalloc(sz);
  ------------------
  |  |  125|      0|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
                  out->alloc = is_secure ? OPENSSL_secure_zalloc(sz) : OPENSSL_zalloc(sz);
  ------------------
  |  |  104|    252|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    126|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    126|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (39:18): [True: 0, False: 126]
  ------------------
   40|    126|    if (out->alloc == NULL)
  ------------------
  |  Branch (40:9): [True: 0, False: 126]
  ------------------
   41|      0|        return 0;
   42|    126|    out->alloc_sz = sz;
   43|    126|    out->cur = out->alloc + extra_blocks;
   44|    126|    return 1;
   45|    126|}

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

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

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

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

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

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

ossl_parse_property:
  346|      1|{
  347|      1|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  348|      1|    OSSL_PROPERTY_LIST *res = NULL;
  349|      1|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|      1|# define STACK_OF(type) struct stack_st_##type
  ------------------
  350|      1|    const char *s = defn;
  351|      1|    int done;
  352|       |
  353|      1|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (353:9): [True: 0, False: 1]
  |  Branch (353:22): [True: 0, False: 1]
  ------------------
  354|      0|        return NULL;
  355|       |
  356|      1|    s = skip_space(s);
  357|      1|    done = *s == '\0';
  358|      2|    while (!done) {
  ------------------
  |  Branch (358:12): [True: 1, False: 1]
  ------------------
  359|      1|        const char *start = s;
  360|       |
  361|      1|        prop = OPENSSL_malloc(sizeof(*prop));
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  362|      1|        if (prop == NULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 1]
  ------------------
  363|      0|            goto err;
  364|      1|        memset(&prop->v, 0, sizeof(prop->v));
  365|      1|        prop->optional = 0;
  366|      1|        if (!parse_name(ctx, &s, 1, &prop->name_idx))
  ------------------
  |  Branch (366:13): [True: 0, False: 1]
  ------------------
  367|      0|            goto err;
  368|      1|        prop->oper = OSSL_PROPERTY_OPER_EQ;
  369|      1|        if (prop->name_idx == 0) {
  ------------------
  |  Branch (369:13): [True: 0, False: 1]
  ------------------
  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|      1|        if (match_ch(&s, '=')) {
  ------------------
  |  Branch (374:13): [True: 1, False: 0]
  ------------------
  375|      1|            if (!parse_value(ctx, &s, prop, 1)) {
  ------------------
  |  Branch (375:17): [True: 0, False: 1]
  ------------------
  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|      1|        } 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|      1|        if (!sk_OSSL_PROPERTY_DEFINITION_push(sk, prop))
  ------------------
  |  Branch (386:13): [True: 0, False: 1]
  ------------------
  387|      0|            goto err;
  388|      1|        prop = NULL;
  389|      1|        done = !match_ch(&s, ',');
  390|      1|    }
  391|      1|    if (*s != '\0') {
  ------------------
  |  Branch (391:9): [True: 0, False: 1]
  ------------------
  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|      1|    res = stack_to_property_list(ctx, sk);
  397|       |
  398|      1|err:
  399|      1|    OPENSSL_free(prop);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  400|      1|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  401|      1|    return res;
  402|      1|}
ossl_parse_query:
  406|     32|{
  407|     32|    STACK_OF(OSSL_PROPERTY_DEFINITION) *sk;
  ------------------
  |  |   31|     32|# define STACK_OF(type) struct stack_st_##type
  ------------------
  408|     32|    OSSL_PROPERTY_LIST *res = NULL;
  409|     32|    OSSL_PROPERTY_DEFINITION *prop = NULL;
  410|     32|    int done;
  411|       |
  412|     32|    if (s == NULL || (sk = sk_OSSL_PROPERTY_DEFINITION_new(&pd_compare)) == NULL)
  ------------------
  |  Branch (412:9): [True: 0, False: 32]
  |  Branch (412:22): [True: 0, False: 32]
  ------------------
  413|      0|        return NULL;
  414|       |
  415|     32|    s = skip_space(s);
  416|     32|    done = *s == '\0';
  417|     32|    while (!done) {
  ------------------
  |  Branch (417:12): [True: 0, False: 32]
  ------------------
  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|     32|    if (*s != '\0') {
  ------------------
  |  Branch (454:9): [True: 0, False: 32]
  ------------------
  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|     32|    res = stack_to_property_list(ctx, sk);
  460|       |
  461|     32|err:
  462|     32|    OPENSSL_free(prop);
  ------------------
  |  |  115|     32|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     32|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     32|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|     32|    sk_OSSL_PROPERTY_DEFINITION_pop_free(sk, &pd_free);
  464|     32|    return res;
  465|     32|}
ossl_property_match_count:
  473|     32|{
  474|     32|    const OSSL_PROPERTY_DEFINITION *const q = query->properties;
  475|     32|    const OSSL_PROPERTY_DEFINITION *const d = defn->properties;
  476|     32|    int i = 0, j = 0, matches = 0;
  477|     32|    OSSL_PROPERTY_OPER oper;
  478|       |
  479|     32|    while (i < query->num_properties) {
  ------------------
  |  Branch (479:12): [True: 0, False: 32]
  ------------------
  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|     32|    return matches;
  527|     32|}
ossl_property_free:
  530|     34|{
  531|     34|    OPENSSL_free(p);
  ------------------
  |  |  115|     34|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     34|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     34|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  532|     34|}
ossl_property_parse_init:
  575|      1|{
  576|      1|    static const char *const predefined_names[] = {
  577|      1|        "provider",     /* Name of provider (default, legacy, fips) */
  578|      1|        "version",      /* Version number of this provider */
  579|      1|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  580|      1|        "output",       /* Output type for encoders */
  581|      1|        "input",        /* Input type for decoders */
  582|      1|        "structure",    /* Structure name for encoders and decoders */
  583|      1|    };
  584|      1|    size_t i;
  585|       |
  586|      7|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|      7|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (586:17): [True: 6, False: 1]
  ------------------
  587|      6|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (587:13): [True: 0, False: 6]
  ------------------
  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|      1|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      1|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (595:9): [True: 0, False: 1]
  ------------------
  596|      1|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      1|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (596:12): [True: 0, False: 1]
  ------------------
  597|      0|        goto err;
  598|       |
  599|      1|    return 1;
  600|      0|err:
  601|      0|    return 0;
  602|      1|}
property_parse.c:skip_space:
   26|     36|{
   27|     36|    while (ossl_isspace(*s))
  ------------------
  |  |   82|     36|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|     36|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  |  |  |  Branch (82:33): [True: 0, False: 36]
  |  |  ------------------
  ------------------
   28|      0|        s++;
   29|     36|    return s;
   30|     36|}
property_parse.c:parse_name:
   58|      1|{
   59|      1|    char name[100];
   60|      1|    int err = 0;
   61|      1|    size_t i = 0;
   62|      1|    const char *s = *t;
   63|      1|    int user_name = 0;
   64|       |
   65|      1|    for (;;) {
   66|      1|        if (!ossl_isalpha(*s)) {
  ------------------
  |  |   71|      1|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|      1|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      1|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      1|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (66:13): [True: 0, False: 1]
  ------------------
   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|      8|        do {
   72|      8|            if (i < sizeof(name) - 1)
  ------------------
  |  Branch (72:17): [True: 8, False: 0]
  ------------------
   73|      8|                name[i++] = ossl_tolower(*s);
   74|      0|            else
   75|      0|                err = 1;
   76|      8|        } while (*++s == '_' || ossl_isalnum(*s));
  ------------------
  |  |   70|      8|# define ossl_isalnum(c)        (ossl_ctype_check((c), CTYPE_MASK_alnum))
  |  |  ------------------
  |  |  |  |   41|      8|# define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|      8|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   27|      8|# define CTYPE_MASK_lower       0x1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   28|      8|# define CTYPE_MASK_upper       0x2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alnum   (CTYPE_MASK_alpha | CTYPE_MASK_digit)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|      8|# define CTYPE_MASK_digit       0x4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 7, False: 1]
  |  |  ------------------
  ------------------
  |  Branch (76:18): [True: 0, False: 8]
  ------------------
   77|      1|        if (*s != '.')
  ------------------
  |  Branch (77:13): [True: 1, False: 0]
  ------------------
   78|      1|            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|      1|    name[i] = '\0';
   87|      1|    if (err) {
  ------------------
  |  Branch (87:9): [True: 0, False: 1]
  ------------------
   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|      1|    *t = skip_space(s);
   92|      1|    *idx = ossl_property_name(ctx, name, user_name && create);
  ------------------
  |  Branch (92:42): [True: 0, False: 1]
  |  Branch (92:55): [True: 0, False: 0]
  ------------------
   93|      1|    return 1;
   94|      1|}
property_parse.c:match_ch:
   33|      2|{
   34|      2|    const char *s = *t;
   35|       |
   36|      2|    if (*s == m) {
  ------------------
  |  Branch (36:9): [True: 1, False: 1]
  ------------------
   37|      1|        *t = skip_space(s + 1);
   38|      1|        return 1;
   39|      1|    }
   40|      1|    return 0;
   41|      2|}
property_parse.c:parse_value:
  258|      1|{
  259|      1|    const char *s = *t;
  260|      1|    int r = 0;
  261|       |
  262|      1|    if (*s == '"' || *s == '\'') {
  ------------------
  |  Branch (262:9): [True: 0, False: 1]
  |  Branch (262:22): [True: 0, False: 1]
  ------------------
  263|      0|        s++;
  264|      0|        r = parse_string(ctx, &s, s[-1], res, create);
  265|      1|    } else if (*s == '+') {
  ------------------
  |  Branch (265:16): [True: 0, False: 1]
  ------------------
  266|      0|        s++;
  267|      0|        r = parse_number(&s, res);
  268|      1|    } else if (*s == '-') {
  ------------------
  |  Branch (268:16): [True: 0, False: 1]
  ------------------
  269|      0|        s++;
  270|      0|        r = parse_number(&s, res);
  271|      0|        res->v.int_val = -res->v.int_val;
  272|      1|    } else if (*s == '0' && s[1] == 'x') {
  ------------------
  |  Branch (272:16): [True: 0, False: 1]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|      0|        s += 2;
  274|      0|        r = parse_hex(&s, res);
  275|      1|    } else if (*s == '0' && ossl_isdigit(s[1])) {
  ------------------
  |  Branch (275:16): [True: 0, False: 1]
  |  Branch (275:29): [True: 0, False: 0]
  ------------------
  276|      0|        s++;
  277|      0|        r = parse_oct(&s, res);
  278|      1|    } else if (ossl_isdigit(*s)) {
  ------------------
  |  Branch (278:16): [True: 0, False: 1]
  ------------------
  279|      0|        return parse_number(t, res);
  280|      1|    } else if (ossl_isalpha(*s))
  ------------------
  |  |   71|      1|# define ossl_isalpha(c)        (ossl_ctype_check((c), CTYPE_MASK_alpha))
  |  |  ------------------
  |  |  |  |   40|      1|# define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      1|# define CTYPE_MASK_lower       0x1
  |  |  |  |  ------------------
  |  |  |  |               # define CTYPE_MASK_alpha   (CTYPE_MASK_lower | CTYPE_MASK_upper)
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      1|# define CTYPE_MASK_upper       0x2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:33): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  281|      1|        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|      1|}
property_parse.c:parse_unquoted:
  226|      1|{
  227|      1|    char v[1000];
  228|      1|    const char *s = *t;
  229|      1|    size_t i = 0;
  230|      1|    int err = 0;
  231|       |
  232|      1|    if (*s == '\0' || *s == ',')
  ------------------
  |  Branch (232:9): [True: 0, False: 1]
  |  Branch (232:23): [True: 0, False: 1]
  ------------------
  233|      0|        return 0;
  234|      8|    while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   80|     16|# define ossl_isprint(c)        (ossl_ctype_check((c), CTYPE_MASK_print))
  |  |  ------------------
  |  |  |  |   35|      8|# define CTYPE_MASK_print       0x100
  |  |  ------------------
  |  |  |  Branch (80:33): [True: 7, False: 1]
  |  |  ------------------
  ------------------
                  while (ossl_isprint(*s) && !ossl_isspace(*s) && *s != ',') {
  ------------------
  |  |   82|     15|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|      7|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (234:32): [True: 7, False: 0]
  |  Branch (234:53): [True: 7, False: 0]
  ------------------
  235|      7|        if (i < sizeof(v) - 1)
  ------------------
  |  Branch (235:13): [True: 7, False: 0]
  ------------------
  236|      7|            v[i++] = ossl_tolower(*s);
  237|      0|        else
  238|      0|            err = 1;
  239|      7|        s++;
  240|      7|    }
  241|      1|    if (!ossl_isspace(*s) && *s != '\0' && *s != ',') {
  ------------------
  |  |   82|      2|# define ossl_isspace(c)        (ossl_ctype_check((c), CTYPE_MASK_space))
  |  |  ------------------
  |  |  |  |   30|      1|# define CTYPE_MASK_space       0x8
  |  |  ------------------
  ------------------
  |  Branch (241:9): [True: 1, False: 0]
  |  Branch (241:30): [True: 0, False: 1]
  |  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|      1|    v[i] = 0;
  247|      1|    if (err)
  ------------------
  |  Branch (247:9): [True: 0, False: 1]
  ------------------
  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|      1|    else if ((res->v.str_val = ossl_property_value(ctx, v, create)) == 0)
  ------------------
  |  Branch (249:14): [True: 0, False: 1]
  ------------------
  250|      0|        err = 1;
  251|      1|    *t = skip_space(s);
  252|      1|    res->type = OSSL_PROPERTY_TYPE_STRING;
  253|      1|    return !err;
  254|      1|}
property_parse.c:stack_to_property_list:
  314|     33|{
  315|     33|    const int n = sk_OSSL_PROPERTY_DEFINITION_num(sk);
  316|     33|    OSSL_PROPERTY_LIST *r;
  317|     33|    OSSL_PROPERTY_IDX prev_name_idx = 0;
  318|     33|    int i;
  319|       |
  320|     33|    r = OPENSSL_malloc(sizeof(*r)
  ------------------
  |  |  102|     66|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     33|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     33|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (102:23): [True: 32, False: 1]
  |  |  ------------------
  ------------------
  321|     33|                       + (n <= 0 ? 0 : n - 1) * sizeof(r->properties[0]));
  322|     33|    if (r != NULL) {
  ------------------
  |  Branch (322:9): [True: 33, False: 0]
  ------------------
  323|     33|        sk_OSSL_PROPERTY_DEFINITION_sort(sk);
  324|       |
  325|     33|        r->has_optional = 0;
  326|     34|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (326:21): [True: 1, False: 33]
  ------------------
  327|      1|            r->properties[i] = *sk_OSSL_PROPERTY_DEFINITION_value(sk, i);
  328|      1|            r->has_optional |= r->properties[i].optional;
  329|       |
  330|       |            /* Check for duplicated names */
  331|      1|            if (i > 0 && r->properties[i].name_idx == prev_name_idx) {
  ------------------
  |  Branch (331:17): [True: 0, False: 1]
  |  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|      1|            prev_name_idx = r->properties[i].name_idx;
  339|      1|        }
  340|     33|        r->num_properties = n;
  341|     33|    }
  342|     33|    return r;
  343|     33|}
property_parse.c:pd_free:
  301|      1|{
  302|      1|    OPENSSL_free(pd);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  303|      1|}

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

ossl_property_string_data_free:
   77|      1|{
   78|      1|    PROPERTY_STRING_DATA *propdata = vpropdata;
   79|       |
   80|      1|    if (propdata == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 1]
  ------------------
   81|      0|        return;
   82|       |
   83|      1|    CRYPTO_THREAD_lock_free(propdata->lock);
   84|      1|    property_table_free(&propdata->prop_names);
   85|      1|    property_table_free(&propdata->prop_values);
   86|      1|#ifndef OPENSSL_SMALL_FOOTPRINT
   87|      1|    sk_OPENSSL_CSTRING_free(propdata->prop_namelist);
  ------------------
  |  |  261|      1|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   88|      1|    sk_OPENSSL_CSTRING_free(propdata->prop_valuelist);
  ------------------
  |  |  261|      1|#define sk_OPENSSL_CSTRING_free(sk) OPENSSL_sk_free(ossl_check_OPENSSL_CSTRING_sk_type(sk))
  ------------------
   89|      1|    propdata->prop_namelist = propdata->prop_valuelist = NULL;
   90|      1|#endif
   91|      1|    propdata->prop_name_idx = propdata->prop_value_idx = 0;
   92|       |
   93|      1|    OPENSSL_free(propdata);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   94|      1|}
ossl_property_string_data_new:
   96|      1|void *ossl_property_string_data_new(OSSL_LIB_CTX *ctx) {
   97|      1|    PROPERTY_STRING_DATA *propdata = OPENSSL_zalloc(sizeof(*propdata));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   98|       |
   99|      1|    if (propdata == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 1]
  ------------------
  100|      0|        return NULL;
  101|       |
  102|      1|    propdata->lock = CRYPTO_THREAD_lock_new();
  103|      1|    propdata->prop_names = lh_PROPERTY_STRING_new(&property_hash,
  104|      1|                                                  &property_cmp);
  105|      1|    propdata->prop_values = lh_PROPERTY_STRING_new(&property_hash,
  106|      1|                                                   &property_cmp);
  107|      1|#ifndef OPENSSL_SMALL_FOOTPRINT
  108|      1|    propdata->prop_namelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      1|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  109|      1|    propdata->prop_valuelist = sk_OPENSSL_CSTRING_new_null();
  ------------------
  |  |  258|      1|#define sk_OPENSSL_CSTRING_new_null() ((STACK_OF(OPENSSL_CSTRING) *)OPENSSL_sk_new_null())
  ------------------
  110|      1|#endif
  111|      1|    if (propdata->lock == NULL
  ------------------
  |  Branch (111:9): [True: 0, False: 1]
  ------------------
  112|      1|#ifndef OPENSSL_SMALL_FOOTPRINT
  113|      1|            || propdata->prop_namelist == NULL
  ------------------
  |  Branch (113:16): [True: 0, False: 1]
  ------------------
  114|      1|            || propdata->prop_valuelist == NULL
  ------------------
  |  Branch (114:16): [True: 0, False: 1]
  ------------------
  115|      1|#endif
  116|      1|            || propdata->prop_names == NULL
  ------------------
  |  Branch (116:16): [True: 0, False: 1]
  ------------------
  117|      1|            || propdata->prop_values == NULL) {
  ------------------
  |  Branch (117:16): [True: 0, False: 1]
  ------------------
  118|      0|        ossl_property_string_data_free(propdata);
  119|      0|        return NULL;
  120|      0|    }
  121|      1|    return propdata;
  122|      1|}
ossl_property_name:
  253|      7|{
  254|      7|    return ossl_property_string(ctx, 1, create, s);
  255|      7|}
ossl_property_value:
  264|      3|{
  265|      3|    return ossl_property_string(ctx, 0, create, s);
  266|      3|}
property_string.c:property_table_free:
   66|      2|{
   67|      2|    PROP_TABLE *t = *pt;
   68|       |
   69|      2|    if (t != NULL) {
  ------------------
  |  Branch (69:9): [True: 2, False: 0]
  ------------------
   70|      2|        lh_PROPERTY_STRING_doall(t, &property_free);
   71|      2|        lh_PROPERTY_STRING_free(t);
   72|      2|        *pt = NULL;
   73|      2|    }
   74|      2|}
property_string.c:property_free:
   61|      9|{
   62|      9|    OPENSSL_free(ps);
  ------------------
  |  |  115|      9|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   63|      9|}
property_string.c:property_hash:
   51|     28|{
   52|     28|    return OPENSSL_LH_strhash(a->s);
   53|     28|}
property_string.c:property_cmp:
   56|      1|{
   57|      1|    return strcmp(a->s, b->s);
   58|      1|}
property_string.c:ossl_property_string:
  144|     10|{
  145|     10|    PROPERTY_STRING p, *ps, *ps_new;
  146|     10|    PROP_TABLE *t;
  147|     10|    OSSL_PROPERTY_IDX *pidx;
  148|     10|    PROPERTY_STRING_DATA *propdata
  149|     10|        = ossl_lib_ctx_get_data(ctx, OSSL_LIB_CTX_PROPERTY_STRING_INDEX);
  ------------------
  |  |  101|     10|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  150|       |
  151|     10|    if (propdata == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 10]
  ------------------
  152|      0|        return 0;
  153|       |
  154|     10|    t = name ? propdata->prop_names : propdata->prop_values;
  ------------------
  |  Branch (154:9): [True: 7, False: 3]
  ------------------
  155|     10|    p.s = s;
  156|     10|    if (!CRYPTO_THREAD_read_lock(propdata->lock)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 10]
  ------------------
  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|     10|    ps = lh_PROPERTY_STRING_retrieve(t, &p);
  161|     10|    if (ps == NULL && create) {
  ------------------
  |  Branch (161:9): [True: 9, False: 1]
  |  Branch (161:23): [True: 9, False: 0]
  ------------------
  162|      9|        CRYPTO_THREAD_unlock(propdata->lock);
  163|      9|        if (!CRYPTO_THREAD_write_lock(propdata->lock)) {
  ------------------
  |  Branch (163:13): [True: 0, False: 9]
  ------------------
  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|      9|        pidx = name ? &propdata->prop_name_idx : &propdata->prop_value_idx;
  ------------------
  |  Branch (167:16): [True: 6, False: 3]
  ------------------
  168|      9|        ps = lh_PROPERTY_STRING_retrieve(t, &p);
  169|      9|        if (ps == NULL && (ps_new = new_property_string(s, pidx)) != NULL) {
  ------------------
  |  Branch (169:13): [True: 9, False: 0]
  |  Branch (169:27): [True: 9, False: 0]
  ------------------
  170|      9|#ifndef OPENSSL_SMALL_FOOTPRINT
  171|      9|            STACK_OF(OPENSSL_CSTRING) *slist;
  ------------------
  |  |   31|      9|# define STACK_OF(type) struct stack_st_##type
  ------------------
  172|       |
  173|      9|            slist = name ? propdata->prop_namelist : propdata->prop_valuelist;
  ------------------
  |  Branch (173:21): [True: 6, False: 3]
  ------------------
  174|      9|            if (sk_OPENSSL_CSTRING_push(slist, ps_new->s) <= 0) {
  ------------------
  |  |  265|      9|#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: 9]
  ------------------
  175|      0|                property_free(ps_new);
  176|      0|                CRYPTO_THREAD_unlock(propdata->lock);
  177|      0|                return 0;
  178|      0|            }
  179|      9|#endif
  180|      9|            lh_PROPERTY_STRING_insert(t, ps_new);
  181|      9|            if (lh_PROPERTY_STRING_error(t)) {
  ------------------
  |  Branch (181:17): [True: 0, False: 9]
  ------------------
  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|      9|            ps = ps_new;
  195|      9|        }
  196|      9|    }
  197|     10|    CRYPTO_THREAD_unlock(propdata->lock);
  198|     10|    return ps != NULL ? ps->idx : 0;
  ------------------
  |  Branch (198:12): [True: 10, False: 0]
  ------------------
  199|     10|}
property_string.c:new_property_string:
  126|      9|{
  127|      9|    const size_t l = strlen(s);
  128|      9|    PROPERTY_STRING *ps = OPENSSL_malloc(sizeof(*ps) + l);
  ------------------
  |  |  102|      9|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      9|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      9|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  129|       |
  130|      9|    if (ps != NULL) {
  ------------------
  |  Branch (130:9): [True: 9, False: 0]
  ------------------
  131|      9|        memcpy(ps->body, s, l + 1);
  132|      9|        ps->s = ps->body;
  133|      9|        ps->idx = ++*pidx;
  134|      9|        if (ps->idx == 0) {
  ------------------
  |  Branch (134:13): [True: 0, False: 9]
  ------------------
  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|      9|    }
  139|      9|    return ps;
  140|      9|}

ossl_child_prov_ctx_new:
   38|      1|{
   39|      1|    return OPENSSL_zalloc(sizeof(struct child_prov_globals));
  ------------------
  |  |  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|      1|}
ossl_child_prov_ctx_free:
   43|      1|{
   44|      1|    struct child_prov_globals *gbl = vgbl;
   45|       |
   46|      1|    CRYPTO_THREAD_lock_free(gbl->lock);
   47|      1|    OPENSSL_free(gbl);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   48|      1|}

ossl_prov_conf_ctx_new:
   31|      1|{
   32|      1|    PROVIDER_CONF_GLOBAL *pcgbl = OPENSSL_zalloc(sizeof(*pcgbl));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   33|       |
   34|      1|    if (pcgbl == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 1]
  ------------------
   35|      0|        return NULL;
   36|       |
   37|      1|    pcgbl->lock = CRYPTO_THREAD_lock_new();
   38|      1|    if (pcgbl->lock == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 1]
  ------------------
   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|      1|    return pcgbl;
   44|      1|}
ossl_prov_conf_ctx_free:
   47|      1|{
   48|      1|    PROVIDER_CONF_GLOBAL *pcgbl = vpcgbl;
   49|       |
   50|      1|    sk_OSSL_PROVIDER_pop_free(pcgbl->activated_providers,
   51|      1|                              ossl_provider_free);
   52|       |
   53|      1|    OSSL_TRACE(CONF, "Cleaned up providers\n");
  ------------------
  |  |  288|      1|    OSSL_TRACEV(category, (trc_out, "%s", text))
  |  |  ------------------
  |  |  |  |  283|      1|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  ------------------
  ------------------
   54|      1|    CRYPTO_THREAD_lock_free(pcgbl->lock);
   55|      1|    OPENSSL_free(pcgbl);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   56|      1|}

ossl_provider_store_free:
  288|      1|{
  289|      1|    struct provider_store_st *store = vstore;
  290|      1|    size_t i;
  291|       |
  292|      1|    if (store == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 1]
  ------------------
  293|      0|        return;
  294|      1|    store->freeing = 1;
  295|      1|    OPENSSL_free(store->default_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__
  |  |  ------------------
  ------------------
  296|      1|    sk_OSSL_PROVIDER_pop_free(store->providers, provider_deactivate_free);
  297|      1|#ifndef FIPS_MODULE
  298|      1|    sk_OSSL_PROVIDER_CHILD_CB_pop_free(store->child_cbs,
  299|      1|                                       ossl_provider_child_cb_free);
  300|      1|#endif
  301|      1|    CRYPTO_THREAD_lock_free(store->default_path_lock);
  302|      1|    CRYPTO_THREAD_lock_free(store->lock);
  303|      1|    for (i = 0; i < store->numprovinfo; i++)
  ------------------
  |  Branch (303:17): [True: 0, False: 1]
  ------------------
  304|      0|        ossl_provider_info_clear(&store->provinfo[i]);
  305|      1|    OPENSSL_free(store->provinfo);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  306|      1|    OPENSSL_free(store);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  307|      1|}
ossl_provider_store_new:
  310|      1|{
  311|      1|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  312|       |
  313|      1|    if (store == NULL
  ------------------
  |  Branch (313:9): [True: 0, False: 1]
  ------------------
  314|      1|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (314:12): [True: 0, False: 1]
  ------------------
  315|      1|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (315:12): [True: 0, False: 1]
  ------------------
  316|      1|#ifndef FIPS_MODULE
  317|      1|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (317:12): [True: 0, False: 1]
  ------------------
  318|      1|#endif
  319|      1|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (319:12): [True: 0, False: 1]
  ------------------
  320|      0|        ossl_provider_store_free(store);
  321|      0|        return NULL;
  322|      0|    }
  323|      1|    store->libctx = ctx;
  324|      1|    store->use_fallbacks = 1;
  325|       |
  326|      1|    return store;
  327|      1|}
ossl_provider_find:
  401|      3|{
  402|      3|    struct provider_store_st *store = NULL;
  403|      3|    OSSL_PROVIDER *prov = NULL;
  404|       |
  405|      3|    if ((store = get_provider_store(libctx)) != NULL) {
  ------------------
  |  Branch (405:9): [True: 3, False: 0]
  ------------------
  406|      3|        OSSL_PROVIDER tmpl = { 0, };
  407|      3|        int i;
  408|       |
  409|      3|#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|      3|        if (!noconfig) {
  ------------------
  |  Branch (414:13): [True: 0, False: 3]
  ------------------
  415|      0|            if (ossl_lib_ctx_is_default(libctx))
  ------------------
  |  Branch (415:17): [True: 0, False: 0]
  ------------------
  416|      0|                OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|      0|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
  417|      0|        }
  418|      3|#endif
  419|       |
  420|      3|        tmpl.name = (char *)name;
  421|      3|        if (!CRYPTO_THREAD_write_lock(store->lock))
  ------------------
  |  Branch (421:13): [True: 0, False: 3]
  ------------------
  422|      0|            return NULL;
  423|      3|        sk_OSSL_PROVIDER_sort(store->providers);
  424|      3|        if ((i = sk_OSSL_PROVIDER_find(store->providers, &tmpl)) != -1)
  ------------------
  |  Branch (424:13): [True: 3, False: 0]
  ------------------
  425|      3|            prov = sk_OSSL_PROVIDER_value(store->providers, i);
  426|      3|        CRYPTO_THREAD_unlock(store->lock);
  427|      3|        if (prov != NULL && !ossl_provider_up_ref(prov))
  ------------------
  |  Branch (427:13): [True: 3, False: 0]
  |  Branch (427:29): [True: 0, False: 3]
  ------------------
  428|      0|            prov = NULL;
  429|      3|    }
  430|       |
  431|      3|    return prov;
  432|      3|}
ossl_provider_up_ref:
  477|    273|{
  478|    273|    int ref = 0;
  479|       |
  480|    273|    if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0)
  ------------------
  |  Branch (480:9): [True: 0, False: 273]
  ------------------
  481|      0|        return 0;
  482|       |
  483|    273|#ifndef FIPS_MODULE
  484|    273|    if (prov->ischild) {
  ------------------
  |  Branch (484:9): [True: 0, False: 273]
  ------------------
  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|    273|#endif
  491|       |
  492|    273|    return ref;
  493|    273|}
ossl_provider_free:
  725|    274|{
  726|    274|    if (prov != NULL) {
  ------------------
  |  Branch (726:9): [True: 274, False: 0]
  ------------------
  727|    274|        int ref = 0;
  728|       |
  729|    274|        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|    274|        if (ref == 0) {
  ------------------
  |  Branch (739:13): [True: 1, False: 273]
  ------------------
  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|    273|#ifndef FIPS_MODULE
  776|    273|        else if (prov->ischild) {
  ------------------
  |  Branch (776:18): [True: 0, False: 273]
  ------------------
  777|      0|            ossl_provider_free_parent(prov, 0);
  778|      0|        }
  779|    274|#endif
  780|    274|    }
  781|    274|}
ossl_provider_deactivate:
 1417|      1|{
 1418|      1|    int count;
 1419|       |
 1420|      1|    if (prov == NULL
  ------------------
  |  Branch (1420:9): [True: 0, False: 1]
  ------------------
 1421|      1|            || (count = provider_deactivate(prov, 1, removechildren)) < 0)
  ------------------
  |  Branch (1421:16): [True: 0, False: 1]
  ------------------
 1422|      0|        return 0;
 1423|      1|    return count == 0 ? provider_remove_store_methods(prov) : 1;
  ------------------
  |  Branch (1423:12): [True: 1, False: 0]
  ------------------
 1424|      1|}
ossl_provider_ctx:
 1427|  4.54k|{
 1428|  4.54k|    return prov != NULL ? prov->provctx : NULL;
  ------------------
  |  Branch (1428:12): [True: 4.54k, False: 0]
  ------------------
 1429|  4.54k|}
ossl_provider_doall_activated:
 1528|     30|{
 1529|     30|    int ret = 0, curr, max, ref = 0;
 1530|     30|    struct provider_store_st *store = get_provider_store(ctx);
 1531|     30|    STACK_OF(OSSL_PROVIDER) *provs = NULL;
  ------------------
  |  |   31|     30|# define STACK_OF(type) struct stack_st_##type
  ------------------
 1532|       |
 1533|     30|#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|     30|    if (ossl_lib_ctx_is_default(ctx))
  ------------------
  |  Branch (1538:9): [True: 30, False: 0]
  ------------------
 1539|     30|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
  ------------------
  |  |  472|     30|# define OPENSSL_INIT_LOAD_CONFIG            0x00000040L
  ------------------
 1540|     30|#endif
 1541|       |
 1542|     30|    if (store == NULL)
  ------------------
  |  Branch (1542:9): [True: 0, False: 30]
  ------------------
 1543|      0|        return 1;
 1544|     30|    if (!provider_activate_fallbacks(store))
  ------------------
  |  Branch (1544:9): [True: 0, False: 30]
  ------------------
 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|     30|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1551:9): [True: 0, False: 30]
  ------------------
 1552|      0|        return 0;
 1553|     30|    provs = sk_OSSL_PROVIDER_dup(store->providers);
 1554|     30|    if (provs == NULL) {
  ------------------
  |  Branch (1554:9): [True: 0, False: 30]
  ------------------
 1555|      0|        CRYPTO_THREAD_unlock(store->lock);
 1556|      0|        return 0;
 1557|      0|    }
 1558|     30|    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|     60|    for (curr = max - 1; curr >= 0; curr--) {
  ------------------
  |  Branch (1563:26): [True: 30, False: 30]
  ------------------
 1564|     30|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1565|       |
 1566|     30|        if (!CRYPTO_THREAD_read_lock(prov->flag_lock))
  ------------------
  |  Branch (1566:13): [True: 0, False: 30]
  ------------------
 1567|      0|            goto err_unlock;
 1568|     30|        if (prov->flag_activated) {
  ------------------
  |  Branch (1568:13): [True: 30, 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|     30|            if (CRYPTO_UP_REF(&prov->refcnt, &ref) <= 0) {
  ------------------
  |  Branch (1574:17): [True: 0, False: 30]
  ------------------
 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|     30|            if (!CRYPTO_atomic_add(&prov->activatecnt, 1, &ref,
  ------------------
  |  Branch (1584:17): [True: 0, False: 30]
  ------------------
 1585|     30|                                   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|     30|        } else {
 1591|      0|            sk_OSSL_PROVIDER_delete(provs, curr);
 1592|      0|            max--;
 1593|      0|        }
 1594|     30|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1595|     30|    }
 1596|     30|    CRYPTO_THREAD_unlock(store->lock);
 1597|       |
 1598|       |    /*
 1599|       |     * Now, we sweep through all providers not under lock
 1600|       |     */
 1601|     60|    for (curr = 0; curr < max; curr++) {
  ------------------
  |  Branch (1601:20): [True: 30, False: 30]
  ------------------
 1602|     30|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1603|       |
 1604|     30|        if (!cb(prov, cbdata)) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 30]
  ------------------
 1605|      0|            curr = -1;
 1606|      0|            goto finish;
 1607|      0|        }
 1608|     30|    }
 1609|     30|    curr = -1;
 1610|       |
 1611|     30|    ret = 1;
 1612|     30|    goto finish;
 1613|       |
 1614|      0| err_unlock:
 1615|      0|    CRYPTO_THREAD_unlock(store->lock);
 1616|     30| 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|     60|    for (curr++; curr < max; curr++) {
  ------------------
  |  Branch (1622:18): [True: 30, False: 30]
  ------------------
 1623|     30|        OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
 1624|       |
 1625|     30|        if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &ref,
  ------------------
  |  Branch (1625:13): [True: 0, False: 30]
  ------------------
 1626|     30|                               prov->activatecnt_lock)) {
 1627|      0|            ret = 0;
 1628|      0|            continue;
 1629|      0|        }
 1630|     30|        if (ref < 1) {
  ------------------
  |  Branch (1630:13): [True: 0, False: 30]
  ------------------
 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|     30|        if (!CRYPTO_DOWN_REF(&prov->refcnt, &ref)) {
  ------------------
  |  Branch (1647:13): [True: 0, False: 30]
  ------------------
 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|     30|        assert(ref > 0);
 1656|     30|    }
 1657|     30|    sk_OSSL_PROVIDER_free(provs);
 1658|     30|    return ret;
 1659|     30|}
ossl_provider_name:
 1683|      3|{
 1684|      3|    return prov->name;
 1685|      3|}
ossl_provider_libctx:
 1720|  2.39k|{
 1721|  2.39k|    return prov != NULL ? prov->libctx : NULL;
  ------------------
  |  Branch (1721:12): [True: 2.39k, False: 0]
  ------------------
 1722|  2.39k|}
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|     32|{
 1937|     32|    const OSSL_ALGORITHM *res;
 1938|       |
 1939|     32|    if (prov->query_operation == NULL) {
  ------------------
  |  Branch (1939:9): [True: 0, False: 32]
  ------------------
 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|     32|    res = prov->query_operation(prov->provctx, operation_id, no_cache);
 1950|     32|#ifndef FIPS_MODULE
 1951|     32|    OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|     32|    do {                                        \
  |  |  221|     32|        BIO *trc_out = NULL;                    \
  |  |  222|     32|        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|     32|    } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|     32|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1972|     32|#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|     32|    return res;
 1980|     32|}
ossl_provider_unquery_operation:
 1999|     32|{
 2000|     32|    if (prov->unquery_operation != NULL) {
  ------------------
  |  Branch (2000:9): [True: 0, False: 32]
  ------------------
 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|     32|}
ossl_provider_set_operation_bit:
 2015|      6|{
 2016|      6|    size_t byte = bitnum / 8;
 2017|      6|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2018|       |
 2019|      6|    if (!CRYPTO_THREAD_write_lock(provider->opbits_lock))
  ------------------
  |  Branch (2019:9): [True: 0, False: 6]
  ------------------
 2020|      0|        return 0;
 2021|      6|    if (provider->operation_bits_sz <= byte) {
  ------------------
  |  Branch (2021:9): [True: 1, False: 5]
  ------------------
 2022|      1|        unsigned char *tmp = OPENSSL_realloc(provider->operation_bits,
  ------------------
  |  |  109|      1|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 2023|      1|                                             byte + 1);
 2024|       |
 2025|      1|        if (tmp == NULL) {
  ------------------
  |  Branch (2025:13): [True: 0, False: 1]
  ------------------
 2026|      0|            CRYPTO_THREAD_unlock(provider->opbits_lock);
 2027|      0|            return 0;
 2028|      0|        }
 2029|      1|        provider->operation_bits = tmp;
 2030|      1|        memset(provider->operation_bits + provider->operation_bits_sz,
 2031|      1|               '\0', byte + 1 - provider->operation_bits_sz);
 2032|      1|        provider->operation_bits_sz = byte + 1;
 2033|      1|    }
 2034|      6|    provider->operation_bits[byte] |= bit;
 2035|      6|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2036|      6|    return 1;
 2037|      6|}
ossl_provider_test_operation_bit:
 2041|     32|{
 2042|     32|    size_t byte = bitnum / 8;
 2043|     32|    unsigned char bit = (1 << (bitnum % 8)) & 0xFF;
 2044|       |
 2045|     32|    if (!ossl_assert(result != NULL)) {
  ------------------
  |  |   52|     32|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     32|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (2045:9): [True: 0, False: 32]
  ------------------
 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|     32|    *result = 0;
 2051|     32|    if (!CRYPTO_THREAD_read_lock(provider->opbits_lock))
  ------------------
  |  Branch (2051:9): [True: 0, False: 32]
  ------------------
 2052|      0|        return 0;
 2053|     32|    if (provider->operation_bits_sz > byte)
  ------------------
  |  Branch (2053:9): [True: 31, False: 1]
  ------------------
 2054|     31|        *result = ((provider->operation_bits[byte] & bit) != 0);
 2055|     32|    CRYPTO_THREAD_unlock(provider->opbits_lock);
 2056|     32|    return 1;
 2057|     32|}
provider_core.c:provider_deactivate_free:
  237|      1|{
  238|      1|    if (prov->flag_activated)
  ------------------
  |  Branch (238:9): [True: 1, False: 0]
  ------------------
  239|      1|        ossl_provider_deactivate(prov, 1);
  240|      1|    ossl_provider_free(prov);
  241|      1|}
provider_core.c:ossl_provider_cmp:
  204|      3|{
  205|      3|    return strcmp((*a)->name, (*b)->name);
  206|      3|}
provider_core.c:get_provider_store:
  330|     35|{
  331|     35|    struct provider_store_st *store = NULL;
  332|       |
  333|     35|    store = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_PROVIDER_STORE_INDEX);
  ------------------
  |  |   99|     35|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  334|     35|    if (store == NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 35]
  ------------------
  335|     35|        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|     35|    return store;
  337|     35|}
provider_core.c:provider_new:
  442|      1|{
  443|      1|    OSSL_PROVIDER *prov = NULL;
  444|       |
  445|      1|    if ((prov = OPENSSL_zalloc(sizeof(*prov))) == NULL)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (445:9): [True: 0, False: 1]
  ------------------
  446|      0|        return NULL;
  447|      1|    if (!CRYPTO_NEW_REF(&prov->refcnt, 1)) {
  ------------------
  |  Branch (447:9): [True: 0, False: 1]
  ------------------
  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|      1|    if ((prov->activatecnt_lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (451:9): [True: 0, False: 1]
  ------------------
  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|      1|    if ((prov->opbits_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (457:9): [True: 0, False: 1]
  ------------------
  458|      1|        || (prov->flag_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (458:12): [True: 0, False: 1]
  ------------------
  459|      1|        || (prov->parameters = sk_INFOPAIR_deep_copy(parameters,
  ------------------
  |  Branch (459:12): [True: 0, False: 1]
  ------------------
  460|      1|                                                     infopair_copy,
  461|      1|                                                     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|      1|    if ((prov->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 (466:9): [True: 0, False: 1]
  ------------------
  467|      0|        ossl_provider_free(prov);
  468|      0|        return NULL;
  469|      0|    }
  470|       |
  471|      1|    prov->init_function = init_function;
  472|       |
  473|      1|    return prov;
  474|      1|}
provider_core.c:provider_activate:
 1257|      1|{
 1258|      1|    int count = -1;
 1259|      1|    struct provider_store_st *store;
 1260|      1|    int ret = 1;
 1261|       |
 1262|      1|    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|      1|    if (store == NULL) {
  ------------------
  |  Branch (1267:9): [True: 1, False: 0]
  ------------------
 1268|      1|        lock = 0;
 1269|      1|        if (!provider_init(prov))
  ------------------
  |  Branch (1269:13): [True: 0, False: 1]
  ------------------
 1270|      0|            return -1;
 1271|      1|    }
 1272|       |
 1273|      1|#ifndef FIPS_MODULE
 1274|      1|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1274:9): [True: 0, False: 1]
  ------------------
 1275|      1|            && !ossl_rand_check_random_provider_on_load(prov->libctx, prov))
  ------------------
  |  Branch (1275:16): [True: 0, False: 0]
  ------------------
 1276|      0|        return -1;
 1277|       |
 1278|      1|    if (prov->ischild && upcalls && !ossl_provider_up_ref_parent(prov, 1))
  ------------------
  |  Branch (1278:9): [True: 0, False: 1]
  |  Branch (1278:26): [True: 0, False: 0]
  |  Branch (1278:37): [True: 0, False: 0]
  ------------------
 1279|      0|        return -1;
 1280|      1|#endif
 1281|       |
 1282|      1|    if (lock && !CRYPTO_THREAD_read_lock(store->lock)) {
  ------------------
  |  Branch (1282:9): [True: 0, False: 1]
  |  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|      1|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1290:9): [True: 0, False: 1]
  |  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|      1|    if (CRYPTO_atomic_add(&prov->activatecnt, 1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1298:9): [True: 1, False: 0]
  ------------------
 1299|      1|        prov->flag_activated = 1;
 1300|       |
 1301|      1|        if (count == 1 && store != NULL) {
  ------------------
  |  Branch (1301:13): [True: 1, False: 0]
  |  Branch (1301:27): [True: 0, False: 1]
  ------------------
 1302|      0|            ret = create_provider_children(prov);
 1303|      0|        }
 1304|      1|    }
 1305|      1|    if (lock) {
  ------------------
  |  Branch (1305:9): [True: 0, False: 1]
  ------------------
 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|      1|    if (!ret)
  ------------------
  |  Branch (1318:9): [True: 0, False: 1]
  ------------------
 1319|      0|        return -1;
 1320|       |
 1321|      1|    return count;
 1322|      1|}
provider_core.c:provider_init:
  940|      1|{
  941|      1|    const OSSL_DISPATCH *provider_dispatch = NULL;
  942|      1|    void *tmp_provctx = NULL;    /* safety measure */
  943|      1|#ifndef OPENSSL_NO_ERR
  944|      1|# ifndef FIPS_MODULE
  945|      1|    OSSL_FUNC_provider_get_reason_strings_fn *p_get_reason_strings = NULL;
  946|      1|# endif
  947|      1|#endif
  948|      1|    int ok = 0;
  949|       |
  950|      1|    if (!ossl_assert(!prov->flag_initialized)) {
  ------------------
  |  |   52|      1|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      1|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (950:9): [True: 0, False: 1]
  ------------------
  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|      1|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (959:9): [True: 0, False: 1]
  ------------------
  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|      1|    if (prov->init_function == NULL) {
  ------------------
  |  Branch (1030:9): [True: 0, False: 1]
  ------------------
 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|      1|#ifndef FIPS_MODULE
 1037|      1|    OSSL_TRACE_BEGIN(PROVIDER) {
  ------------------
  |  |  220|      1|    do {                                        \
  |  |  221|      1|        BIO *trc_out = NULL;                    \
  |  |  222|      1|        if (0)
  |  |  ------------------
  |  |  |  Branch (222:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1038|      0|        BIO_printf(trc_out,
 1039|      0|                   "(provider %s) initalizing\n", prov->name);
 1040|      1|    } OSSL_TRACE_END(PROVIDER);
  ------------------
  |  |  225|      1|    } while(0)
  |  |  ------------------
  |  |  |  Branch (225:13): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1041|      1|#endif
 1042|       |
 1043|      1|    if (!prov->init_function((OSSL_CORE_HANDLE *)prov, core_dispatch,
  ------------------
  |  Branch (1043:9): [True: 0, False: 1]
  ------------------
 1044|      1|                             &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|      1|    prov->provctx = tmp_provctx;
 1050|      1|    prov->dispatch = provider_dispatch;
 1051|       |
 1052|      1|    if (provider_dispatch != NULL) {
  ------------------
  |  Branch (1052:9): [True: 1, False: 0]
  ------------------
 1053|      6|        for (; provider_dispatch->function_id != 0; provider_dispatch++) {
  ------------------
  |  Branch (1053:16): [True: 5, False: 1]
  ------------------
 1054|      5|            switch (provider_dispatch->function_id) {
  ------------------
  |  Branch (1054:21): [True: 0, False: 5]
  ------------------
 1055|      1|            case OSSL_FUNC_PROVIDER_TEARDOWN:
  ------------------
  |  |  257|      1|# define OSSL_FUNC_PROVIDER_TEARDOWN           1024
  ------------------
  |  Branch (1055:13): [True: 1, False: 4]
  ------------------
 1056|      1|                prov->teardown =
 1057|      1|                    OSSL_FUNC_provider_teardown(provider_dispatch);
 1058|      1|                break;
 1059|      1|            case OSSL_FUNC_PROVIDER_GETTABLE_PARAMS:
  ------------------
  |  |  259|      1|# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS    1025
  ------------------
  |  Branch (1059:13): [True: 1, False: 4]
  ------------------
 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: 4]
  ------------------
 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: 5]
  ------------------
 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: 5]
  ------------------
 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: 4]
  ------------------
 1076|      1|                prov->get_capabilities =
 1077|      1|                    OSSL_FUNC_provider_get_capabilities(provider_dispatch);
 1078|      1|                break;
 1079|      1|            case OSSL_FUNC_PROVIDER_QUERY_OPERATION:
  ------------------
  |  |  265|      1|# define OSSL_FUNC_PROVIDER_QUERY_OPERATION    1027
  ------------------
  |  Branch (1079:13): [True: 1, False: 4]
  ------------------
 1080|      1|                prov->query_operation =
 1081|      1|                    OSSL_FUNC_provider_query_operation(provider_dispatch);
 1082|      1|                break;
 1083|      0|            case OSSL_FUNC_PROVIDER_UNQUERY_OPERATION:
  ------------------
  |  |  268|      0|# define OSSL_FUNC_PROVIDER_UNQUERY_OPERATION  1028
  ------------------
  |  Branch (1083:13): [True: 0, False: 5]
  ------------------
 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: 5]
  ------------------
 1090|      0|                p_get_reason_strings =
 1091|      0|                    OSSL_FUNC_provider_get_reason_strings(provider_dispatch);
 1092|      0|                break;
 1093|      5|# endif
 1094|      5|#endif
 1095|      5|            }
 1096|      5|        }
 1097|      1|    }
 1098|       |
 1099|      1|#ifndef OPENSSL_NO_ERR
 1100|      1|# ifndef FIPS_MODULE
 1101|      1|    if (p_get_reason_strings != NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 1]
  ------------------
 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|      1|# endif
 1143|      1|#endif
 1144|       |
 1145|       |    /* With this flag set, this provider has become fully "loaded". */
 1146|      1|    prov->flag_initialized = 1;
 1147|      1|    ok = 1;
 1148|       |
 1149|      1| end:
 1150|      1|    return ok;
 1151|      1|}
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_deactivate:
 1161|      1|{
 1162|      1|    int count;
 1163|      1|    struct provider_store_st *store;
 1164|      1|#ifndef FIPS_MODULE
 1165|      1|    int freeparent = 0;
 1166|      1|#endif
 1167|      1|    int lock = 1;
 1168|       |
 1169|      1|    if (!ossl_assert(prov != NULL))
  ------------------
  |  |   52|      1|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      1|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (1169:9): [True: 0, False: 1]
  ------------------
 1170|      0|        return -1;
 1171|       |
 1172|      1|#ifndef FIPS_MODULE
 1173|      1|    if (prov->random_bytes != NULL
  ------------------
  |  Branch (1173:9): [True: 0, False: 1]
  ------------------
 1174|      1|            && !ossl_rand_check_random_provider_on_unload(prov->libctx, prov))
  ------------------
  |  Branch (1174:16): [True: 0, False: 0]
  ------------------
 1175|      0|        return -1;
 1176|      1|#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|      1|    store = get_provider_store(prov->libctx);
 1183|      1|    if (store == NULL)
  ------------------
  |  Branch (1183:9): [True: 0, False: 1]
  ------------------
 1184|      0|        lock = 0;
 1185|       |
 1186|      1|    if (lock && !CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1186:9): [True: 1, False: 0]
  |  Branch (1186:17): [True: 0, False: 1]
  ------------------
 1187|      0|        return -1;
 1188|      1|    if (lock && !CRYPTO_THREAD_write_lock(prov->flag_lock)) {
  ------------------
  |  Branch (1188:9): [True: 1, False: 0]
  |  Branch (1188:17): [True: 0, False: 1]
  ------------------
 1189|      0|        CRYPTO_THREAD_unlock(store->lock);
 1190|      0|        return -1;
 1191|      0|    }
 1192|       |
 1193|      1|    if (!CRYPTO_atomic_add(&prov->activatecnt, -1, &count, prov->activatecnt_lock)) {
  ------------------
  |  Branch (1193:9): [True: 0, False: 1]
  ------------------
 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|      1|#ifndef FIPS_MODULE
 1202|      1|    if (count >= 1 && prov->ischild && upcalls) {
  ------------------
  |  Branch (1202:9): [True: 0, False: 1]
  |  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|      1|#endif
 1212|       |
 1213|      1|    if (count < 1)
  ------------------
  |  Branch (1213:9): [True: 1, False: 0]
  ------------------
 1214|      1|        prov->flag_activated = 0;
 1215|      0|#ifndef FIPS_MODULE
 1216|      0|    else
 1217|      0|        removechildren = 0;
 1218|      1|#endif
 1219|       |
 1220|      1|#ifndef FIPS_MODULE
 1221|      1|    if (removechildren && store != NULL) {
  ------------------
  |  Branch (1221:9): [True: 1, False: 0]
  |  Branch (1221:27): [True: 1, False: 0]
  ------------------
 1222|      1|        int i, max = sk_OSSL_PROVIDER_CHILD_CB_num(store->child_cbs);
 1223|      1|        OSSL_PROVIDER_CHILD_CB *child_cb;
 1224|       |
 1225|      1|        for (i = 0; i < max; i++) {
  ------------------
  |  Branch (1225:21): [True: 0, False: 1]
  ------------------
 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|      1|    }
 1230|      1|#endif
 1231|      1|    if (lock) {
  ------------------
  |  Branch (1231:9): [True: 1, False: 0]
  ------------------
 1232|      1|        CRYPTO_THREAD_unlock(prov->flag_lock);
 1233|      1|        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|      1|#ifndef FIPS_MODULE
 1239|      1|        if (count < 1)
  ------------------
  |  Branch (1239:13): [True: 1, False: 0]
  ------------------
 1240|      1|            ossl_decoder_cache_flush(prov->libctx);
 1241|      1|#endif
 1242|      1|    }
 1243|      1|#ifndef FIPS_MODULE
 1244|      1|    if (freeparent)
  ------------------
  |  Branch (1244:9): [True: 0, False: 1]
  ------------------
 1245|      0|        ossl_provider_free_parent(prov, 1);
 1246|      1|#endif
 1247|       |
 1248|       |    /* We don't deinit here, that's done in ossl_provider_free() */
 1249|      1|    return count;
 1250|      1|}
provider_core.c:provider_remove_store_methods:
 1357|      1|{
 1358|      1|    struct provider_store_st *store;
 1359|      1|    int freeing;
 1360|       |
 1361|      1|    if ((store = get_provider_store(prov->libctx)) == NULL)
  ------------------
  |  Branch (1361:9): [True: 0, False: 1]
  ------------------
 1362|      0|        return 0;
 1363|       |
 1364|      1|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1364:9): [True: 0, False: 1]
  ------------------
 1365|      0|        return 0;
 1366|      1|    freeing = store->freeing;
 1367|      1|    CRYPTO_THREAD_unlock(store->lock);
 1368|       |
 1369|      1|    if (!freeing) {
  ------------------
  |  Branch (1369:9): [True: 0, False: 1]
  ------------------
 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|      1|    return 1;
 1394|      1|}
provider_core.c:provider_activate_fallbacks:
 1437|     30|{
 1438|     30|    int use_fallbacks;
 1439|     30|    int activated_fallback_count = 0;
 1440|     30|    int ret = 0;
 1441|     30|    const OSSL_PROVIDER_INFO *p;
 1442|       |
 1443|     30|    if (!CRYPTO_THREAD_read_lock(store->lock))
  ------------------
  |  Branch (1443:9): [True: 0, False: 30]
  ------------------
 1444|      0|        return 0;
 1445|     30|    use_fallbacks = store->use_fallbacks;
 1446|     30|    CRYPTO_THREAD_unlock(store->lock);
 1447|     30|    if (!use_fallbacks)
  ------------------
  |  Branch (1447:9): [True: 29, False: 1]
  ------------------
 1448|     29|        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|      1|        for (i = 0; i < store->numprovinfo; info++, i++) {
  ------------------
  |  Branch (1468:21): [True: 0, False: 1]
  ------------------
 1469|      0|            if (strcmp(info->name, p->name) != 0)
  ------------------
  |  Branch (1469:17): [True: 0, False: 0]
  ------------------
 1470|      0|                continue;
 1471|      0|            params = info->parameters;
 1472|      0|            break;
 1473|      0|        }
 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|      1|{
  106|      1|#ifndef OPENSSL_NO_ERR
  107|      1|    if (ERR_reason_error_string(RAND_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (107:9): [True: 1, False: 0]
  ------------------
  108|      1|        ERR_load_strings_const(RAND_str_reasons);
  109|      1|#endif
  110|      1|    return 1;
  111|      1|}

ossl_rand_cleanup_int:
  180|      1|{
  181|      1|# ifndef OPENSSL_NO_DEPRECATED_3_0
  182|      1|    const RAND_METHOD *meth = default_RAND_meth;
  183|       |
  184|      1|    if (!rand_inited)
  ------------------
  |  Branch (184:9): [True: 0, False: 1]
  ------------------
  185|      0|        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.32k|{
  287|  1.32k|    const RAND_METHOD *tmp_meth = NULL;
  288|       |
  289|  1.32k|    if (!RUN_ONCE(&rand_init, do_rand_init))
  ------------------
  |  |  130|  1.32k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (289:9): [True: 0, False: 1.32k]
  ------------------
  290|      0|        return NULL;
  291|       |
  292|  1.32k|    if (rand_meth_lock == NULL)
  ------------------
  |  Branch (292:9): [True: 0, False: 1.32k]
  ------------------
  293|      0|        return NULL;
  294|       |
  295|  1.32k|    if (!CRYPTO_THREAD_read_lock(rand_meth_lock))
  ------------------
  |  Branch (295:9): [True: 0, False: 1.32k]
  ------------------
  296|      0|        return NULL;
  297|  1.32k|    tmp_meth = default_RAND_meth;
  298|  1.32k|    CRYPTO_THREAD_unlock(rand_meth_lock);
  299|  1.32k|    if (tmp_meth != NULL)
  ------------------
  |  Branch (299:9): [True: 1.31k, False: 1]
  ------------------
  300|  1.31k|        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|    759|{
  439|    759|    RAND_GLOBAL *dgbl;
  440|    759|    EVP_RAND_CTX *rand;
  441|    759|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  442|    759|    const RAND_METHOD *meth = RAND_get_rand_method();
  443|       |
  444|    759|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (444:9): [True: 759, False: 0]
  |  Branch (444:25): [True: 0, False: 759]
  ------------------
  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|    759|#endif
  451|       |
  452|    759|    dgbl = rand_get_global(ctx);
  453|    759|    if (dgbl == NULL)
  ------------------
  |  Branch (453:9): [True: 0, False: 759]
  ------------------
  454|      0|        return 0;
  455|    759|#ifndef FIPS_MODULE
  456|    759|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (456:9): [True: 0, False: 759]
  ------------------
  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|    759|#endif      /* !FIPS_MODULE */
  461|    759|    rand = rand_get0_private(ctx, dgbl);
  462|    759|    if (rand != NULL)
  ------------------
  |  Branch (462:9): [True: 759, False: 0]
  ------------------
  463|    759|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  464|       |
  465|      0|    return 0;
  466|    759|}
RAND_bytes_ex:
  477|    561|{
  478|    561|    RAND_GLOBAL *dgbl;
  479|    561|    EVP_RAND_CTX *rand;
  480|    561|#if !defined(OPENSSL_NO_DEPRECATED_3_0) && !defined(FIPS_MODULE)
  481|    561|    const RAND_METHOD *meth = RAND_get_rand_method();
  482|       |
  483|    561|    if (meth != NULL && meth != RAND_OpenSSL()) {
  ------------------
  |  Branch (483:9): [True: 561, False: 0]
  |  Branch (483:25): [True: 0, False: 561]
  ------------------
  484|      0|        if (meth->bytes != NULL)
  ------------------
  |  Branch (484:13): [True: 0, False: 0]
  ------------------
  485|      0|            return meth->bytes(buf, num);
  486|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  487|      0|        return -1;
  488|      0|    }
  489|    561|#endif
  490|       |
  491|    561|    dgbl = rand_get_global(ctx);
  492|    561|    if (dgbl == NULL)
  ------------------
  |  Branch (492:9): [True: 0, False: 561]
  ------------------
  493|      0|        return 0;
  494|    561|#ifndef FIPS_MODULE
  495|    561|    if (dgbl->random_provider != NULL)
  ------------------
  |  Branch (495:9): [True: 0, False: 561]
  ------------------
  496|      0|        return ossl_provider_random_bytes(dgbl->random_provider,
  497|      0|                                          OSSL_PROV_RANDOM_PUBLIC,
  ------------------
  |  |  124|      0|# define OSSL_PROV_RANDOM_PUBLIC     0
  ------------------
  498|      0|                                          buf, num, strength);
  499|    561|#endif      /* !FIPS_MODULE */
  500|       |
  501|    561|    rand = rand_get0_public(ctx, dgbl);
  502|    561|    if (rand != NULL)
  ------------------
  |  Branch (502:9): [True: 561, False: 0]
  ------------------
  503|    561|        return EVP_RAND_generate(rand, buf, num, strength, 0, NULL, 0);
  504|       |
  505|      0|    return 0;
  506|    561|}
RAND_bytes:
  509|     72|{
  510|     72|    if (num < 0)
  ------------------
  |  Branch (510:9): [True: 0, False: 72]
  ------------------
  511|      0|        return 0;
  512|     72|    return RAND_bytes_ex(NULL, buf, (size_t)num, 0);
  513|     72|}
ossl_rand_ctx_new:
  520|      1|{
  521|      1|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  522|       |
  523|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (523:9): [True: 0, False: 1]
  ------------------
  524|      0|        return NULL;
  525|       |
  526|      1|#ifndef FIPS_MODULE
  527|       |    /*
  528|       |     * We need to ensure that base libcrypto thread handling has been
  529|       |     * initialised.
  530|       |     */
  531|      1|    OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      1|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  532|       |
  533|       |    /* Prepopulate the random provider name */
  534|      1|    dgbl->random_provider_name = OPENSSL_strdup(random_provider_fips_name);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  535|      1|    if (dgbl->random_provider_name == NULL)
  ------------------
  |  Branch (535:9): [True: 0, False: 1]
  ------------------
  536|      0|        goto err0;
  537|      1|#endif
  538|       |
  539|      1|    dgbl->lock = CRYPTO_THREAD_lock_new();
  540|      1|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (540:9): [True: 0, False: 1]
  ------------------
  541|      0|        goto err1;
  542|       |
  543|      1|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (543:9): [True: 0, False: 1]
  ------------------
  544|      0|        goto err1;
  545|       |
  546|      1|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (546:9): [True: 0, False: 1]
  ------------------
  547|      0|        goto err2;
  548|       |
  549|      1|    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|      1|{
  565|      1|    RAND_GLOBAL *dgbl = vdgbl;
  566|       |
  567|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (567:9): [True: 0, False: 1]
  ------------------
  568|      0|        return;
  569|       |
  570|      1|    CRYPTO_THREAD_lock_free(dgbl->lock);
  571|      1|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  572|      1|    CRYPTO_THREAD_cleanup_local(&dgbl->public);
  573|      1|    EVP_RAND_CTX_free(dgbl->primary);
  574|      1|    EVP_RAND_CTX_free(dgbl->seed);
  575|      1|#ifndef FIPS_MODULE
  576|      1|    OPENSSL_free(dgbl->random_provider_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__
  |  |  ------------------
  ------------------
  577|      1|#endif      /* !FIPS_MODULE */
  578|      1|    OPENSSL_free(dgbl->rng_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__
  |  |  ------------------
  ------------------
  579|      1|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  580|      1|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  581|      1|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  582|      1|    OPENSSL_free(dgbl->seed_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__
  |  |  ------------------
  ------------------
  583|      1|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  584|       |
  585|      1|    OPENSSL_free(dgbl);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  586|      1|}
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.32k|{
  101|  1.32k|    return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX);
  ------------------
  |  |  103|  1.32k|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  102|  1.32k|}
rand_lib.c:rand_get0_primary:
  760|      2|{
  761|      2|    EVP_RAND_CTX *ret, *seed, *newseed = NULL, *primary;
  762|       |
  763|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (763:9): [True: 0, False: 2]
  ------------------
  764|      0|        return NULL;
  765|       |
  766|      2|    if (!CRYPTO_THREAD_read_lock(dgbl->lock))
  ------------------
  |  Branch (766:9): [True: 0, False: 2]
  ------------------
  767|      0|        return NULL;
  768|       |
  769|      2|    ret = dgbl->primary;
  770|      2|    seed = dgbl->seed;
  771|      2|    CRYPTO_THREAD_unlock(dgbl->lock);
  772|       |
  773|      2|    if (ret != NULL)
  ------------------
  |  Branch (773:9): [True: 1, False: 1]
  ------------------
  774|      1|        return ret;
  775|       |
  776|      1|#if !defined(FIPS_MODULE) || !defined(OPENSSL_NO_FIPS_JITTER)
  777|       |    /* Create a seed source for libcrypto or jitter enabled FIPS provider */
  778|      1|    if (seed == NULL) {
  ------------------
  |  Branch (778:9): [True: 1, False: 0]
  ------------------
  779|      1|        ERR_set_mark();
  780|      1|        seed = newseed = rand_new_seed(ctx);
  781|      1|        ERR_pop_to_mark();
  782|      1|    }
  783|      1|#endif  /* !FIPS_MODULE || !OPENSSL_NO_FIPS_JITTER */
  784|       |
  785|       |#if defined(FIPS_MODULE)
  786|       |    /* The FIPS provider has entropy health tests instead of the primary */
  787|       |    ret = rand_new_crngt(ctx, seed);
  788|       |#else   /* FIPS_MODULE */
  789|      1|    ret = rand_new_drbg(ctx, seed, PRIMARY_RESEED_INTERVAL,
  ------------------
  |  |   23|      1|# define PRIMARY_RESEED_INTERVAL                 (1 << 8)
  ------------------
  790|      1|                        PRIMARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   25|      1|# define PRIMARY_RESEED_TIME_INTERVAL            (60 * 60) /* 1 hour */
  ------------------
  791|      1|#endif  /* FIPS_MODULE */
  792|       |
  793|       |    /*
  794|       |     * The primary DRBG may be shared between multiple threads so we must
  795|       |     * enable locking.
  796|       |     */
  797|      1|    if (ret == NULL || !EVP_RAND_enable_locking(ret)) {
  ------------------
  |  Branch (797:9): [True: 0, False: 1]
  |  Branch (797:24): [True: 0, False: 1]
  ------------------
  798|      0|        if (ret != NULL) {
  ------------------
  |  Branch (798:13): [True: 0, False: 0]
  ------------------
  799|      0|            ERR_raise(ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  800|      0|            EVP_RAND_CTX_free(ret);
  801|      0|        }
  802|      0|        if (newseed == NULL)
  ------------------
  |  Branch (802:13): [True: 0, False: 0]
  ------------------
  803|      0|            return NULL;
  804|       |        /* else carry on and store seed */
  805|      0|        ret = NULL;
  806|      0|    }
  807|       |
  808|      1|    if (!CRYPTO_THREAD_write_lock(dgbl->lock))
  ------------------
  |  Branch (808:9): [True: 0, False: 1]
  ------------------
  809|      0|        return NULL;
  810|       |
  811|      1|    primary = dgbl->primary;
  812|      1|    if (primary != NULL) {
  ------------------
  |  Branch (812:9): [True: 0, False: 1]
  ------------------
  813|      0|        CRYPTO_THREAD_unlock(dgbl->lock);
  814|      0|        EVP_RAND_CTX_free(ret);
  815|      0|        EVP_RAND_CTX_free(newseed);
  816|      0|        return primary;
  817|      0|    }
  818|      1|    if (newseed != NULL)
  ------------------
  |  Branch (818:9): [True: 1, False: 0]
  ------------------
  819|      1|        dgbl->seed = newseed;
  820|      1|    dgbl->primary = ret;
  821|      1|    CRYPTO_THREAD_unlock(dgbl->lock);
  822|       |
  823|      1|    return ret;
  824|      1|}
rand_lib.c:rand_new_seed:
  608|      1|{
  609|      1|    EVP_RAND *rand;
  610|      1|    const char *propq;
  611|      1|    char *name;
  612|      1|    EVP_RAND_CTX *ctx = NULL;
  613|      1|# ifdef OPENSSL_NO_FIPS_JITTER
  614|      1|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  615|       |
  616|      1|    if (dgbl == NULL)
  ------------------
  |  Branch (616:9): [True: 0, False: 1]
  ------------------
  617|      0|        return NULL;
  618|      1|    propq = dgbl->seed_propq;
  619|      1|    name = dgbl->seed_name != NULL ? dgbl->seed_name
  ------------------
  |  Branch (619:12): [True: 0, False: 1]
  ------------------
  620|      1|                                   : OPENSSL_MSTR(OPENSSL_DEFAULT_SEED_SRC);
  ------------------
  |  |   20|      1|# define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
  |  |  ------------------
  |  |  |  |   19|      1|# define OPENSSL_MSTR_HELPER(x) #x
  |  |  ------------------
  ------------------
  621|       |# else /* !OPENSSL_NO_FIPS_JITTER */
  622|       |    name = "JITTER";
  623|       |    propq = "";
  624|       |# endif /* OPENSSL_NO_FIPS_JITTER */
  625|       |
  626|      1|    rand = EVP_RAND_fetch(libctx, name, propq);
  627|      1|    if (rand == NULL) {
  ------------------
  |  Branch (627:9): [True: 0, False: 1]
  ------------------
  628|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  629|      0|        goto err;
  630|      0|    }
  631|      1|    ctx = EVP_RAND_CTX_new(rand, NULL);
  632|      1|    EVP_RAND_free(rand);
  633|      1|    if (ctx == NULL) {
  ------------------
  |  Branch (633:9): [True: 0, False: 1]
  ------------------
  634|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  635|      0|        goto err;
  636|      0|    }
  637|      1|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, NULL)) {
  ------------------
  |  Branch (637:9): [True: 0, False: 1]
  ------------------
  638|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  639|      0|        goto err;
  640|      0|    }
  641|      1|    return ctx;
  642|      0| err:
  643|      0|    EVP_RAND_CTX_free(ctx);
  644|      0|    return NULL;
  645|      1|}
rand_lib.c:rand_new_drbg:
  668|      3|{
  669|      3|    EVP_RAND *rand;
  670|      3|    RAND_GLOBAL *dgbl = rand_get_global(libctx);
  671|      3|    EVP_RAND_CTX *ctx;
  672|      3|    OSSL_PARAM params[9], *p = params;
  673|      3|    const OSSL_PARAM *settables;
  674|      3|    const char *prov_name;
  675|      3|    char *name, *cipher;
  676|      3|    int use_df = 1;
  677|       |
  678|      3|    if (dgbl == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 3]
  ------------------
  679|      0|        return NULL;
  680|      3|    name = dgbl->rng_name != NULL ? dgbl->rng_name : "CTR-DRBG";
  ------------------
  |  Branch (680:12): [True: 0, False: 3]
  ------------------
  681|      3|    rand = EVP_RAND_fetch(libctx, name, dgbl->rng_propq);
  682|      3|    if (rand == NULL) {
  ------------------
  |  Branch (682:9): [True: 0, False: 3]
  ------------------
  683|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  684|      0|        return NULL;
  685|      0|    }
  686|      3|    prov_name = ossl_provider_name(EVP_RAND_get0_provider(rand));
  687|      3|    ctx = EVP_RAND_CTX_new(rand, parent);
  688|      3|    EVP_RAND_free(rand);
  689|      3|    if (ctx == NULL) {
  ------------------
  |  Branch (689:9): [True: 0, False: 3]
  ------------------
  690|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  691|      0|        return NULL;
  692|      0|    }
  693|       |
  694|      3|    settables = EVP_RAND_CTX_settable_params(ctx);
  695|      3|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_CIPHER)) {
  ------------------
  |  |  227|      3|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      3|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (695:9): [True: 3, False: 0]
  ------------------
  696|      3|        cipher = dgbl->rng_cipher != NULL ? dgbl->rng_cipher : "AES-256-CTR";
  ------------------
  |  Branch (696:18): [True: 0, False: 3]
  ------------------
  697|      3|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_CIPHER,
  ------------------
  |  |  227|      3|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      3|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  698|      3|                                                cipher, 0);
  699|      3|    }
  700|      3|    if (dgbl->rng_digest != NULL
  ------------------
  |  Branch (700:9): [True: 0, False: 3]
  ------------------
  701|      3|            && OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_DIGEST))
  ------------------
  |  |  228|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  122|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  |  Branch (701:16): [True: 0, False: 0]
  ------------------
  702|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_DIGEST,
  ------------------
  |  |  228|      0|# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  122|      0|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  703|      0|                                                dgbl->rng_digest, 0);
  704|      3|    if (prov_name != NULL)
  ------------------
  |  Branch (704:9): [True: 3, False: 0]
  ------------------
  705|      3|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_PROV_PARAM_CORE_PROV_NAME,
  ------------------
  |  |  494|      3|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  706|      3|                                                (char *)prov_name, 0);
  707|      3|    if (dgbl->rng_propq != NULL)
  ------------------
  |  Branch (707:9): [True: 0, False: 3]
  ------------------
  708|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_DRBG_PARAM_PROPERTIES,
  ------------------
  |  |  242|      0|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  709|      0|                                                dgbl->rng_propq, 0);
  710|      3|    if (OSSL_PARAM_locate_const(settables, OSSL_ALG_PARAM_MAC))
  ------------------
  |  |  125|      3|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  |  Branch (710:9): [True: 0, False: 3]
  ------------------
  711|      0|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_ALG_PARAM_MAC, "HMAC", 0);
  ------------------
  |  |  125|      0|# define OSSL_ALG_PARAM_MAC "mac"
  ------------------
  712|      3|    if (OSSL_PARAM_locate_const(settables, OSSL_DRBG_PARAM_USE_DF))
  ------------------
  |  |  249|      3|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (712:9): [True: 3, False: 0]
  ------------------
  713|      3|        *p++ = OSSL_PARAM_construct_int(OSSL_DRBG_PARAM_USE_DF, &use_df);
  ------------------
  |  |  249|      3|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  714|      3|    *p++ = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS,
  ------------------
  |  |  245|      3|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  715|      3|                                     &reseed_interval);
  716|      3|    *p++ = OSSL_PARAM_construct_time_t(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL,
  ------------------
  |  |  247|      3|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  717|      3|                                       &reseed_time_interval);
  718|      3|    *p = OSSL_PARAM_construct_end();
  719|      3|    if (!EVP_RAND_instantiate(ctx, 0, 0, NULL, 0, params)) {
  ------------------
  |  Branch (719:9): [True: 0, False: 3]
  ------------------
  720|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  721|      0|        EVP_RAND_CTX_free(ctx);
  722|      0|        return NULL;
  723|      0|    }
  724|      3|    return ctx;
  725|      3|}
rand_lib.c:rand_get0_public:
  839|    561|{
  840|    561|    EVP_RAND_CTX *rand, *primary;
  841|       |
  842|    561|    if (dgbl == NULL)
  ------------------
  |  Branch (842:9): [True: 0, False: 561]
  ------------------
  843|      0|        return NULL;
  844|       |
  845|    561|    rand = CRYPTO_THREAD_get_local(&dgbl->public);
  846|    561|    if (rand == NULL) {
  ------------------
  |  Branch (846:9): [True: 1, False: 560]
  ------------------
  847|      1|        primary = rand_get0_primary(ctx, dgbl);
  848|      1|        if (primary == NULL)
  ------------------
  |  Branch (848:13): [True: 0, False: 1]
  ------------------
  849|      0|            return NULL;
  850|       |
  851|      1|        ctx = ossl_lib_ctx_get_concrete(ctx);
  852|       |
  853|      1|        if (ctx == NULL)
  ------------------
  |  Branch (853:13): [True: 0, False: 1]
  ------------------
  854|      0|            return NULL;
  855|       |        /*
  856|       |         * If the private is also NULL then this is the first time we've
  857|       |         * used this thread.
  858|       |         */
  859|      1|        if (CRYPTO_THREAD_get_local(&dgbl->private) == NULL
  ------------------
  |  Branch (859:13): [True: 0, False: 1]
  ------------------
  860|      1|                && !ossl_init_thread_start(NULL, ctx, rand_delete_thread_state))
  ------------------
  |  Branch (860:20): [True: 0, False: 0]
  ------------------
  861|      0|            return NULL;
  862|      1|        rand = rand_new_drbg(ctx, primary, SECONDARY_RESEED_INTERVAL,
  ------------------
  |  |   24|      1|# define SECONDARY_RESEED_INTERVAL               (1 << 16)
  ------------------
  863|      1|                             SECONDARY_RESEED_TIME_INTERVAL);
  ------------------
  |  |   26|      1|# define SECONDARY_RESEED_TIME_INTERVAL          (7 * 60)  /* 7 minutes */
  ------------------
  864|      1|        CRYPTO_THREAD_set_local(&dgbl->public, rand);
  865|      1|    }
  866|    561|    return rand;
  867|    561|}
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|    759|{
  882|    759|    EVP_RAND_CTX *rand, *primary;
  883|       |
  884|    759|    rand = CRYPTO_THREAD_get_local(&dgbl->private);
  885|    759|    if (rand == NULL) {
  ------------------
  |  Branch (885:9): [True: 1, False: 758]
  ------------------
  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|    759|    return rand;
  906|    759|}

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

ossl_rand_pool_new:
   24|      1|{
   25|      1|    RAND_POOL *pool = OPENSSL_zalloc(sizeof(*pool));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   26|      1|    size_t min_alloc_size = RAND_POOL_MIN_ALLOCATION(secure);
  ------------------
  |  |   60|      1|# define RAND_POOL_MIN_ALLOCATION(secure) ((secure) ? 16 : 48)
  |  |  ------------------
  |  |  |  Branch (60:44): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   27|       |
   28|      1|    if (pool == NULL)
  ------------------
  |  Branch (28:9): [True: 0, False: 1]
  ------------------
   29|      0|        return NULL;
   30|       |
   31|      1|    pool->min_len = min_len;
   32|      1|    pool->max_len = (max_len > RAND_POOL_MAX_LENGTH) ?
  ------------------
  |  |   36|      1|# define RAND_POOL_MAX_LENGTH    (RAND_POOL_FACTOR * \
  |  |  ------------------
  |  |  |  |   35|      1|# define RAND_POOL_FACTOR        256
  |  |  ------------------
  |  |   37|      1|                                  3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   37|      1|# define RAND_DRBG_STRENGTH             256
  |  |  ------------------
  ------------------
  |  Branch (32:21): [True: 1, False: 0]
  ------------------
   33|      1|        RAND_POOL_MAX_LENGTH : max_len;
  ------------------
  |  |   36|      1|# define RAND_POOL_MAX_LENGTH    (RAND_POOL_FACTOR * \
  |  |  ------------------
  |  |  |  |   35|      1|# define RAND_POOL_FACTOR        256
  |  |  ------------------
  |  |   37|      1|                                  3 * (RAND_DRBG_STRENGTH / 16))
  |  |  ------------------
  |  |  |  |   37|      1|# define RAND_DRBG_STRENGTH             256
  |  |  ------------------
  ------------------
   34|      1|    pool->alloc_len = min_len < min_alloc_size ? min_alloc_size : min_len;
  ------------------
  |  Branch (34:23): [True: 0, False: 1]
  ------------------
   35|      1|    if (pool->alloc_len > pool->max_len)
  ------------------
  |  Branch (35:9): [True: 0, False: 1]
  ------------------
   36|      0|        pool->alloc_len = pool->max_len;
   37|       |
   38|      1|    if (secure)
  ------------------
  |  Branch (38:9): [True: 1, False: 0]
  ------------------
   39|      1|        pool->buffer = OPENSSL_secure_zalloc(pool->alloc_len);
  ------------------
  |  |  125|      1|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   40|      0|    else
   41|      0|        pool->buffer = OPENSSL_zalloc(pool->alloc_len);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   42|       |
   43|      1|    if (pool->buffer == NULL)
  ------------------
  |  Branch (43:9): [True: 0, False: 1]
  ------------------
   44|      0|        goto err;
   45|       |
   46|      1|    pool->entropy_requested = entropy_requested;
   47|      1|    pool->secure = secure;
   48|      1|    return pool;
   49|       |
   50|      0|err:
   51|      0|    OPENSSL_free(pool);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   52|      0|    return NULL;
   53|      1|}
ossl_rand_pool_free:
   89|      1|{
   90|      1|    if (pool == NULL)
  ------------------
  |  Branch (90:9): [True: 0, False: 1]
  ------------------
   91|      0|        return;
   92|       |
   93|       |    /*
   94|       |     * Although it would be advisable from a cryptographical viewpoint,
   95|       |     * we are not allowed to clear attached buffers, since they are passed
   96|       |     * to ossl_rand_pool_attach() as `const unsigned char*`.
   97|       |     * (see corresponding comment in ossl_rand_pool_attach()).
   98|       |     */
   99|      1|    if (!pool->attached) {
  ------------------
  |  Branch (99:9): [True: 1, False: 0]
  ------------------
  100|      1|        if (pool->secure)
  ------------------
  |  Branch (100:13): [True: 1, False: 0]
  ------------------
  101|      1|            OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  129|      1|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|      0|        else
  103|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  104|      1|    }
  105|       |
  106|      1|    OPENSSL_free(pool);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  107|      1|}
ossl_rand_pool_length:
  129|      1|{
  130|      1|    return pool->len;
  131|      1|}
ossl_rand_pool_detach:
  140|      1|{
  141|      1|    unsigned char *ret = pool->buffer;
  142|      1|    pool->buffer = NULL;
  143|      1|    pool->entropy = 0;
  144|      1|    return ret;
  145|      1|}
ossl_rand_pool_entropy_available:
  175|      1|{
  176|      1|    if (pool->entropy < pool->entropy_requested)
  ------------------
  |  Branch (176:9): [True: 0, False: 1]
  ------------------
  177|      0|        return 0;
  178|       |
  179|      1|    if (pool->len < pool->min_len)
  ------------------
  |  Branch (179:9): [True: 0, False: 1]
  ------------------
  180|      0|        return 0;
  181|       |
  182|      1|    return pool->entropy;
  183|      1|}
ossl_rand_pool_entropy_needed:
  191|      1|{
  192|      1|    if (pool->entropy < pool->entropy_requested)
  ------------------
  |  Branch (192:9): [True: 1, False: 0]
  ------------------
  193|      1|        return pool->entropy_requested - pool->entropy;
  194|       |
  195|      0|    return 0;
  196|      1|}
ossl_rand_pool_bytes_needed:
  239|      1|{
  240|      1|    size_t bytes_needed;
  241|      1|    size_t entropy_needed = ossl_rand_pool_entropy_needed(pool);
  242|       |
  243|      1|    if (entropy_factor < 1) {
  ------------------
  |  Branch (243:9): [True: 0, False: 1]
  ------------------
  244|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  245|      0|        return 0;
  246|      0|    }
  247|       |
  248|      1|    bytes_needed = ENTROPY_TO_BYTES(entropy_needed, entropy_factor);
  ------------------
  |  |  163|      1|    (((bits) * (entropy_factor) + 7) / 8)
  ------------------
  249|       |
  250|      1|    if (bytes_needed > pool->max_len - pool->len) {
  ------------------
  |  Branch (250:9): [True: 0, False: 1]
  ------------------
  251|       |        /* not enough space left */
  252|      0|        ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   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_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |   97|      0|# define ERR_LIB_RAND            36
  ------------------
                      ERR_raise_data(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW,
  ------------------
  |  |   55|      0|# define RAND_R_RANDOM_POOL_OVERFLOW                      125
  ------------------
  253|      0|                       "entropy_factor=%u, entropy_needed=%zu, bytes_needed=%zu,"
  254|      0|                       "pool->max_len=%zu, pool->len=%zu",
  255|      0|                       entropy_factor, entropy_needed, bytes_needed,
  256|      0|                       pool->max_len, pool->len);
  257|      0|        return 0;
  258|      0|    }
  259|       |
  260|      1|    if (pool->len < pool->min_len &&
  ------------------
  |  Branch (260:9): [True: 1, False: 0]
  ------------------
  261|      1|        bytes_needed < pool->min_len - pool->len)
  ------------------
  |  Branch (261:9): [True: 0, False: 1]
  ------------------
  262|       |        /* to meet the min_len requirement */
  263|      0|        bytes_needed = pool->min_len - pool->len;
  264|       |
  265|       |    /*
  266|       |     * Make sure the buffer is large enough for the requested amount
  267|       |     * of data. This guarantees that existing code patterns where
  268|       |     * ossl_rand_pool_add_begin, ossl_rand_pool_add_end or ossl_rand_pool_add
  269|       |     * are used to collect entropy data without any error handling
  270|       |     * whatsoever, continue to be valid.
  271|       |     * Furthermore if the allocation here fails once, make sure that
  272|       |     * we don't fall back to a less secure or even blocking random source,
  273|       |     * as that could happen by the existing code patterns.
  274|       |     * This is not a concern for additional data, therefore that
  275|       |     * is not needed if rand_pool_grow fails in other places.
  276|       |     */
  277|      1|    if (!rand_pool_grow(pool, bytes_needed)) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1]
  ------------------
  278|       |        /* persistent error for this pool */
  279|      0|        pool->max_len = pool->len = 0;
  280|      0|        return 0;
  281|      0|    }
  282|       |
  283|      1|    return bytes_needed;
  284|      1|}
ossl_rand_pool_add_begin:
  357|      1|{
  358|      1|    if (len == 0)
  ------------------
  |  Branch (358:9): [True: 0, False: 1]
  ------------------
  359|      0|        return NULL;
  360|       |
  361|      1|    if (len > pool->max_len - pool->len) {
  ------------------
  |  Branch (361:9): [True: 0, False: 1]
  ------------------
  362|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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 NULL;
  364|      0|    }
  365|       |
  366|      1|    if (pool->buffer == NULL) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1]
  ------------------
  367|      0|        ERR_raise(ERR_LIB_RAND, 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 NULL;
  369|      0|    }
  370|       |
  371|       |    /*
  372|       |     * As long as the allocation request stays within the limits given
  373|       |     * by ossl_rand_pool_bytes_needed this rand_pool_grow below is guaranteed
  374|       |     * to succeed, thus no allocation happens.
  375|       |     * We have that only for cases when a pool is used to collect
  376|       |     * additional data. Then the buffer might need to grow here,
  377|       |     * and of course the caller is responsible to check the return
  378|       |     * value of this function.
  379|       |     */
  380|      1|    if (!rand_pool_grow(pool, len))
  ------------------
  |  Branch (380:9): [True: 0, False: 1]
  ------------------
  381|      0|        return NULL;
  382|       |
  383|      1|    return pool->buffer + pool->len;
  384|      1|}
ossl_rand_pool_add_end:
  396|      1|{
  397|      1|    if (len > pool->alloc_len - pool->len) {
  ------------------
  |  Branch (397:9): [True: 0, False: 1]
  ------------------
  398|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  399|      0|        return 0;
  400|      0|    }
  401|       |
  402|      1|    if (len > 0) {
  ------------------
  |  Branch (402:9): [True: 1, False: 0]
  ------------------
  403|      1|        pool->len += len;
  404|      1|        pool->entropy += entropy;
  405|      1|    }
  406|       |
  407|      1|    return 1;
  408|      1|}
ossl_rand_pool_adin_mix_in:
  423|      1|{
  424|      1|    if (adin == NULL || adin_len == 0)
  ------------------
  |  Branch (424:9): [True: 0, False: 1]
  |  Branch (424:25): [True: 0, False: 1]
  ------------------
  425|       |        /* Nothing to mix in -> success */
  426|      0|        return 1;
  427|       |
  428|      1|    if (pool->buffer == NULL) {
  ------------------
  |  Branch (428:9): [True: 0, False: 1]
  ------------------
  429|      0|        ERR_raise(ERR_LIB_RAND, 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)
  |  |  ------------------
  ------------------
  430|      0|        return 0;
  431|      0|    }
  432|       |
  433|      1|    if (pool->len == 0) {
  ------------------
  |  Branch (433:9): [True: 0, False: 1]
  ------------------
  434|      0|        ERR_raise(ERR_LIB_RAND, RAND_R_RANDOM_POOL_IS_EMPTY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  435|      0|        return 0;
  436|      0|    }
  437|       |
  438|      1|    if (adin != NULL && adin_len > 0) {
  ------------------
  |  Branch (438:9): [True: 1, False: 0]
  |  Branch (438:25): [True: 1, False: 0]
  ------------------
  439|      1|        size_t i;
  440|       |
  441|       |        /* xor the additional data into the pool */
  442|      9|        for (i = 0; i < adin_len; ++i)
  ------------------
  |  Branch (442:21): [True: 8, False: 1]
  ------------------
  443|      8|            pool->buffer[i % pool->len] ^= adin[i];
  444|      1|    }
  445|       |
  446|      1|    return 1;
  447|      1|}
rand_pool.c:rand_pool_grow:
  200|      2|{
  201|      2|    if (len > pool->alloc_len - pool->len) {
  ------------------
  |  Branch (201:9): [True: 0, False: 2]
  ------------------
  202|      0|        unsigned char *p;
  203|      0|        const size_t limit = pool->max_len / 2;
  204|      0|        size_t newlen = pool->alloc_len;
  205|       |
  206|      0|        if (pool->attached || len > pool->max_len - pool->len) {
  ------------------
  |  Branch (206:13): [True: 0, False: 0]
  |  Branch (206:31): [True: 0, False: 0]
  ------------------
  207|      0|            ERR_raise(ERR_LIB_RAND, 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)
  |  |  ------------------
  ------------------
  208|      0|            return 0;
  209|      0|        }
  210|       |
  211|      0|        do
  212|      0|            newlen = newlen < limit ? newlen * 2 : pool->max_len;
  ------------------
  |  Branch (212:22): [True: 0, False: 0]
  ------------------
  213|      0|        while (len > newlen - pool->len);
  ------------------
  |  Branch (213:16): [True: 0, False: 0]
  ------------------
  214|       |
  215|      0|        if (pool->secure)
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            p = OPENSSL_secure_zalloc(newlen);
  ------------------
  |  |  125|      0|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  217|      0|        else
  218|      0|            p = OPENSSL_zalloc(newlen);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  219|      0|        if (p == NULL)
  ------------------
  |  Branch (219:13): [True: 0, False: 0]
  ------------------
  220|      0|            return 0;
  221|      0|        memcpy(p, pool->buffer, pool->len);
  222|      0|        if (pool->secure)
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  224|      0|        else
  225|      0|            OPENSSL_clear_free(pool->buffer, pool->alloc_len);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  226|      0|        pool->buffer = p;
  227|      0|        pool->alloc_len = newlen;
  228|      0|    }
  229|      2|    return 1;
  230|      2|}

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

PKCS1_MGF1:
  352|    402|{
  353|    402|    long i, outlen = 0;
  354|    402|    unsigned char cnt[4];
  355|    402|    EVP_MD_CTX *c = EVP_MD_CTX_new();
  356|    402|    unsigned char md[EVP_MAX_MD_SIZE];
  357|    402|    int mdlen;
  358|    402|    int rv = -1;
  359|       |
  360|    402|    if (c == NULL)
  ------------------
  |  Branch (360:9): [True: 0, False: 402]
  ------------------
  361|      0|        goto err;
  362|    402|    mdlen = EVP_MD_get_size(dgst);
  363|    402|    if (mdlen <= 0)
  ------------------
  |  Branch (363:9): [True: 0, False: 402]
  ------------------
  364|      0|        goto err;
  365|       |    /* step 4 */
  366|    938|    for (i = 0; outlen < len; i++) {
  ------------------
  |  Branch (366:17): [True: 536, False: 402]
  ------------------
  367|       |        /* step 4a: D = I2BS(counter, 4) */
  368|    536|        cnt[0] = (unsigned char)((i >> 24) & 255);
  369|    536|        cnt[1] = (unsigned char)((i >> 16) & 255);
  370|    536|        cnt[2] = (unsigned char)((i >> 8)) & 255;
  371|    536|        cnt[3] = (unsigned char)(i & 255);
  372|       |        /* step 4b: T =T || hash(mgfSeed || D) */
  373|    536|        if (!EVP_DigestInit_ex(c, dgst, NULL)
  ------------------
  |  Branch (373:13): [True: 0, False: 536]
  ------------------
  374|    536|            || !EVP_DigestUpdate(c, seed, seedlen)
  ------------------
  |  Branch (374:16): [True: 0, False: 536]
  ------------------
  375|    536|            || !EVP_DigestUpdate(c, cnt, 4))
  ------------------
  |  Branch (375:16): [True: 0, False: 536]
  ------------------
  376|      0|            goto err;
  377|    536|        if (outlen + mdlen <= len) {
  ------------------
  |  Branch (377:13): [True: 134, False: 402]
  ------------------
  378|    134|            if (!EVP_DigestFinal_ex(c, mask + outlen, NULL))
  ------------------
  |  Branch (378:17): [True: 0, False: 134]
  ------------------
  379|      0|                goto err;
  380|    134|            outlen += mdlen;
  381|    402|        } else {
  382|    402|            if (!EVP_DigestFinal_ex(c, md, NULL))
  ------------------
  |  Branch (382:17): [True: 0, False: 402]
  ------------------
  383|      0|                goto err;
  384|    402|            memcpy(mask + outlen, md, len - outlen);
  385|    402|            outlen = len;
  386|    402|        }
  387|    536|    }
  388|    402|    rv = 0;
  389|    402| err:
  390|    402|    OPENSSL_cleanse(md, sizeof(md));
  391|    402|    EVP_MD_CTX_free(c);
  392|    402|    return rv;
  393|    402|}

ossl_self_test_set_callback_new:
   35|      1|{
   36|      1|    SELF_TEST_CB *stcb;
   37|       |
   38|      1|    stcb = OPENSSL_zalloc(sizeof(*stcb));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   39|      1|    return stcb;
   40|      1|}
ossl_self_test_set_callback_free:
   43|      1|{
   44|      1|    OPENSSL_free(stcb);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   45|      1|}

SHA256_Init:
   43|   227M|{
   44|   227M|    memset(c, 0, sizeof(*c));
   45|   227M|    c->h[0] = 0x6a09e667UL;
   46|   227M|    c->h[1] = 0xbb67ae85UL;
   47|   227M|    c->h[2] = 0x3c6ef372UL;
   48|   227M|    c->h[3] = 0xa54ff53aUL;
   49|   227M|    c->h[4] = 0x510e527fUL;
   50|   227M|    c->h[5] = 0x9b05688cUL;
   51|   227M|    c->h[6] = 0x1f83d9abUL;
   52|   227M|    c->h[7] = 0x5be0cd19UL;
   53|   227M|    c->md_len = SHA256_DIGEST_LENGTH;
  ------------------
  |  |   86|   227M|# define SHA256_DIGEST_LENGTH    32
  ------------------
   54|   227M|    return 1;
   55|   227M|}

ossl_sha3_reset:
   19|   160M|{
   20|       |#if defined(__s390x__) && defined(OPENSSL_CPUID_OBJ)
   21|       |    if (!(OPENSSL_s390xcap_P.stfle[1] & S390X_CAPBIT(S390X_MSA12)))
   22|       |#endif
   23|   160M|        memset(ctx->A, 0, sizeof(ctx->A));
   24|   160M|    ctx->bufsz = 0;
   25|   160M|    ctx->xof_state = XOF_STATE_INIT;
  ------------------
  |  |   35|   160M|#define XOF_STATE_INIT    0
  ------------------
   26|   160M|}
ossl_sha3_init:
   29|    390|{
   30|    390|    size_t bsz = SHA3_BLOCKSIZE(bitlen);
  ------------------
  |  |   21|    390|# define SHA3_BLOCKSIZE(bitlen) (KECCAK1600_WIDTH - bitlen * 2) / 8
  |  |  ------------------
  |  |  |  |   18|    390|# define KECCAK1600_WIDTH 1600
  |  |  ------------------
  ------------------
   31|       |
   32|    390|    if (bsz <= sizeof(ctx->buf)) {
  ------------------
  |  Branch (32:9): [True: 390, False: 0]
  ------------------
   33|    390|        ossl_sha3_reset(ctx);
   34|    390|        ctx->block_size = bsz;
   35|    390|        ctx->md_size = bitlen / 8;
   36|    390|        ctx->pad = pad;
   37|    390|        return 1;
   38|    390|    }
   39|       |
   40|      0|    return 0;
   41|    390|}
ossl_keccak_init:
   44|    390|{
   45|    390|    int ret = ossl_sha3_init(ctx, pad, bitlen);
   46|       |
   47|    390|    if (ret)
  ------------------
  |  Branch (47:9): [True: 390, False: 0]
  ------------------
   48|    390|        ctx->md_size = mdlen / 8;
   49|    390|    return ret;
   50|    390|}
ossl_sha3_final:
  104|   160M|{
  105|   160M|    size_t bsz = ctx->block_size;
  106|   160M|    size_t num = ctx->bufsz;
  107|       |
  108|   160M|    if (outlen == 0)
  ------------------
  |  Branch (108:9): [True: 0, False: 160M]
  ------------------
  109|      0|        return 1;
  110|   160M|    if (ctx->xof_state == XOF_STATE_SQUEEZE
  ------------------
  |  |   38|   321M|#define XOF_STATE_SQUEEZE 3
  ------------------
  |  Branch (110:9): [True: 0, False: 160M]
  ------------------
  111|   160M|        || ctx->xof_state == XOF_STATE_FINAL)
  ------------------
  |  |   37|   160M|#define XOF_STATE_FINAL   2
  ------------------
  |  Branch (111:12): [True: 0, False: 160M]
  ------------------
  112|      0|        return 0;
  113|       |
  114|       |    /*
  115|       |     * Pad the data with 10*1. Note that |num| can be |bsz - 1|
  116|       |     * in which case both byte operations below are performed on
  117|       |     * same byte...
  118|       |     */
  119|   160M|    memset(ctx->buf + num, 0, bsz - num);
  120|   160M|    ctx->buf[num] = ctx->pad;
  121|   160M|    ctx->buf[bsz - 1] |= 0x80;
  122|       |
  123|   160M|    (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz);
  124|       |
  125|   160M|    ctx->xof_state = XOF_STATE_FINAL;
  ------------------
  |  |   37|   160M|#define XOF_STATE_FINAL   2
  ------------------
  126|   160M|    SHA3_squeeze(ctx->A, out, outlen, bsz, 0);
  127|   160M|    return 1;
  128|   160M|}

SHA512_Init:
  133|  14.9M|{
  134|  14.9M|    c->h[0] = U64(0x6a09e667f3bcc908);
  ------------------
  |  |   75|  14.9M|# define U64(C)     C##ULL
  ------------------
  135|  14.9M|    c->h[1] = U64(0xbb67ae8584caa73b);
  ------------------
  |  |   75|  14.9M|# define U64(C)     C##ULL
  ------------------
  136|  14.9M|    c->h[2] = U64(0x3c6ef372fe94f82b);
  ------------------
  |  |   75|  14.9M|# define U64(C)     C##ULL
  ------------------
  137|  14.9M|    c->h[3] = U64(0xa54ff53a5f1d36f1);
  ------------------
  |  |   75|  14.9M|# define U64(C)     C##ULL
  ------------------
  138|  14.9M|    c->h[4] = U64(0x510e527fade682d1);
  ------------------
  |  |   75|  14.9M|# define U64(C)     C##ULL
  ------------------
  139|  14.9M|    c->h[5] = U64(0x9b05688c2b3e6c1f);
  ------------------
  |  |   75|  14.9M|# define U64(C)     C##ULL
  ------------------
  140|  14.9M|    c->h[6] = U64(0x1f83d9abfb41bd6b);
  ------------------
  |  |   75|  14.9M|# define U64(C)     C##ULL
  ------------------
  141|  14.9M|    c->h[7] = U64(0x5be0cd19137e2179);
  ------------------
  |  |   75|  14.9M|# define U64(C)     C##ULL
  ------------------
  142|       |
  143|  14.9M|    c->Nl = 0;
  144|  14.9M|    c->Nh = 0;
  145|  14.9M|    c->num = 0;
  146|  14.9M|    c->md_len = SHA512_DIGEST_LENGTH;
  ------------------
  |  |   88|  14.9M|# define SHA512_DIGEST_LENGTH    64
  ------------------
  147|  14.9M|    return 1;
  148|  14.9M|}
SHA512_Final:
  160|  14.9M|{
  161|  14.9M|    unsigned char *p = (unsigned char *)c->u.p;
  162|  14.9M|    size_t n = c->num;
  163|       |
  164|  14.9M|    p[n] = 0x80;                /* There always is a room for one */
  165|  14.9M|    n++;
  166|  14.9M|    if (n > (sizeof(c->u) - 16)) {
  ------------------
  |  Branch (166:9): [True: 76.2k, False: 14.8M]
  ------------------
  167|  76.2k|        memset(p + n, 0, sizeof(c->u) - n);
  168|  76.2k|        n = 0;
  169|  76.2k|        sha512_block_data_order(c, p, 1);
  170|  76.2k|    }
  171|       |
  172|  14.9M|    memset(p + n, 0, sizeof(c->u) - 16 - n);
  173|       |#ifdef  B_ENDIAN
  174|       |    c->u.d[SHA_LBLOCK - 2] = c->Nh;
  175|       |    c->u.d[SHA_LBLOCK - 1] = c->Nl;
  176|       |#else
  177|  14.9M|    p[sizeof(c->u) - 1] = (unsigned char)(c->Nl);
  178|  14.9M|    p[sizeof(c->u) - 2] = (unsigned char)(c->Nl >> 8);
  179|  14.9M|    p[sizeof(c->u) - 3] = (unsigned char)(c->Nl >> 16);
  180|  14.9M|    p[sizeof(c->u) - 4] = (unsigned char)(c->Nl >> 24);
  181|  14.9M|    p[sizeof(c->u) - 5] = (unsigned char)(c->Nl >> 32);
  182|  14.9M|    p[sizeof(c->u) - 6] = (unsigned char)(c->Nl >> 40);
  183|  14.9M|    p[sizeof(c->u) - 7] = (unsigned char)(c->Nl >> 48);
  184|  14.9M|    p[sizeof(c->u) - 8] = (unsigned char)(c->Nl >> 56);
  185|  14.9M|    p[sizeof(c->u) - 9] = (unsigned char)(c->Nh);
  186|  14.9M|    p[sizeof(c->u) - 10] = (unsigned char)(c->Nh >> 8);
  187|  14.9M|    p[sizeof(c->u) - 11] = (unsigned char)(c->Nh >> 16);
  188|  14.9M|    p[sizeof(c->u) - 12] = (unsigned char)(c->Nh >> 24);
  189|  14.9M|    p[sizeof(c->u) - 13] = (unsigned char)(c->Nh >> 32);
  190|  14.9M|    p[sizeof(c->u) - 14] = (unsigned char)(c->Nh >> 40);
  191|  14.9M|    p[sizeof(c->u) - 15] = (unsigned char)(c->Nh >> 48);
  192|  14.9M|    p[sizeof(c->u) - 16] = (unsigned char)(c->Nh >> 56);
  193|  14.9M|#endif
  194|       |
  195|  14.9M|    sha512_block_data_order(c, p, 1);
  196|       |
  197|  14.9M|    if (md == 0)
  ------------------
  |  Branch (197:9): [True: 0, False: 14.9M]
  ------------------
  198|      0|        return 0;
  199|       |
  200|  14.9M|    switch (c->md_len) {
  201|       |    /* Let compiler decide if it's appropriate to unroll... */
  202|      0|    case SHA224_DIGEST_LENGTH:
  ------------------
  |  |   85|      0|# define SHA224_DIGEST_LENGTH    28
  ------------------
  |  Branch (202:5): [True: 0, False: 14.9M]
  ------------------
  203|      0|        for (n = 0; n < SHA224_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   85|      0|# define SHA224_DIGEST_LENGTH    28
  ------------------
  |  Branch (203:21): [True: 0, False: 0]
  ------------------
  204|      0|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|      0|#   define SHA_LONG64 unsigned long long
  ------------------
  205|       |
  206|      0|            *(md++) = (unsigned char)(t >> 56);
  207|      0|            *(md++) = (unsigned char)(t >> 48);
  208|      0|            *(md++) = (unsigned char)(t >> 40);
  209|      0|            *(md++) = (unsigned char)(t >> 32);
  210|      0|            *(md++) = (unsigned char)(t >> 24);
  211|      0|            *(md++) = (unsigned char)(t >> 16);
  212|      0|            *(md++) = (unsigned char)(t >> 8);
  213|      0|            *(md++) = (unsigned char)(t);
  214|      0|        }
  215|       |        /*
  216|       |         * For 224 bits, there are four bytes left over that have to be
  217|       |         * processed separately.
  218|       |         */
  219|      0|        {
  220|      0|            SHA_LONG64 t = c->h[SHA224_DIGEST_LENGTH / 8];
  ------------------
  |  |  107|      0|#   define SHA_LONG64 unsigned long long
  ------------------
                          SHA_LONG64 t = c->h[SHA224_DIGEST_LENGTH / 8];
  ------------------
  |  |   85|      0|# define SHA224_DIGEST_LENGTH    28
  ------------------
  221|       |
  222|      0|            *(md++) = (unsigned char)(t >> 56);
  223|      0|            *(md++) = (unsigned char)(t >> 48);
  224|      0|            *(md++) = (unsigned char)(t >> 40);
  225|      0|            *(md++) = (unsigned char)(t >> 32);
  226|      0|        }
  227|      0|        break;
  228|      0|    case SHA256_DIGEST_LENGTH:
  ------------------
  |  |   86|      0|# define SHA256_DIGEST_LENGTH    32
  ------------------
  |  Branch (228:5): [True: 0, False: 14.9M]
  ------------------
  229|      0|        for (n = 0; n < SHA256_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   86|      0|# define SHA256_DIGEST_LENGTH    32
  ------------------
  |  Branch (229:21): [True: 0, False: 0]
  ------------------
  230|      0|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|      0|#   define SHA_LONG64 unsigned long long
  ------------------
  231|       |
  232|      0|            *(md++) = (unsigned char)(t >> 56);
  233|      0|            *(md++) = (unsigned char)(t >> 48);
  234|      0|            *(md++) = (unsigned char)(t >> 40);
  235|      0|            *(md++) = (unsigned char)(t >> 32);
  236|      0|            *(md++) = (unsigned char)(t >> 24);
  237|      0|            *(md++) = (unsigned char)(t >> 16);
  238|      0|            *(md++) = (unsigned char)(t >> 8);
  239|      0|            *(md++) = (unsigned char)(t);
  240|      0|        }
  241|      0|        break;
  242|      0|    case SHA384_DIGEST_LENGTH:
  ------------------
  |  |   87|      0|# define SHA384_DIGEST_LENGTH    48
  ------------------
  |  Branch (242:5): [True: 0, False: 14.9M]
  ------------------
  243|      0|        for (n = 0; n < SHA384_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   87|      0|# define SHA384_DIGEST_LENGTH    48
  ------------------
  |  Branch (243:21): [True: 0, False: 0]
  ------------------
  244|      0|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|      0|#   define SHA_LONG64 unsigned long long
  ------------------
  245|       |
  246|      0|            *(md++) = (unsigned char)(t >> 56);
  247|      0|            *(md++) = (unsigned char)(t >> 48);
  248|      0|            *(md++) = (unsigned char)(t >> 40);
  249|      0|            *(md++) = (unsigned char)(t >> 32);
  250|      0|            *(md++) = (unsigned char)(t >> 24);
  251|      0|            *(md++) = (unsigned char)(t >> 16);
  252|      0|            *(md++) = (unsigned char)(t >> 8);
  253|      0|            *(md++) = (unsigned char)(t);
  254|      0|        }
  255|      0|        break;
  256|  14.9M|    case SHA512_DIGEST_LENGTH:
  ------------------
  |  |   88|  14.9M|# define SHA512_DIGEST_LENGTH    64
  ------------------
  |  Branch (256:5): [True: 14.9M, False: 0]
  ------------------
  257|   134M|        for (n = 0; n < SHA512_DIGEST_LENGTH / 8; n++) {
  ------------------
  |  |   88|   134M|# define SHA512_DIGEST_LENGTH    64
  ------------------
  |  Branch (257:21): [True: 119M, False: 14.9M]
  ------------------
  258|   119M|            SHA_LONG64 t = c->h[n];
  ------------------
  |  |  107|   119M|#   define SHA_LONG64 unsigned long long
  ------------------
  259|       |
  260|   119M|            *(md++) = (unsigned char)(t >> 56);
  261|   119M|            *(md++) = (unsigned char)(t >> 48);
  262|   119M|            *(md++) = (unsigned char)(t >> 40);
  263|   119M|            *(md++) = (unsigned char)(t >> 32);
  264|   119M|            *(md++) = (unsigned char)(t >> 24);
  265|   119M|            *(md++) = (unsigned char)(t >> 16);
  266|   119M|            *(md++) = (unsigned char)(t >> 8);
  267|   119M|            *(md++) = (unsigned char)(t);
  268|   119M|        }
  269|  14.9M|        break;
  270|       |    /* ... as well as make sure md_len is not abused. */
  271|      0|    default:
  ------------------
  |  Branch (271:5): [True: 0, False: 14.9M]
  ------------------
  272|      0|        return 0;
  273|  14.9M|    }
  274|       |
  275|  14.9M|    return 1;
  276|  14.9M|}
SHA512_Update:
  284|  59.7M|{
  285|  59.7M|    SHA_LONG64 l;
  ------------------
  |  |  107|  59.7M|#   define SHA_LONG64 unsigned long long
  ------------------
  286|  59.7M|    unsigned char *p = c->u.p;
  287|  59.7M|    const unsigned char *data = (const unsigned char *)_data;
  288|       |
  289|  59.7M|    if (len == 0)
  ------------------
  |  Branch (289:9): [True: 0, False: 59.7M]
  ------------------
  290|      0|        return 1;
  291|       |
  292|  59.7M|    l = (c->Nl + (((SHA_LONG64) len) << 3)) & U64(0xffffffffffffffff);
  ------------------
  |  |   75|  59.7M|# define U64(C)     C##ULL
  ------------------
  293|  59.7M|    if (l < c->Nl)
  ------------------
  |  Branch (293:9): [True: 0, False: 59.7M]
  ------------------
  294|      0|        c->Nh++;
  295|  59.7M|    if (sizeof(len) >= 8)
  ------------------
  |  Branch (295:9): [Folded - Ignored]
  ------------------
  296|  59.7M|        c->Nh += (((SHA_LONG64) len) >> 61);
  297|  59.7M|    c->Nl = l;
  298|       |
  299|  59.7M|    if (c->num != 0) {
  ------------------
  |  Branch (299:9): [True: 29.8M, False: 29.8M]
  ------------------
  300|  29.8M|        size_t n = sizeof(c->u) - c->num;
  301|       |
  302|  29.8M|        if (len < n) {
  ------------------
  |  Branch (302:13): [True: 14.7M, False: 15.0M]
  ------------------
  303|  14.7M|            memcpy(p + c->num, data, len), c->num += (unsigned int)len;
  304|  14.7M|            return 1;
  305|  15.0M|        } else {
  306|  15.0M|            memcpy(p + c->num, data, n), c->num = 0;
  307|  15.0M|            len -= n, data += n;
  308|  15.0M|            sha512_block_data_order(c, p, 1);
  309|  15.0M|        }
  310|  29.8M|    }
  311|       |
  312|  44.9M|    if (len >= sizeof(c->u)) {
  ------------------
  |  Branch (312:9): [True: 150k, False: 44.7M]
  ------------------
  313|       |#ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
  314|       |        if ((size_t)data % sizeof(c->u.d[0]) != 0)
  315|       |            while (len >= sizeof(c->u))
  316|       |                memcpy(p, data, sizeof(c->u)),
  317|       |                sha512_block_data_order(c, p, 1),
  318|       |                len -= sizeof(c->u), data += sizeof(c->u);
  319|       |        else
  320|       |#endif
  321|   150k|            sha512_block_data_order(c, data, len / sizeof(c->u)),
  322|   150k|            data += len, len %= sizeof(c->u), data -= len;
  323|   150k|    }
  324|       |
  325|  44.9M|    if (len != 0)
  ------------------
  |  Branch (325:9): [True: 30.0M, False: 14.9M]
  ------------------
  326|  30.0M|        memcpy(p, data, len), c->num = (int)len;
  327|       |
  328|  44.9M|    return 1;
  329|  59.7M|}

ossl_slh_get_adrs_fn:
  154|    639|{
  155|    639|    static const SLH_ADRS_FUNC methods[] = {
  156|    639|        {
  157|    639|            slh_adrs_set_layer_address,
  158|    639|            slh_adrs_set_tree_address,
  159|    639|            slh_adrs_set_type_and_clear,
  160|    639|            slh_adrs_set_keypair_address,
  161|    639|            slh_adrs_copy_keypair_address,
  162|    639|            slh_adrs_set_chain_address,
  163|    639|            slh_adrs_set_tree_height,
  ------------------
  |  |   38|    639|#define slh_adrs_set_tree_height slh_adrs_set_chain_address
  ------------------
  164|    639|            slh_adrs_set_hash_address,
  165|    639|            slh_adrs_set_tree_index,
  ------------------
  |  |   39|    639|#define slh_adrs_set_tree_index slh_adrs_set_hash_address
  ------------------
  166|    639|            slh_adrs_zero,
  167|    639|            slh_adrs_copy,
  168|    639|        },
  169|    639|        {
  170|    639|            slh_adrsc_set_layer_address,
  171|    639|            slh_adrsc_set_tree_address,
  172|    639|            slh_adrsc_set_type_and_clear,
  173|    639|            slh_adrsc_set_keypair_address,
  174|    639|            slh_adrsc_copy_keypair_address,
  175|    639|            slh_adrsc_set_chain_address,
  176|    639|            slh_adrsc_set_tree_height,
  ------------------
  |  |   41|    639|#define slh_adrsc_set_tree_height slh_adrsc_set_chain_address
  ------------------
  177|    639|            slh_adrsc_set_hash_address,
  178|    639|            slh_adrsc_set_tree_index,
  ------------------
  |  |   42|    639|#define slh_adrsc_set_tree_index slh_adrsc_set_hash_address
  ------------------
  179|    639|            slh_adrsc_zero,
  180|    639|            slh_adrsc_copy,
  181|    639|        }
  182|    639|    };
  183|    639|    return &methods[is_compressed == 0 ? 0 : 1];
  ------------------
  |  Branch (183:21): [True: 224, False: 415]
  ------------------
  184|    639|}
slh_adrs.c:slh_adrs_set_layer_address:
   69|  3.57k|{
   70|  3.57k|    OPENSSL_store_u32_be(adrs + SLH_ADRS_OFF_LAYER_ADR, layer);
  ------------------
  |  |   14|  3.57k|#define SLH_ADRS_OFF_LAYER_ADR      0
  ------------------
   71|  3.57k|}
slh_adrs.c:slh_adrs_set_tree_address:
   73|  3.61k|{
   74|       |    /*
   75|       |     * There are 12 bytes reserved for this - but the largest number
   76|       |     * used by the parameter sets is only 64 bits. Because this is BE the
   77|       |     * first 4 of the 12 bytes will be zeros. This assumes that the 4 bytes
   78|       |     * are zero initially.
   79|       |     */
   80|  3.61k|    OPENSSL_store_u64_be(adrs + SLH_ADRS_OFF_TREE_ADR + 4, address);
  ------------------
  |  |   15|  3.61k|#define SLH_ADRS_OFF_TREE_ADR       4
  ------------------
   81|  3.61k|}
slh_adrs.c:slh_adrs_set_type_and_clear:
   83|  12.7M|{
   84|  12.7M|    OPENSSL_store_u32_be(adrs + SLH_ADRS_OFF_TYPE, type);
  ------------------
  |  |   16|  12.7M|#define SLH_ADRS_OFF_TYPE           16
  ------------------
   85|  12.7M|    memset(adrs + SLH_ADRS_OFF_TYPE + SLH_ADRS_SIZE_TYPE, 0, SLH_ADRS_SIZE_TYPECLEAR);
  ------------------
  |  |   16|  12.7M|#define SLH_ADRS_OFF_TYPE           16
  ------------------
                  memset(adrs + SLH_ADRS_OFF_TYPE + SLH_ADRS_SIZE_TYPE, 0, SLH_ADRS_SIZE_TYPECLEAR);
  ------------------
  |  |   21|  12.7M|#define SLH_ADRS_SIZE_TYPE          4
  ------------------
                  memset(adrs + SLH_ADRS_OFF_TYPE + SLH_ADRS_SIZE_TYPE, 0, SLH_ADRS_SIZE_TYPECLEAR);
  ------------------
  |  |   23|  12.7M|#define SLH_ADRS_SIZE_TYPECLEAR     SLH_ADRS_SIZE - (SLH_ADRS_OFF_TYPE + SLH_ADRS_SIZE_TYPE)
  |  |  ------------------
  |  |  |  |   23|  12.7M|#define SLH_ADRS_SIZE     32 /* size of the ADRS blob */
  |  |  ------------------
  |  |               #define SLH_ADRS_SIZE_TYPECLEAR     SLH_ADRS_SIZE - (SLH_ADRS_OFF_TYPE + SLH_ADRS_SIZE_TYPE)
  |  |  ------------------
  |  |  |  |   16|  12.7M|#define SLH_ADRS_OFF_TYPE           16
  |  |  ------------------
  |  |               #define SLH_ADRS_SIZE_TYPECLEAR     SLH_ADRS_SIZE - (SLH_ADRS_OFF_TYPE + SLH_ADRS_SIZE_TYPE)
  |  |  ------------------
  |  |  |  |   21|  12.7M|#define SLH_ADRS_SIZE_TYPE          4
  |  |  ------------------
  ------------------
   86|  12.7M|}
slh_adrs.c:slh_adrs_set_keypair_address:
   88|   144k|{
   89|   144k|    OPENSSL_store_u32_be(adrs + SLH_ADRS_OFF_KEYPAIR_ADDR, in);
  ------------------
  |  |   17|   144k|#define SLH_ADRS_OFF_KEYPAIR_ADDR   20
  ------------------
   90|   144k|}
slh_adrs.c:slh_adrs_copy_keypair_address:
   92|  12.4M|{
   93|  12.4M|    memcpy(dst + SLH_ADRS_OFF_KEYPAIR_ADDR, src + SLH_ADRS_OFF_KEYPAIR_ADDR,
  ------------------
  |  |   17|  12.4M|#define SLH_ADRS_OFF_KEYPAIR_ADDR   20
  ------------------
                  memcpy(dst + SLH_ADRS_OFF_KEYPAIR_ADDR, src + SLH_ADRS_OFF_KEYPAIR_ADDR,
  ------------------
  |  |   17|  12.4M|#define SLH_ADRS_OFF_KEYPAIR_ADDR   20
  ------------------
   94|  12.4M|           SLH_ADRS_SIZE_KEYPAIR_ADDR);
  ------------------
  |  |   24|  12.4M|#define SLH_ADRS_SIZE_KEYPAIR_ADDR  4
  ------------------
   95|  12.4M|}
slh_adrs.c:slh_adrs_set_chain_address:
   97|  40.0M|{
   98|  40.0M|    OPENSSL_store_u32_be(adrs + SLH_ADRS_OFF_CHAIN_ADDR, in);
  ------------------
  |  |   18|  40.0M|#define SLH_ADRS_OFF_CHAIN_ADDR     24
  ------------------
   99|  40.0M|}
slh_adrs.c:slh_adrs_set_hash_address:
  101|   152M|{
  102|   152M|    OPENSSL_store_u32_be(adrs + SLH_ADRS_OFF_HASH_ADDR, in);
  ------------------
  |  |   19|   152M|#define SLH_ADRS_OFF_HASH_ADDR      28
  ------------------
  103|   152M|}
slh_adrs.c:slh_adrs_zero:
  105|    590|{
  106|    590|    memset(adrs, 0, SLH_ADRS_SIZE);
  ------------------
  |  |   23|    590|#define SLH_ADRS_SIZE     32 /* size of the ADRS blob */
  ------------------
  107|    590|}
slh_adrs.c:slh_adrs_copy:
  109|  12.4M|{
  110|  12.4M|    memcpy(dst, src, SLH_ADRS_SIZE);
  ------------------
  |  |   23|  12.4M|#define SLH_ADRS_SIZE     32 /* size of the ADRS blob */
  ------------------
  111|  12.4M|}
slh_adrs.c:slh_adrsc_set_layer_address:
  115|  7.13k|{
  116|  7.13k|    adrsc[SLH_ADRSC_OFF_LAYER_ADR] = (uint8_t)layer;
  ------------------
  |  |   27|  7.13k|#define SLH_ADRSC_OFF_LAYER_ADR     0
  ------------------
  117|  7.13k|}
slh_adrs.c:slh_adrsc_set_tree_address:
  119|  7.22k|{
  120|  7.22k|    OPENSSL_store_u64_be(adrsc + SLH_ADRSC_OFF_TREE_ADR, in);
  ------------------
  |  |   28|  7.22k|#define SLH_ADRSC_OFF_TREE_ADR      1
  ------------------
  121|  7.22k|}
slh_adrs.c:slh_adrsc_set_type_and_clear:
  123|  16.6M|{
  124|  16.6M|    adrsc[SLH_ADRSC_OFF_TYPE] = (uint8_t)type;
  ------------------
  |  |   29|  16.6M|#define SLH_ADRSC_OFF_TYPE          9
  ------------------
  125|  16.6M|    memset(adrsc + SLH_ADRSC_OFF_TYPE + SLH_ADRSC_SIZE_TYPE, 0, SLH_ADRSC_SIZE_TYPECLEAR);
  ------------------
  |  |   29|  16.6M|#define SLH_ADRSC_OFF_TYPE          9
  ------------------
                  memset(adrsc + SLH_ADRSC_OFF_TYPE + SLH_ADRSC_SIZE_TYPE, 0, SLH_ADRSC_SIZE_TYPECLEAR);
  ------------------
  |  |   34|  16.6M|#define SLH_ADRSC_SIZE_TYPE         1
  ------------------
                  memset(adrsc + SLH_ADRSC_OFF_TYPE + SLH_ADRSC_SIZE_TYPE, 0, SLH_ADRSC_SIZE_TYPECLEAR);
  ------------------
  |  |   35|  16.6M|#define SLH_ADRSC_SIZE_TYPECLEAR    SLH_ADRS_SIZE_TYPECLEAR
  |  |  ------------------
  |  |  |  |   23|  16.6M|#define SLH_ADRS_SIZE_TYPECLEAR     SLH_ADRS_SIZE - (SLH_ADRS_OFF_TYPE + SLH_ADRS_SIZE_TYPE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  16.6M|#define SLH_ADRS_SIZE     32 /* size of the ADRS blob */
  |  |  |  |  ------------------
  |  |  |  |               #define SLH_ADRS_SIZE_TYPECLEAR     SLH_ADRS_SIZE - (SLH_ADRS_OFF_TYPE + SLH_ADRS_SIZE_TYPE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  16.6M|#define SLH_ADRS_OFF_TYPE           16
  |  |  |  |  ------------------
  |  |  |  |               #define SLH_ADRS_SIZE_TYPECLEAR     SLH_ADRS_SIZE - (SLH_ADRS_OFF_TYPE + SLH_ADRS_SIZE_TYPE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  16.6M|#define SLH_ADRS_SIZE_TYPE          4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  126|  16.6M|}
slh_adrs.c:slh_adrsc_set_keypair_address:
  128|   251k|{
  129|   251k|    OPENSSL_store_u32_be(adrsc + SLH_ADRSC_OFF_KEYPAIR_ADDR, in);
  ------------------
  |  |   30|   251k|#define SLH_ADRSC_OFF_KEYPAIR_ADDR  10
  ------------------
  130|   251k|}
slh_adrs.c:slh_adrsc_copy_keypair_address:
  132|  16.2M|{
  133|  16.2M|    memcpy(dst + SLH_ADRSC_OFF_KEYPAIR_ADDR, src + SLH_ADRSC_OFF_KEYPAIR_ADDR,
  ------------------
  |  |   30|  16.2M|#define SLH_ADRSC_OFF_KEYPAIR_ADDR  10
  ------------------
                  memcpy(dst + SLH_ADRSC_OFF_KEYPAIR_ADDR, src + SLH_ADRSC_OFF_KEYPAIR_ADDR,
  ------------------
  |  |   30|  16.2M|#define SLH_ADRSC_OFF_KEYPAIR_ADDR  10
  ------------------
  134|  16.2M|           SLH_ADRSC_SIZE_KEYPAIR_ADDR);
  ------------------
  |  |   36|  16.2M|#define SLH_ADRSC_SIZE_KEYPAIR_ADDR SLH_ADRS_SIZE_KEYPAIR_ADDR
  |  |  ------------------
  |  |  |  |   24|  16.2M|#define SLH_ADRS_SIZE_KEYPAIR_ADDR  4
  |  |  ------------------
  ------------------
  135|  16.2M|}
slh_adrs.c:slh_adrsc_set_chain_address:
  137|  56.2M|{
  138|  56.2M|    OPENSSL_store_u32_be(adrsc + SLH_ADRSC_OFF_CHAIN_ADDR, in);
  ------------------
  |  |   31|  56.2M|#define SLH_ADRSC_OFF_CHAIN_ADDR    14
  ------------------
  139|  56.2M|}
slh_adrs.c:slh_adrsc_set_hash_address:
  141|   230M|{
  142|   230M|    OPENSSL_store_u32_be(adrsc + SLH_ADRSC_OFF_HASH_ADDR, in);
  ------------------
  |  |   32|   230M|#define SLH_ADRSC_OFF_HASH_ADDR     18
  ------------------
  143|   230M|}
slh_adrs.c:slh_adrsc_zero:
  145|  1.12k|{
  146|  1.12k|    memset(adrsc, 0, SLH_ADRSC_SIZE);
  ------------------
  |  |   24|  1.12k|#define SLH_ADRSC_SIZE    22 /* size of a compact ADRS blob */
  ------------------
  147|  1.12k|}
slh_adrs.c:slh_adrsc_copy:
  149|  16.2M|{
  150|  16.2M|    memcpy(dst, src, SLH_ADRSC_SIZE);
  ------------------
  |  |   24|  16.2M|#define SLH_ADRSC_SIZE    22 /* size of a compact ADRS blob */
  ------------------
  151|  16.2M|}

ossl_slh_dsa_sign:
  272|    612|{
  273|    612|    uint8_t m_tmp[1024], *m = m_tmp;
  274|    612|    size_t m_len = 0;
  275|    612|    int ret = 0;
  276|       |
  277|    612|    if (sig != NULL) {
  ------------------
  |  Branch (277:9): [True: 306, False: 306]
  ------------------
  278|    306|        m = msg_encode(msg, msg_len, ctx, ctx_len, encode, m_tmp, sizeof(m_tmp),
  279|    306|                       &m_len);
  280|    306|        if (m == NULL)
  ------------------
  |  Branch (280:13): [True: 0, False: 306]
  ------------------
  281|      0|            return 0;
  282|    306|    }
  283|    612|    ret = slh_sign_internal(slh_ctx, m, m_len, sig, siglen, sigsize, add_rand);
  284|    612|    if (m != msg && m != m_tmp)
  ------------------
  |  Branch (284:9): [True: 600, False: 12]
  |  Branch (284:21): [True: 133, False: 467]
  ------------------
  285|    133|        OPENSSL_free(m);
  ------------------
  |  |  115|    133|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    133|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    133|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  286|    612|    return ret;
  287|    612|}
ossl_slh_dsa_verify:
  297|    306|{
  298|    306|    uint8_t *m;
  299|    306|    size_t m_len;
  300|    306|    uint8_t m_tmp[1024];
  301|    306|    int ret = 0;
  302|       |
  303|    306|    m = msg_encode(msg, msg_len, ctx, ctx_len, encode, m_tmp, sizeof(m_tmp),
  304|    306|                   &m_len);
  305|    306|    if (m == NULL)
  ------------------
  |  Branch (305:9): [True: 0, False: 306]
  ------------------
  306|      0|        return 0;
  307|       |
  308|    306|    ret = slh_verify_internal(slh_ctx, m, m_len, sig, sig_len);
  309|    306|    if (m != msg && m != m_tmp)
  ------------------
  |  Branch (309:9): [True: 294, False: 12]
  |  Branch (309:21): [True: 133, False: 161]
  ------------------
  310|    133|        OPENSSL_free(m);
  ------------------
  |  |  115|    133|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    133|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    133|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  311|    306|    return ret;
  312|    306|}
slh_dsa.c:msg_encode:
  234|    612|{
  235|    612|    uint8_t *encoded = NULL;
  236|    612|    size_t encoded_len;
  237|       |
  238|    612|    if (encode == 0) {
  ------------------
  |  Branch (238:9): [True: 24, False: 588]
  ------------------
  239|       |        /* Raw message */
  240|     24|        *out_len = msg_len;
  241|     24|        return (uint8_t *)msg;
  242|     24|    }
  243|    588|    if (ctx_len > SLH_DSA_MAX_CONTEXT_STRING_LEN)
  ------------------
  |  |   20|    588|# define SLH_DSA_MAX_CONTEXT_STRING_LEN 255
  ------------------
  |  Branch (243:9): [True: 0, False: 588]
  ------------------
  244|      0|        return NULL;
  245|       |
  246|       |    /* Pure encoding */
  247|    588|    encoded_len = 1 + 1 + ctx_len + msg_len;
  248|    588|    *out_len = encoded_len;
  249|    588|    if (encoded_len <= tmp_len) {
  ------------------
  |  Branch (249:9): [True: 322, False: 266]
  ------------------
  250|    322|        encoded = tmp;
  251|    322|    } else {
  252|    266|        encoded = OPENSSL_zalloc(encoded_len);
  ------------------
  |  |  104|    266|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    266|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    266|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  253|    266|        if (encoded == NULL)
  ------------------
  |  Branch (253:13): [True: 0, False: 266]
  ------------------
  254|      0|            return NULL;
  255|    266|    }
  256|    588|    encoded[0] = 0;
  257|    588|    encoded[1] = (uint8_t)ctx_len;
  258|    588|    memcpy(&encoded[2], ctx, ctx_len);
  259|    588|    memcpy(&encoded[2 + ctx_len], msg, msg_len);
  260|    588|    return encoded;
  261|    588|}
slh_dsa.c:slh_sign_internal:
   46|    612|{
   47|    612|    int ret = 0;
   48|    612|    const SLH_DSA_KEY *priv = hctx->key;
   49|    612|    const SLH_DSA_PARAMS *params = priv->params;
   50|    612|    size_t sig_len_expected = params->sig_len;
   51|    612|    uint8_t m_digest[SLH_MAX_M];
   52|    612|    const uint8_t *md; /* The first md_len bytes of m_digest */
   53|    612|    size_t md_len = MD_LEN(params); /* The size of the digest |md| */
  ------------------
  |  |   18|    612|#define MD_LEN(params) (((params)->k * (params)->a + 7) >> 3)
  ------------------
   54|       |    /* Points to |m_digest| buffer, it is also reused to point to |sig_fors| */
   55|    612|    PACKET r_packet, *rpkt = &r_packet;
   56|    612|    uint8_t *r, *sig_fors; /* Pointers into buffer inside |wpkt| */
   57|    612|    WPACKET w_packet, *wpkt = &w_packet; /* Points to output |sig| buffer */
   58|    612|    const uint8_t *pk_seed, *sk_seed; /* pointers to elements within |priv| */
   59|    612|    uint8_t pk_fors[SLH_MAX_N];
   60|    612|    uint64_t tree_id;
   61|    612|    uint32_t leaf_id;
   62|       |
   63|    612|    SLH_ADRS_DECLARE(adrs);
  ------------------
  |  |   36|    612|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
   64|    612|    SLH_HASH_FUNC_DECLARE(priv, hashf);
  ------------------
  |  |   19|    612|    const SLH_HASH_FUNC *hashf = ctx->hash_func       \
  ------------------
   65|    612|    SLH_ADRS_FUNC_DECLARE(priv, adrsf);
  ------------------
  |  |   38|    612|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
   66|       |
   67|    612|    if (sig == NULL) {
  ------------------
  |  Branch (67:9): [True: 306, False: 306]
  ------------------
   68|    306|        *sig_len = sig_len_expected;
   69|    306|        return 1;
   70|    306|    }
   71|       |
   72|    306|    if (sig_size < sig_len_expected) {
  ------------------
  |  Branch (72:9): [True: 0, False: 306]
  ------------------
   73|      0|        ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_SIGNATURE_SIZE,
  ------------------
  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  ------------------
  |  |  |  |  303|      0|#   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_PROV, PROV_R_INVALID_SIGNATURE_SIZE,
  ------------------
  |  |  118|      0|# define ERR_LIB_PROV            57
  ------------------
                      ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_SIGNATURE_SIZE,
  ------------------
  |  |   85|      0|# define PROV_R_INVALID_SIGNATURE_SIZE                    179
  ------------------
   74|      0|                       "is %zu, should be at least %zu", sig_size, sig_len_expected);
   75|      0|        return 0;
   76|      0|    }
   77|       |    /* Exit if private key is not set */
   78|    306|    if (priv->has_priv == 0) {
  ------------------
  |  Branch (78:9): [True: 0, False: 306]
  ------------------
   79|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|       |
   83|    306|    if (!WPACKET_init_static_len(wpkt, sig, sig_len_expected, 0))
  ------------------
  |  Branch (83:9): [True: 0, False: 306]
  ------------------
   84|      0|        return 0;
   85|    306|    if (!PACKET_buf_init(rpkt, m_digest, params->m))
  ------------------
  |  Branch (85:9): [True: 0, False: 306]
  ------------------
   86|      0|        return 0;
   87|       |
   88|    306|    pk_seed = SLH_DSA_PK_SEED(priv);
  ------------------
  |  |   15|    306|#define SLH_DSA_PK_SEED(key) ((key)->priv + (key)->params->n * 2)
  ------------------
   89|    306|    sk_seed = SLH_DSA_SK_SEED(priv);
  ------------------
  |  |   13|    306|#define SLH_DSA_SK_SEED(key) ((key)->priv)
  ------------------
   90|       |
   91|    306|    if (opt_rand == NULL)
  ------------------
  |  Branch (91:9): [True: 36, False: 270]
  ------------------
   92|     36|        opt_rand = pk_seed;
   93|       |
   94|    306|    adrsf->zero(adrs);
   95|       |    /* calculate Randomness value r, and output to the SLH-DSA signature */
   96|    306|    r = WPACKET_get_curr(wpkt);
   97|    306|    if (!hashf->PRF_MSG(hctx, SLH_DSA_SK_PRF(priv), opt_rand, msg, msg_len, wpkt)
  ------------------
  |  |   14|    306|#define SLH_DSA_SK_PRF(key)  ((key)->priv + (key)->params->n)
  ------------------
  |  Branch (97:9): [True: 0, False: 306]
  ------------------
   98|       |            /* generate a digest of size |params->m| bytes where m is (30..49) */
   99|    306|            || !hashf->H_MSG(hctx, r, pk_seed, SLH_DSA_PK_ROOT(priv), msg, msg_len,
  ------------------
  |  |   16|    306|#define SLH_DSA_PK_ROOT(key) ((key)->priv + (key)->params->n * 3)
  ------------------
  |  Branch (99:16): [True: 0, False: 306]
  ------------------
  100|    306|                             m_digest, sizeof(m_digest))
  101|       |            /* Grab the first md_len bytes of m_digest to use in fors_sign() */
  102|    306|            || !PACKET_get_bytes(rpkt, &md, md_len)
  ------------------
  |  Branch (102:16): [True: 0, False: 306]
  ------------------
  103|       |            /* Grab remaining bytes from m_digest to select tree and leaf id's */
  104|    306|            || !get_tree_ids(rpkt, params, &tree_id, &leaf_id))
  ------------------
  |  Branch (104:16): [True: 0, False: 306]
  ------------------
  105|      0|        goto err;
  106|       |
  107|    306|    adrsf->set_tree_address(adrs, tree_id);
  108|    306|    adrsf->set_type_and_clear(adrs, SLH_ADRS_TYPE_FORS_TREE);
  ------------------
  |  |   31|    306|#define SLH_ADRS_TYPE_FORS_TREE  3
  ------------------
  109|    306|    adrsf->set_keypair_address(adrs, leaf_id);
  110|       |
  111|    306|    sig_fors = WPACKET_get_curr(wpkt);
  112|       |    /* generate the FORS signature and append it to the SLH-DSA signature */
  113|    306|    ret = ossl_slh_fors_sign(hctx, md, sk_seed, pk_seed, adrs, wpkt)
  ------------------
  |  Branch (113:11): [True: 306, False: 0]
  ------------------
  114|       |        /* Reuse rpkt to point to the FORS signature that was just generated */
  115|    306|        && PACKET_buf_init(rpkt, sig_fors, WPACKET_get_curr(wpkt) - sig_fors)
  ------------------
  |  Branch (115:12): [True: 306, False: 0]
  ------------------
  116|       |        /* Calculate the FORS public key using the generated FORS signature */
  117|    306|        && ossl_slh_fors_pk_from_sig(hctx, rpkt, md, pk_seed, adrs,
  ------------------
  |  Branch (117:12): [True: 306, False: 0]
  ------------------
  118|    306|                                     pk_fors, sizeof(pk_fors))
  119|       |        /* Generate ht signature and append to the SLH-DSA signature */
  120|    306|        && ossl_slh_ht_sign(hctx, pk_fors, sk_seed, pk_seed, tree_id, leaf_id,
  ------------------
  |  Branch (120:12): [True: 306, False: 0]
  ------------------
  121|    306|                            wpkt);
  122|    306|    *sig_len = sig_len_expected;
  123|    306|    ret = 1;
  124|    306| err:
  125|    306|    if (!WPACKET_finish(wpkt))
  ------------------
  |  Branch (125:9): [True: 0, False: 306]
  ------------------
  126|      0|        ret = 0;
  127|    306|    return ret;
  128|    306|}
slh_dsa.c:get_tree_ids:
  336|    612|{
  337|    612|    const uint8_t *tree_id_bytes, *leaf_id_bytes;
  338|    612|    uint32_t tree_id_len, leaf_id_len;
  339|    612|    uint64_t tree_id_mask, leaf_id_mask;
  340|       |
  341|    612|    tree_id_len = ((params->h - params->hm + 7) >> 3); /* 7 or 8 bytes */
  342|    612|    leaf_id_len = ((params->hm + 7) >> 3); /* 1 or 2 bytes */
  343|       |
  344|    612|    if (!PACKET_get_bytes(rpkt, &tree_id_bytes, tree_id_len)
  ------------------
  |  Branch (344:9): [True: 0, False: 612]
  ------------------
  345|    612|            || !PACKET_get_bytes(rpkt, &leaf_id_bytes, leaf_id_len))
  ------------------
  |  Branch (345:16): [True: 0, False: 612]
  ------------------
  346|      0|        return 0;
  347|       |
  348|       |    /*
  349|       |     * In order to calculate A mod (2^X) where X is in the range of (54..64)
  350|       |     * This is equivalent to A & (2^x - 1) which is just a sequence of X ones
  351|       |     * that must fit into a 64 bit value.
  352|       |     * e.g when X = 64 it would be A & (0xFFFF_FFFF_FFFF_FFFF)
  353|       |     *     when X = 54 it would be A & (0x3F_FFFF_FFFF_FFFF)
  354|       |     * i.e. A & (0xFFFF_FFFF_FFFF_FFFF >> (64 - X))
  355|       |     */
  356|    612|    tree_id_mask = (~(uint64_t)0) >> (64 - (params->h - params->hm));
  357|    612|    leaf_id_mask = ((uint64_t)1 << params->hm) - 1; /* max value is 0x1FF when hm = 9 */
  358|    612|    *tree_id = bytes_to_u64_be(tree_id_bytes, tree_id_len) & tree_id_mask;
  359|    612|    *leaf_id = (uint32_t)(bytes_to_u64_be(leaf_id_bytes, leaf_id_len) & leaf_id_mask);
  360|    612|    return 1;
  361|    612|}
slh_dsa.c:bytes_to_u64_be:
  319|  1.22k|{
  320|       |
  321|  1.22k|    size_t i;
  322|  1.22k|    uint64_t total = 0;
  323|       |
  324|  6.62k|    for (i = 0; i < in_len; i++)
  ------------------
  |  Branch (324:17): [True: 5.40k, False: 1.22k]
  ------------------
  325|  5.40k|        total = (total << 8) + *in++;
  326|  1.22k|    return total;
  327|  1.22k|}
slh_dsa.c:slh_verify_internal:
  150|    306|{
  151|    306|    const SLH_DSA_KEY *pub = hctx->key;
  152|    306|    SLH_HASH_FUNC_DECLARE(pub, hashf);
  ------------------
  |  |   19|    306|    const SLH_HASH_FUNC *hashf = ctx->hash_func       \
  ------------------
  153|    306|    SLH_ADRS_FUNC_DECLARE(pub, adrsf);
  ------------------
  |  |   38|    306|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
  154|    306|    SLH_ADRS_DECLARE(adrs);
  ------------------
  |  |   36|    306|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
  155|    306|    const SLH_DSA_PARAMS *params = pub->params;
  156|    306|    uint32_t n = params->n;
  157|    306|    const uint8_t *pk_seed, *pk_root; /* Pointers to elements in |pub| */
  158|    306|    PACKET pkt, *sig_rpkt = &pkt; /* Points to the |sig| buffer */
  159|    306|    uint8_t m_digest[SLH_MAX_M];
  160|    306|    const uint8_t *md; /* This is a pointer into the buffer in m_digest_rpkt */
  161|    306|    size_t md_len = MD_LEN(params); /* 21..40 bytes */
  ------------------
  |  |   18|    306|#define MD_LEN(params) (((params)->k * (params)->a + 7) >> 3)
  ------------------
  162|    306|    PACKET pkt2, *m_digest_rpkt = &pkt2; /* Points to m_digest buffer */
  163|    306|    const uint8_t *r; /* Pointer to |sig_rpkt| buffer */
  164|    306|    uint8_t pk_fors[SLH_MAX_N];
  165|    306|    uint64_t tree_id;
  166|    306|    uint32_t leaf_id;
  167|       |
  168|       |    /* Exit if public key is not set */
  169|    306|    if (pub->pub == NULL) {
  ------------------
  |  Branch (169:9): [True: 0, False: 306]
  ------------------
  170|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_KEY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  171|      0|        return 0;
  172|      0|    }
  173|       |
  174|       |    /* Exit if signature is invalid size */
  175|    306|    if (sig_len != params->sig_len
  ------------------
  |  Branch (175:9): [True: 0, False: 306]
  ------------------
  176|    306|            || !PACKET_buf_init(sig_rpkt, sig, sig_len))
  ------------------
  |  Branch (176:16): [True: 0, False: 306]
  ------------------
  177|      0|        return 0;
  178|    306|    if (!PACKET_get_bytes(sig_rpkt, &r, n))
  ------------------
  |  Branch (178:9): [True: 0, False: 306]
  ------------------
  179|      0|        return 0;
  180|       |
  181|    306|    adrsf->zero(adrs);
  182|       |
  183|    306|    pk_seed = SLH_DSA_PK_SEED(pub);
  ------------------
  |  |   15|    306|#define SLH_DSA_PK_SEED(key) ((key)->priv + (key)->params->n * 2)
  ------------------
  184|    306|    pk_root = SLH_DSA_PK_ROOT(pub);
  ------------------
  |  |   16|    306|#define SLH_DSA_PK_ROOT(key) ((key)->priv + (key)->params->n * 3)
  ------------------
  185|       |
  186|    306|    if (!hashf->H_MSG(hctx, r, pk_seed, pk_root, msg, msg_len,
  ------------------
  |  Branch (186:9): [True: 0, False: 306]
  ------------------
  187|    306|                      m_digest, sizeof(m_digest)))
  188|      0|        return 0;
  189|       |
  190|       |    /*
  191|       |     * Get md (the first md_len bytes of m_digest to use in
  192|       |     * ossl_slh_fors_pk_from_sig(), and then retrieve the tree id and leaf id
  193|       |     * from the remaining bytes in m_digest.
  194|       |     */
  195|    306|    if (!PACKET_buf_init(m_digest_rpkt, m_digest, sizeof(m_digest))
  ------------------
  |  Branch (195:9): [True: 0, False: 306]
  ------------------
  196|    306|            || !PACKET_get_bytes(m_digest_rpkt, &md, md_len)
  ------------------
  |  Branch (196:16): [True: 0, False: 306]
  ------------------
  197|    306|            || !get_tree_ids(m_digest_rpkt, params, &tree_id, &leaf_id))
  ------------------
  |  Branch (197:16): [True: 0, False: 306]
  ------------------
  198|      0|        return 0;
  199|       |
  200|    306|    adrsf->set_tree_address(adrs, tree_id);
  201|    306|    adrsf->set_type_and_clear(adrs, SLH_ADRS_TYPE_FORS_TREE);
  ------------------
  |  |   31|    306|#define SLH_ADRS_TYPE_FORS_TREE  3
  ------------------
  202|    306|    adrsf->set_keypair_address(adrs, leaf_id);
  203|    306|    return ossl_slh_fors_pk_from_sig(hctx, sig_rpkt, md, pk_seed, adrs,
  ------------------
  |  Branch (203:12): [True: 306, False: 0]
  ------------------
  204|    306|                                     pk_fors, sizeof(pk_fors))
  205|    306|        && ossl_slh_ht_verify(hctx, pk_fors, sig_rpkt, pk_seed,
  ------------------
  |  Branch (205:12): [True: 306, False: 0]
  ------------------
  206|    306|                              tree_id, leaf_id, pk_root)
  207|    306|        && PACKET_remaining(sig_rpkt) == 0;
  ------------------
  |  Branch (207:12): [True: 306, False: 0]
  ------------------
  208|    306|}

ossl_slh_dsa_hash_ctx_new:
   27|  1.12k|{
   28|  1.12k|    SLH_DSA_HASH_CTX *ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|  1.12k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.12k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.12k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   29|       |
   30|  1.12k|    if (ret == NULL)
  ------------------
  |  Branch (30:9): [True: 0, False: 1.12k]
  ------------------
   31|      0|        return NULL;
   32|       |
   33|  1.12k|    ret->key = key;
   34|  1.12k|    ret->md_ctx = EVP_MD_CTX_new();
   35|  1.12k|    if (ret->md_ctx == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 1.12k]
  ------------------
   36|      0|        goto err;
   37|  1.12k|    if (EVP_DigestInit_ex2(ret->md_ctx, key->md, NULL) != 1)
  ------------------
  |  Branch (37:9): [True: 0, False: 1.12k]
  ------------------
   38|      0|        goto err;
   39|  1.12k|    if (key->md_big != NULL) {
  ------------------
  |  Branch (39:9): [True: 738, False: 390]
  ------------------
   40|       |        /* Gets here for SHA2 algorithms */
   41|    738|        if (key->md_big == key->md) {
  ------------------
  |  Branch (41:13): [True: 292, False: 446]
  ------------------
   42|    292|            ret->md_big_ctx = ret->md_ctx;
   43|    446|        } else {
   44|       |            /* Only gets here for SHA2 */
   45|    446|            ret->md_big_ctx = EVP_MD_CTX_new();
   46|    446|            if (ret->md_big_ctx == NULL)
  ------------------
  |  Branch (46:17): [True: 0, False: 446]
  ------------------
   47|      0|                goto err;
   48|    446|            if (EVP_DigestInit_ex2(ret->md_big_ctx, key->md_big, NULL) != 1)
  ------------------
  |  Branch (48:17): [True: 0, False: 446]
  ------------------
   49|      0|                goto err;
   50|    446|        }
   51|    738|        if (key->hmac != NULL) {
  ------------------
  |  Branch (51:13): [True: 738, False: 0]
  ------------------
   52|    738|            ret->hmac_ctx = EVP_MAC_CTX_new(key->hmac);
   53|    738|            if (ret->hmac_ctx == NULL)
  ------------------
  |  Branch (53:17): [True: 0, False: 738]
  ------------------
   54|      0|                goto err;
   55|    738|        }
   56|    738|    }
   57|  1.12k|    return ret;
   58|      0| err:
   59|      0|    ossl_slh_dsa_hash_ctx_free(ret);
   60|      0|    return NULL;
   61|  1.12k|}
ossl_slh_dsa_hash_ctx_free:
  105|  1.12k|{
  106|  1.12k|    if (ctx == NULL)
  ------------------
  |  Branch (106:9): [True: 0, False: 1.12k]
  ------------------
  107|      0|        return;
  108|  1.12k|    EVP_MD_CTX_free(ctx->md_ctx);
  109|  1.12k|    if (ctx->md_big_ctx != ctx->md_ctx)
  ------------------
  |  Branch (109:9): [True: 836, False: 292]
  ------------------
  110|    836|        EVP_MD_CTX_free(ctx->md_big_ctx);
  111|  1.12k|    EVP_MAC_CTX_free(ctx->hmac_ctx);
  112|  1.12k|    OPENSSL_free(ctx);
  ------------------
  |  |  115|  1.12k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.12k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.12k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  113|  1.12k|}

ossl_slh_dsa_key_new:
   89|    639|{
   90|    639|    SLH_DSA_KEY *ret;
   91|    639|    const SLH_DSA_PARAMS *params = ossl_slh_dsa_params_get(alg);
   92|       |
   93|    639|    if (params == NULL)
  ------------------
  |  Branch (93:9): [True: 0, False: 639]
  ------------------
   94|      0|        return NULL;
   95|       |
   96|    639|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |  104|    639|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   97|    639|    if (ret != NULL) {
  ------------------
  |  Branch (97:9): [True: 639, False: 0]
  ------------------
   98|    639|        ret->libctx = libctx;
   99|    639|        ret->params = params;
  100|    639|        if (propq != NULL) {
  ------------------
  |  Branch (100:13): [True: 0, False: 639]
  ------------------
  101|      0|            ret->propq = OPENSSL_strdup(propq);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|      0|            if (ret->propq == NULL)
  ------------------
  |  Branch (102:17): [True: 0, False: 0]
  ------------------
  103|      0|                goto err;
  104|      0|        }
  105|    639|        if (!slh_dsa_key_hash_init(ret))
  ------------------
  |  Branch (105:13): [True: 0, False: 639]
  ------------------
  106|      0|            goto err;
  107|    639|    }
  108|    639|    return ret;
  109|      0| err:
  110|      0|    ossl_slh_dsa_key_free(ret);
  111|      0|    return NULL;
  112|    639|}
ossl_slh_dsa_key_free:
  118|    639|{
  119|    639|    if (key == NULL)
  ------------------
  |  Branch (119:9): [True: 0, False: 639]
  ------------------
  120|      0|        return;
  121|       |
  122|    639|    slh_dsa_key_hash_cleanup(key);
  123|    639|    OPENSSL_cleanse(&key->priv, sizeof(key->priv) >> 1);
  124|    639|    OPENSSL_free(key);
  ------------------
  |  |  115|    639|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  125|    639|}
ossl_slh_dsa_key_equal:
  180|    163|{
  181|    163|    int key_checked = 0;
  182|       |
  183|       |    /* The parameter sets must match - i.e. The same algorithm name */
  184|    163|    if (key1->params != key2->params)
  ------------------
  |  Branch (184:9): [True: 0, False: 163]
  ------------------
  185|      0|        return 0;
  186|       |
  187|    163|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|    163|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|    163|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|    163|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (187:9): [True: 163, False: 0]
  ------------------
  188|    163|        if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0) {
  ------------------
  |  |  641|    163|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (188:13): [True: 163, False: 0]
  ------------------
  189|    163|            if (key1->pub != NULL && key2->pub != NULL) {
  ------------------
  |  Branch (189:17): [True: 163, False: 0]
  |  Branch (189:38): [True: 163, False: 0]
  ------------------
  190|    163|                if (memcmp(key1->pub, key2->pub, key1->params->pk_len) != 0)
  ------------------
  |  Branch (190:21): [True: 37, False: 126]
  ------------------
  191|     37|                    return 0;
  192|    126|                key_checked = 1;
  193|    126|            }
  194|    163|        }
  195|    126|        if (!key_checked
  ------------------
  |  Branch (195:13): [True: 0, False: 126]
  ------------------
  196|    126|                && (selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
  ------------------
  |  |  640|      0|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (196:20): [True: 0, False: 0]
  ------------------
  197|      0|            if (key1->has_priv && key2->has_priv) {
  ------------------
  |  Branch (197:17): [True: 0, False: 0]
  |  Branch (197:35): [True: 0, False: 0]
  ------------------
  198|      0|                if (memcmp(key1->priv, key2->priv,
  ------------------
  |  Branch (198:21): [True: 0, False: 0]
  ------------------
  199|      0|                           key1->params->pk_len) != 0)
  200|      0|                    return 0;
  201|      0|                key_checked = 1;
  202|      0|            }
  203|      0|        }
  204|    126|        return key_checked;
  205|    126|    }
  206|      0|    return 1;
  207|    163|}
ossl_slh_dsa_key_has:
  210|    378|{
  211|    378|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) != 0) {
  ------------------
  |  |  650|    378|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|    378|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|    378|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (211:9): [True: 378, False: 0]
  ------------------
  212|    378|        if (key->pub == NULL)
  ------------------
  |  Branch (212:13): [True: 0, False: 378]
  ------------------
  213|      0|            return 0; /* No public key */
  214|    378|        if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0
  ------------------
  |  |  640|    378|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (214:13): [True: 0, False: 378]
  ------------------
  215|    378|                && key->has_priv == 0)
  ------------------
  |  Branch (215:20): [True: 0, False: 0]
  ------------------
  216|      0|            return 0; /* No private key */
  217|    378|        return 1;
  218|    378|    }
  219|      0|    return 0;
  220|    378|}
ossl_slh_dsa_key_fromdata:
  249|    150|{
  250|    150|    size_t priv_len, key_len, data_len = 0;
  251|    150|    const OSSL_PARAM *param_priv = NULL, *param_pub = NULL;
  252|    150|    void *p;
  253|       |
  254|    150|    if (key == NULL)
  ------------------
  |  Branch (254:9): [True: 0, False: 150]
  ------------------
  255|      0|        return 0;
  256|       |
  257|       |    /* The private key consists of 4 elements SK_SEED, SK_PRF, PK_SEED and PK_ROOT */
  258|    150|    priv_len = ossl_slh_dsa_key_get_priv_len(key);
  259|       |    /* The size of either SK_SEED + SK_PRF OR PK_SEED + PK_ROOT */
  260|    150|    key_len = priv_len >> 1;
  261|       |
  262|       |    /* Private key is optional */
  263|    150|    if (include_private) {
  ------------------
  |  Branch (263:9): [True: 150, False: 0]
  ------------------
  264|    150|        param_priv = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PRIV_KEY);
  ------------------
  |  |  431|    150|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  265|    150|        if (param_priv != NULL) {
  ------------------
  |  Branch (265:13): [True: 150, False: 0]
  ------------------
  266|    150|            p = key->priv;
  267|    150|            if (!OSSL_PARAM_get_octet_string(param_priv, &p, priv_len, &data_len))
  ------------------
  |  Branch (267:17): [True: 4, False: 146]
  ------------------
  268|      4|                return 0;
  269|       |            /* If the data read includes all 4 elements then we are finished */
  270|    146|            if (data_len == priv_len) {
  ------------------
  |  Branch (270:17): [True: 126, False: 20]
  ------------------
  271|    126|                key->has_priv = 1;
  272|    126|                key->pub = SLH_DSA_PUB(key);
  ------------------
  |  |   17|    126|#define SLH_DSA_PUB(key) SLH_DSA_PK_SEED(key)
  |  |  ------------------
  |  |  |  |   15|    126|#define SLH_DSA_PK_SEED(key) ((key)->priv + (key)->params->n * 2)
  |  |  ------------------
  ------------------
  273|    126|                return 1;
  274|    126|            }
  275|       |            /* Otherwise it must be just SK_SEED + SK_PRF */
  276|     20|            if (data_len != key_len)
  ------------------
  |  Branch (276:17): [True: 7, False: 13]
  ------------------
  277|      7|                goto err;
  278|     13|            key->has_priv = 1;
  279|     13|        }
  280|    150|    }
  281|       |    /*
  282|       |     * In the case where the passed in private key does not contain the public key
  283|       |     * there MUST be a separate public key, since the private key cannot exist
  284|       |     * without the public key elements. NOTE that this does not accept half of
  285|       |     * the public key, (Keygen must be used for this case currently).
  286|       |     */
  287|     13|    p = SLH_DSA_PUB(key);
  ------------------
  |  |   17|     13|#define SLH_DSA_PUB(key) SLH_DSA_PK_SEED(key)
  |  |  ------------------
  |  |  |  |   15|     13|#define SLH_DSA_PK_SEED(key) ((key)->priv + (key)->params->n * 2)
  |  |  ------------------
  ------------------
  288|     13|    param_pub = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PUB_KEY);
  ------------------
  |  |  433|     13|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  289|     13|    if (param_pub == NULL
  ------------------
  |  Branch (289:9): [True: 0, False: 13]
  ------------------
  290|     13|            || !OSSL_PARAM_get_octet_string(param_pub, &p, key_len, &data_len)
  ------------------
  |  Branch (290:16): [True: 5, False: 8]
  ------------------
  291|     13|            || data_len != key_len)
  ------------------
  |  Branch (291:16): [True: 3, False: 5]
  ------------------
  292|      8|        goto err;
  293|      5|    key->pub = p;
  294|      5|    return 1;
  295|     15| err:
  296|     15|    key->pub = NULL;
  297|     15|    key->has_priv = 0;
  298|     15|    OPENSSL_cleanse(key->priv, priv_len);
  299|     15|    return 0;
  300|     13|}
ossl_slh_dsa_generate_key:
  351|    489|{
  352|    489|    size_t n = out->params->n;
  353|    489|    size_t secret_key_len = 2 * n; /* The length of SK_SEED + SK_PRF */
  354|    489|    size_t pk_seed_len = n;        /* The length of PK_SEED */
  355|    489|    size_t entropy_len_expected = secret_key_len + pk_seed_len;
  356|    489|    uint8_t *priv = SLH_DSA_PRIV(out);
  ------------------
  |  |   18|    489|#define SLH_DSA_PRIV(key) SLH_DSA_SK_SEED(key)
  |  |  ------------------
  |  |  |  |   13|    489|#define SLH_DSA_SK_SEED(key) ((key)->priv)
  |  |  ------------------
  ------------------
  357|    489|    uint8_t *pub = SLH_DSA_PUB(out);
  ------------------
  |  |   17|    489|#define SLH_DSA_PUB(key) SLH_DSA_PK_SEED(key)
  |  |  ------------------
  |  |  |  |   15|    489|#define SLH_DSA_PK_SEED(key) ((key)->priv + (key)->params->n * 2)
  |  |  ------------------
  ------------------
  358|       |
  359|    489|    if (entropy != NULL && entropy_len != 0) {
  ------------------
  |  Branch (359:9): [True: 489, False: 0]
  |  Branch (359:28): [True: 0, False: 489]
  ------------------
  360|      0|        if (entropy_len != entropy_len_expected)
  ------------------
  |  Branch (360:13): [True: 0, False: 0]
  ------------------
  361|      0|            goto err;
  362|      0|        memcpy(priv, entropy, entropy_len_expected);
  363|    489|    } else {
  364|    489|        if (RAND_priv_bytes_ex(lib_ctx, priv, secret_key_len, 0) <= 0
  ------------------
  |  Branch (364:13): [True: 0, False: 489]
  ------------------
  365|    489|                || RAND_bytes_ex(lib_ctx, pub, pk_seed_len, 0) <= 0)
  ------------------
  |  Branch (365:20): [True: 0, False: 489]
  ------------------
  366|      0|            goto err;
  367|    489|    }
  368|    489|    if (!slh_dsa_compute_pk_root(ctx, out, 0))
  ------------------
  |  Branch (368:9): [True: 0, False: 489]
  ------------------
  369|      0|        goto err;
  370|    489|    out->pub = pub;
  371|    489|    out->has_priv = 1;
  372|    489|    return 1;
  373|      0|err:
  374|      0|    out->pub = NULL;
  375|      0|    out->has_priv = 0;
  376|      0|    OPENSSL_cleanse(priv, secret_key_len);
  377|      0|    return 0;
  378|    489|}
ossl_slh_dsa_key_type_matches:
  391|    639|{
  392|    639|    return (OPENSSL_strcasecmp(key->params->alg, alg) == 0);
  393|    639|}
ossl_slh_dsa_key_get_pub:
  397|    872|{
  398|    872|    return key->pub;
  399|    872|}
ossl_slh_dsa_key_get_pub_len:
  403|    746|{
  404|    746|    return 2 * key->params->n;
  405|    746|}
ossl_slh_dsa_key_get_priv:
  409|    872|{
  410|    872|    return key->has_priv ? key->priv : NULL;
  ------------------
  |  Branch (410:12): [True: 872, False: 0]
  ------------------
  411|    872|}
ossl_slh_dsa_key_get_priv_len:
  419|    276|{
  420|    276|    return 4 * key->params->n;
  421|    276|}
ossl_slh_dsa_key_get_n:
  424|    890|{
  425|    890|    return key->params->n;
  426|    890|}
ossl_slh_dsa_key_get_security_category:
  429|    620|{
  430|    620|    return key->params->security_category;
  431|    620|}
ossl_slh_dsa_key_get_sig_len:
  434|    620|{
  435|    620|    return key->params->sig_len;
  436|    620|}
ossl_slh_dsa_key_get_type:
  442|    639|{
  443|    639|    return key->params->type;
  444|    639|}
slh_dsa_key.c:slh_dsa_key_hash_init:
   35|    639|{
   36|    639|    int is_shake = key->params->is_shake;
   37|    639|    int security_category = key->params->security_category;
   38|    639|    const char *digest_alg = is_shake ? "SHAKE-256" : "SHA2-256";
  ------------------
  |  Branch (38:30): [True: 224, False: 415]
  ------------------
   39|       |
   40|    639|    key->md = EVP_MD_fetch(key->libctx, digest_alg, key->propq);
   41|    639|    if (key->md == NULL)
  ------------------
  |  Branch (41:9): [True: 0, False: 639]
  ------------------
   42|      0|        return 0;
   43|       |    /*
   44|       |     * SHA2 algorithm(s) require SHA256 + HMAC_SHA(X) & MGF1(SHAX)
   45|       |     * SHAKE algorithm(s) use SHAKE for all functions.
   46|       |     */
   47|    639|    if (is_shake == 0) {
  ------------------
  |  Branch (47:9): [True: 415, False: 224]
  ------------------
   48|    415|        if (security_category == 1) {
  ------------------
  |  Branch (48:13): [True: 150, False: 265]
  ------------------
   49|       |            /* For category 1 SHA2-256 is used for all hash operations */
   50|    150|            key->md_big = key->md;
   51|    265|        } else {
   52|       |            /* Security categories 3 & 5 also need SHA-512 */
   53|    265|            key->md_big = EVP_MD_fetch(key->libctx, "SHA2-512", key->propq);
   54|    265|            if (key->md_big == NULL)
  ------------------
  |  Branch (54:17): [True: 0, False: 265]
  ------------------
   55|      0|                goto err;
   56|    265|        }
   57|    415|        key->hmac = EVP_MAC_fetch(key->libctx, "HMAC", key->propq);
   58|    415|        if (key->hmac == NULL)
  ------------------
  |  Branch (58:13): [True: 0, False: 415]
  ------------------
   59|      0|            goto err;
   60|    415|    }
   61|    639|    key->adrs_func = ossl_slh_get_adrs_fn(is_shake == 0);
   62|    639|    key->hash_func = ossl_slh_get_hash_fn(is_shake);
   63|    639|    return 1;
   64|      0| err:
   65|      0|    slh_dsa_key_hash_cleanup(key);
   66|      0|    return 0;
   67|    639|}
slh_dsa_key.c:slh_dsa_key_hash_cleanup:
   24|    639|{
   25|    639|    OPENSSL_free(key->propq);
  ------------------
  |  |  115|    639|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   26|    639|    if (key->md_big != key->md)
  ------------------
  |  Branch (26:9): [True: 489, False: 150]
  ------------------
   27|    489|        EVP_MD_free(key->md_big);
   28|    639|    key->md_big = NULL;
   29|    639|    EVP_MD_free(key->md);
   30|    639|    EVP_MAC_free(key->hmac);
   31|    639|    key->md = NULL;
   32|    639|}
slh_dsa_key.c:slh_dsa_compute_pk_root:
  315|    489|{
  316|    489|    const SLH_DSA_KEY *key = ctx->key;
  317|    489|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|    489|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
  318|    489|    SLH_ADRS_DECLARE(adrs);
  ------------------
  |  |   36|    489|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
  319|    489|    const SLH_DSA_PARAMS *params = key->params;
  320|    489|    size_t n = params->n;
  321|    489|    uint8_t pk_root[SLH_DSA_MAX_N], *dst;
  322|       |
  323|    489|    adrsf->zero(adrs);
  324|    489|    adrsf->set_layer_address(adrs, params->d - 1);
  325|       |
  326|    489|    dst = validate ? pk_root : SLH_DSA_PK_ROOT(out);
  ------------------
  |  |   16|    978|#define SLH_DSA_PK_ROOT(key) ((key)->priv + (key)->params->n * 3)
  ------------------
  |  Branch (326:11): [True: 0, False: 489]
  ------------------
  327|       |
  328|       |    /* Generate the ROOT public key */
  329|    489|    return ossl_slh_xmss_node(ctx, SLH_DSA_SK_SEED(key), 0, params->hm,
  ------------------
  |  |   13|    489|#define SLH_DSA_SK_SEED(key) ((key)->priv)
  ------------------
  |  Branch (329:12): [True: 489, False: 0]
  ------------------
  330|    489|                              SLH_DSA_PK_SEED(key), adrs, dst, n)
  ------------------
  |  |   15|    489|#define SLH_DSA_PK_SEED(key) ((key)->priv + (key)->params->n * 2)
  ------------------
  331|    489|        && (validate == 0 || memcmp(dst, SLH_DSA_PK_ROOT(out), n) == 0);
  ------------------
  |  |   16|      0|#define SLH_DSA_PK_ROOT(key) ((key)->priv + (key)->params->n * 3)
  ------------------
  |  Branch (331:13): [True: 489, False: 0]
  |  Branch (331:30): [True: 0, False: 0]
  ------------------
  332|    489|}

ossl_slh_fors_sign:
  134|    306|{
  135|    306|    const SLH_DSA_KEY *key = ctx->key;
  136|    306|    uint32_t tree_id, layer, s, tree_offset;
  137|    306|    uint32_t ids[SLH_MAX_K];
  138|    306|    const SLH_DSA_PARAMS *params = key->params;
  139|    306|    uint32_t n = params->n;
  140|    306|    uint32_t k = params->k; /* number of trees */
  141|    306|    uint32_t a = params->a;
  142|    306|    uint32_t two_power_a = (1 << a); /* this is t in FIPS 205 */
  143|    306|    uint32_t tree_id_times_two_power_a = 0;
  144|    306|    uint8_t out[SLH_MAX_N];
  145|       |
  146|       |    /*
  147|       |     * Split md into k a-bit values e.g with k = 14, a = 12
  148|       |     * ids[0..13] = 12 bits each of md
  149|       |     */
  150|    306|    slh_base_2b(md, a, ids, k);
  151|       |
  152|  9.13k|    for (tree_id = 0; tree_id < k; ++tree_id) {
  ------------------
  |  Branch (152:23): [True: 8.82k, False: 306]
  ------------------
  153|       |        /* Get the tree[i] leaf id */
  154|  8.82k|        uint32_t node_id = ids[tree_id]; /* |id| = |a| bits */
  155|       |
  156|       |        /*
  157|       |         * Give each of the k trees a unique range at each level.
  158|       |         * e.g. If we have 4096 leaf nodes (2^a = 2^12) for each tree
  159|       |         * tree i will use indexes from 4096 * i + (0..4095) for its bottom level.
  160|       |         * For the next level up from the bottom there would be 2048 nodes
  161|       |         * (so tree i uses indexes 2048 * i + (0...2047) for this level)
  162|       |         */
  163|  8.82k|        tree_offset = tree_id_times_two_power_a;
  164|       |
  165|  8.82k|        if (!slh_fors_sk_gen(ctx, sk_seed, pk_seed, adrs,
  ------------------
  |  Branch (165:13): [True: 0, False: 8.82k]
  ------------------
  166|  8.82k|                             node_id + tree_id_times_two_power_a, out, sizeof(out))
  167|  8.82k|                || !WPACKET_memcpy(sig_wpkt, out, n))
  ------------------
  |  Branch (167:20): [True: 0, False: 8.82k]
  ------------------
  168|      0|            return 0;
  169|       |
  170|       |        /*
  171|       |         * Traverse from the bottom of the tree (layer = 0)
  172|       |         * up to the root (layer = a - 1).
  173|       |         * NOTE: This is a really inefficient way of doing this, since at
  174|       |         * layer a - 1 it calculates most of the hashes of the entire tree as
  175|       |         * well as all the leaf nodes. So it is calculating nodes multiple times.
  176|       |         */
  177|  86.2k|        for (layer = 0; layer < a; ++layer) {
  ------------------
  |  Branch (177:25): [True: 77.3k, False: 8.82k]
  ------------------
  178|  77.3k|            s = node_id ^ 1; /* XOR gets the index of the other child in a binary tree */
  179|  77.3k|            if (!slh_fors_node(ctx, sk_seed, pk_seed, adrs,
  ------------------
  |  Branch (179:17): [True: 0, False: 77.3k]
  ------------------
  180|  77.3k|                               s + tree_offset, layer, out, sizeof(out)))
  181|      0|                return 0;
  182|  77.3k|            node_id >>= 1; /* Get the parent node id */
  183|  77.3k|            tree_offset >>= 1; /* Each layer up has half as many nodes */
  184|  77.3k|            if (!WPACKET_memcpy(sig_wpkt, out, n))
  ------------------
  |  Branch (184:17): [True: 0, False: 77.3k]
  ------------------
  185|      0|                return 0;
  186|  77.3k|        }
  187|  8.82k|        tree_id_times_two_power_a += two_power_a;
  188|  8.82k|    }
  189|    306|    return 1;
  190|    306|}
ossl_slh_fors_pk_from_sig:
  213|    612|{
  214|    612|    const SLH_DSA_KEY *key = ctx->key;
  215|    612|    int ret = 0;
  216|    612|    uint32_t i, j, aoff = 0;
  217|    612|    uint32_t ids[SLH_MAX_K];
  218|    612|    const SLH_DSA_PARAMS *params = key->params;
  219|    612|    uint32_t a = params->a;
  220|    612|    uint32_t k = params->k;
  221|    612|    uint32_t n = params->n;
  222|    612|    uint32_t two_power_a = (1 << a);
  223|    612|    const uint8_t *sk, *authj; /* Pointers to |sig| buffer inside fors_sig_rpkt */
  224|    612|    uint8_t roots[SLH_MAX_ROOTS];
  225|    612|    size_t roots_len = 0; /* The size of |roots| */
  226|    612|    uint8_t *node0, *node1; /* Pointers into roots[] */
  227|    612|    WPACKET root_pkt, *wroot_pkt = &root_pkt; /* Points to |roots| buffer */
  228|       |
  229|    612|    SLH_ADRS_DECLARE(pk_adrs);
  ------------------
  |  |   36|    612|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
  230|    612|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|    612|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
  231|    612|    SLH_ADRS_FN_DECLARE(adrsf, set_tree_index);
  ------------------
  |  |   39|    612|#define SLH_ADRS_FN_DECLARE(adrsf, t) OSSL_SLH_ADRS_FUNC_##t *t = adrsf->t
  ------------------
  232|    612|    SLH_ADRS_FN_DECLARE(adrsf, set_tree_height);
  ------------------
  |  |   39|    612|#define SLH_ADRS_FN_DECLARE(adrsf, t) OSSL_SLH_ADRS_FUNC_##t *t = adrsf->t
  ------------------
  233|    612|    SLH_HASH_FUNC_DECLARE(key, hashf);
  ------------------
  |  |   19|    612|    const SLH_HASH_FUNC *hashf = ctx->hash_func       \
  ------------------
  234|    612|    SLH_HASH_FN_DECLARE(hashf, F);
  ------------------
  |  |   21|    612|# define SLH_HASH_FN_DECLARE(hashf, t) OSSL_SLH_HASHFUNC_##t * t = hashf->t
  ------------------
  235|    612|    SLH_HASH_FN_DECLARE(hashf, H);
  ------------------
  |  |   21|    612|# define SLH_HASH_FN_DECLARE(hashf, t) OSSL_SLH_HASHFUNC_##t * t = hashf->t
  ------------------
  236|       |
  237|    612|    if (!WPACKET_init_static_len(wroot_pkt, roots, sizeof(roots), 0))
  ------------------
  |  Branch (237:9): [True: 0, False: 612]
  ------------------
  238|      0|        return 0;
  239|       |
  240|       |    /* Split md into k a-bit values e.g ids[0..k-1] = 12 bits each of md */
  241|    612|    slh_base_2b(md, a, ids, k);
  242|       |
  243|       |    /* Compute the roots of k Merkle trees */
  244|  18.2k|    for (i = 0; i < k; ++i) {
  ------------------
  |  Branch (244:17): [True: 17.6k, False: 612]
  ------------------
  245|  17.6k|        uint32_t id = ids[i];
  246|  17.6k|        uint32_t node_id = id + aoff;
  247|       |
  248|  17.6k|        set_tree_height(adrs, 0);
  249|  17.6k|        set_tree_index(adrs, node_id);
  250|       |
  251|       |        /* Regenerate the public key of the leaf */
  252|  17.6k|        if (!PACKET_get_bytes(fors_sig_rpkt, &sk, n)
  ------------------
  |  Branch (252:13): [True: 0, False: 17.6k]
  ------------------
  253|  17.6k|                || !WPACKET_allocate_bytes(wroot_pkt, n, &node0)
  ------------------
  |  Branch (253:20): [True: 0, False: 17.6k]
  ------------------
  254|  17.6k|                || !F(ctx, pk_seed, adrs, sk, n, node0, n))
  ------------------
  |  Branch (254:20): [True: 0, False: 17.6k]
  ------------------
  255|      0|            goto err;
  256|       |
  257|       |        /* This omits the copying of the nodes that the FIPS 205 code does */
  258|  17.6k|        node1 = node0;
  259|   172k|        for (j = 0; j < a; ++j) {
  ------------------
  |  Branch (259:21): [True: 154k, False: 17.6k]
  ------------------
  260|       |            /* Get this layers other child public key */
  261|   154k|            if (!PACKET_get_bytes(fors_sig_rpkt, &authj, n))
  ------------------
  |  Branch (261:17): [True: 0, False: 154k]
  ------------------
  262|      0|                goto err;
  263|       |            /* Hash the children together to get the parent nodes public key */
  264|   154k|            set_tree_height(adrs, j + 1);
  265|   154k|            if ((id & 1) == 0) {
  ------------------
  |  Branch (265:17): [True: 77.2k, False: 77.5k]
  ------------------
  266|  77.2k|                node_id >>= 1;
  267|  77.2k|                set_tree_index(adrs, node_id);
  268|  77.2k|                if (!H(ctx, pk_seed, adrs, node0, authj, node1, n))
  ------------------
  |  Branch (268:21): [True: 0, False: 77.2k]
  ------------------
  269|      0|                    goto err;
  270|  77.5k|            } else {
  271|  77.5k|                node_id = (node_id - 1) >> 1;
  272|  77.5k|                set_tree_index(adrs, node_id);
  273|  77.5k|                if (!H(ctx, pk_seed, adrs, authj, node0, node1, n))
  ------------------
  |  Branch (273:21): [True: 0, False: 77.5k]
  ------------------
  274|      0|                    goto err;
  275|  77.5k|            }
  276|   154k|            id >>= 1;
  277|   154k|        }
  278|  17.6k|        aoff += two_power_a;
  279|  17.6k|    }
  280|    612|    if (!WPACKET_get_total_written(wroot_pkt, &roots_len))
  ------------------
  |  Branch (280:9): [True: 0, False: 612]
  ------------------
  281|      0|        goto err;
  282|       |
  283|       |    /* The public key is the hash of all the roots of the k trees */
  284|    612|    adrsf->copy(pk_adrs, adrs);
  285|    612|    adrsf->set_type_and_clear(pk_adrs, SLH_ADRS_TYPE_FORS_ROOTS);
  ------------------
  |  |   32|    612|#define SLH_ADRS_TYPE_FORS_ROOTS 4
  ------------------
  286|    612|    adrsf->copy_keypair_address(pk_adrs, adrs);
  287|    612|    ret = hashf->T(ctx, pk_seed, pk_adrs, roots, roots_len, pk_out, pk_out_len);
  288|    612| err:
  289|    612|    if (!WPACKET_finish(wroot_pkt))
  ------------------
  |  Branch (289:9): [True: 0, False: 612]
  ------------------
  290|      0|        ret = 0;
  291|    612|    return ret;
  292|    612|}
slh_fors.c:slh_fors_sk_gen:
   44|  27.8M|{
   45|  27.8M|    const SLH_DSA_KEY *key = ctx->key;
   46|  27.8M|    SLH_ADRS_DECLARE(sk_adrs);
  ------------------
  |  |   36|  27.8M|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
   47|  27.8M|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|  27.8M|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
   48|       |
   49|  27.8M|    adrsf->copy(sk_adrs, adrs);
   50|  27.8M|    adrsf->set_type_and_clear(sk_adrs, SLH_ADRS_TYPE_FORS_PRF);
  ------------------
  |  |   34|  27.8M|#define SLH_ADRS_TYPE_FORS_PRF   6
  ------------------
   51|  27.8M|    adrsf->copy_keypair_address(sk_adrs, adrs);
   52|  27.8M|    adrsf->set_tree_index(sk_adrs, id);
   53|  27.8M|    return key->hash_func->PRF(ctx, pk_seed, sk_seed, sk_adrs, pk_out, pk_out_len);
   54|  27.8M|}
slh_fors.c:slh_fors_node:
   80|  55.6M|{
   81|  55.6M|    int ret = 0;
   82|  55.6M|    const SLH_DSA_KEY *key = ctx->key;
   83|  55.6M|    uint8_t sk[SLH_MAX_N], lnode[SLH_MAX_N], rnode[SLH_MAX_N];
   84|  55.6M|    uint32_t n = key->params->n;
   85|       |
   86|  55.6M|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|  55.6M|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
   87|       |
   88|  55.6M|    if (height == 0) {
  ------------------
  |  Branch (88:9): [True: 27.8M, False: 27.7M]
  ------------------
   89|       |        /* Gets here for leaf nodes */
   90|  27.8M|        if (!slh_fors_sk_gen(ctx, sk_seed, pk_seed, adrs, node_id, sk, sizeof(sk)))
  ------------------
  |  Branch (90:13): [True: 0, False: 27.8M]
  ------------------
   91|      0|            return 0;
   92|  27.8M|        adrsf->set_tree_height(adrs, 0);
   93|  27.8M|        adrsf->set_tree_index(adrs, node_id);
   94|  27.8M|        ret = key->hash_func->F(ctx, pk_seed, adrs, sk, n, node, node_len);
   95|  27.8M|        OPENSSL_cleanse(sk, n);
   96|  27.8M|        return ret;
   97|  27.8M|    } else {
   98|  27.7M|        if (!slh_fors_node(ctx, sk_seed, pk_seed, adrs, 2 * node_id, height - 1,
  ------------------
  |  Branch (98:13): [True: 0, False: 27.7M]
  ------------------
   99|  27.7M|                           lnode, sizeof(rnode))
  100|  27.7M|                || !slh_fors_node(ctx, sk_seed, pk_seed, adrs, 2 * node_id + 1,
  ------------------
  |  Branch (100:20): [True: 0, False: 27.7M]
  ------------------
  101|  27.7M|                                  height - 1, rnode, sizeof(rnode)))
  102|      0|            return 0;
  103|  27.7M|        adrsf->set_tree_height(adrs, height);
  104|  27.7M|        adrsf->set_tree_index(adrs, node_id);
  105|  27.7M|        if (!key->hash_func->H(ctx, pk_seed, adrs, lnode, rnode, node, node_len))
  ------------------
  |  Branch (105:13): [True: 0, False: 27.7M]
  ------------------
  106|      0|            return 0;
  107|  27.7M|    }
  108|  27.7M|    return 1;
  109|  55.6M|}
slh_fors.c:slh_base_2b:
  307|    918|{
  308|    918|    size_t consumed = 0;
  309|    918|    uint32_t bits = 0;
  310|    918|    uint32_t total = 0;
  311|    918|    uint32_t mask = (1 << b) - 1;
  312|       |
  313|  27.3k|    for (consumed = 0; consumed < out_len; consumed++) {
  ------------------
  |  Branch (313:24): [True: 26.4k, False: 918]
  ------------------
  314|  55.7k|        while (bits < b) {
  ------------------
  |  Branch (314:16): [True: 29.2k, False: 26.4k]
  ------------------
  315|  29.2k|            total <<= 8;
  316|  29.2k|            total += *in++;
  317|  29.2k|            bits += 8;
  318|  29.2k|        }
  319|  26.4k|        bits -= b;
  320|  26.4k|        *out++ = (total >> bits) & mask;
  321|  26.4k|    }
  322|    918|}

ossl_slh_get_hash_fn:
  267|    639|{
  268|    639|    static const SLH_HASH_FUNC methods[] = {
  269|    639|        {
  270|    639|            slh_hmsg_shake,
  271|    639|            slh_prf_shake,
  272|    639|            slh_prf_msg_shake,
  273|    639|            slh_f_shake,
  274|    639|            slh_h_shake,
  275|    639|            slh_t_shake
  276|    639|        },
  277|    639|        {
  278|    639|            slh_hmsg_sha2,
  279|    639|            slh_prf_sha2,
  280|    639|            slh_prf_msg_sha2,
  281|    639|            slh_f_sha2,
  282|    639|            slh_h_sha2,
  283|    639|            slh_t_sha2
  284|    639|        }
  285|    639|    };
  286|    639|    return &methods[is_shake ? 0 : 1];
  ------------------
  |  Branch (286:21): [True: 224, False: 415]
  ------------------
  287|    639|}
slh_hash.c:slh_hmsg_shake:
   69|    210|{
   70|    210|    const SLH_DSA_PARAMS *params = ctx->key->params;
   71|    210|    size_t m = params->m;
   72|    210|    size_t n = params->n;
   73|       |
   74|    210|    return xof_digest_4(ctx->md_ctx, r, n, pk_seed, n, pk_root, n,
   75|    210|                        msg, msg_len, out, m);
   76|    210|}
slh_hash.c:xof_digest_4:
   54|  12.3M|{
   55|  12.3M|    return (EVP_DigestInit_ex2(ctx, NULL, NULL) == 1
  ------------------
  |  Branch (55:13): [True: 12.3M, False: 0]
  ------------------
   56|  12.3M|            && EVP_DigestUpdate(ctx, in1, in1_len) == 1
  ------------------
  |  Branch (56:16): [True: 12.3M, False: 0]
  ------------------
   57|  12.3M|            && EVP_DigestUpdate(ctx, in2, in2_len) == 1
  ------------------
  |  Branch (57:16): [True: 12.3M, False: 0]
  ------------------
   58|  12.3M|            && EVP_DigestUpdate(ctx, in3, in3_len) == 1
  ------------------
  |  Branch (58:16): [True: 12.3M, False: 0]
  ------------------
   59|  12.3M|            && EVP_DigestUpdate(ctx, in4, in4_len) == 1
  ------------------
  |  Branch (59:16): [True: 12.3M, False: 0]
  ------------------
   60|  12.3M|            && EVP_DigestFinalXOF(ctx, out, out_len) == 1);
  ------------------
  |  Branch (60:16): [True: 12.3M, False: 0]
  ------------------
   61|  12.3M|}
slh_hash.c:slh_prf_shake:
   82|  19.8M|{
   83|  19.8M|    const SLH_DSA_PARAMS *params = ctx->key->params;
   84|  19.8M|    size_t n = params->n;
   85|       |
   86|  19.8M|    return xof_digest_3(ctx->md_ctx, pk_seed, n, adrs, SLH_ADRS_SIZE,
  ------------------
  |  |   23|  19.8M|#define SLH_ADRS_SIZE     32 /* size of the ADRS blob */
  ------------------
   87|  19.8M|                        sk_seed, n, out, n);
   88|  19.8M|}
slh_hash.c:xof_digest_3:
   40|   148M|{
   41|   148M|    return (EVP_DigestInit_ex2(ctx, NULL, NULL) == 1
  ------------------
  |  Branch (41:13): [True: 148M, False: 0]
  ------------------
   42|   148M|            && EVP_DigestUpdate(ctx, in1, in1_len) == 1
  ------------------
  |  Branch (42:16): [True: 148M, False: 0]
  ------------------
   43|   148M|            && EVP_DigestUpdate(ctx, in2, in2_len) == 1
  ------------------
  |  Branch (43:16): [True: 148M, False: 0]
  ------------------
   44|   148M|            && EVP_DigestUpdate(ctx, in3, in3_len) == 1
  ------------------
  |  Branch (44:16): [True: 148M, False: 0]
  ------------------
   45|   148M|            && EVP_DigestFinalXOF(ctx, out, out_len) == 1);
  ------------------
  |  Branch (45:16): [True: 148M, False: 0]
  ------------------
   46|   148M|}
slh_hash.c:slh_prf_msg_shake:
   94|    105|{
   95|    105|    unsigned char out[SLH_MAX_N];
   96|    105|    const SLH_DSA_PARAMS *params = ctx->key->params;
   97|    105|    size_t n = params->n;
   98|       |
   99|    105|    return xof_digest_3(ctx->md_ctx, sk_prf, n, opt_rand, n, msg, msg_len, out, n)
  ------------------
  |  Branch (99:12): [True: 105, False: 0]
  ------------------
  100|    105|        && WPACKET_memcpy(pkt, out, n);
  ------------------
  |  Branch (100:12): [True: 105, False: 0]
  ------------------
  101|    105|}
slh_hash.c:slh_f_shake:
  106|   128M|{
  107|   128M|    const SLH_DSA_PARAMS *params = ctx->key->params;
  108|   128M|    size_t n = params->n;
  109|       |
  110|   128M|    return xof_digest_3(ctx->md_ctx, pk_seed, n, adrs, SLH_ADRS_SIZE, m1, m1_len, out, n);
  ------------------
  |  |   23|   128M|#define SLH_ADRS_SIZE     32 /* size of the ADRS blob */
  ------------------
  111|   128M|}
slh_hash.c:slh_h_shake:
  116|  12.3M|{
  117|  12.3M|    const SLH_DSA_PARAMS *params = ctx->key->params;
  118|  12.3M|    size_t n = params->n;
  119|       |
  120|  12.3M|    return xof_digest_4(ctx->md_ctx, pk_seed, n, adrs, SLH_ADRS_SIZE, m1, n, m2, n, out, n);
  ------------------
  |  |   23|  12.3M|#define SLH_ADRS_SIZE     32 /* size of the ADRS blob */
  ------------------
  121|  12.3M|}
slh_hash.c:slh_t_shake:
  126|   142k|{
  127|   142k|    const SLH_DSA_PARAMS *params = ctx->key->params;
  128|   142k|    size_t n = params->n;
  129|       |
  130|   142k|    return xof_digest_3(ctx->md_ctx, pk_seed, n, adrs, SLH_ADRS_SIZE, ml, ml_len, out, n);
  ------------------
  |  |   23|   142k|#define SLH_ADRS_SIZE     32 /* size of the ADRS blob */
  ------------------
  131|   142k|}
slh_hash.c:slh_hmsg_sha2:
  153|    402|{
  154|    402|    const SLH_DSA_PARAMS *params = hctx->key->params;
  155|    402|    size_t m = params->m;
  156|    402|    size_t n = params->n;
  157|    402|    uint8_t seed[2 * SLH_MAX_N + MAX_DIGEST_SIZE];
  158|    402|    int sz = EVP_MD_get_size(hctx->key->md_big);
  159|    402|    size_t seed_len = (size_t)sz + 2 * n;
  160|       |
  161|    402|    memcpy(seed, r, n);
  162|    402|    memcpy(seed + n, pk_seed, n);
  163|    402|    return digest_4(hctx->md_big_ctx, r, n, pk_seed, n, pk_root, n, msg, msg_len,
  ------------------
  |  Branch (163:12): [True: 402, False: 0]
  ------------------
  164|    402|                    seed + 2 * n)
  165|    402|        && (PKCS1_MGF1(out, m, seed, seed_len, hctx->key->md_big) == 0);
  ------------------
  |  Branch (165:12): [True: 402, False: 0]
  ------------------
  166|    402|}
slh_hash.c:digest_4:
  138|   242M|{
  139|   242M|    return (EVP_DigestInit_ex2(ctx, NULL, NULL) == 1
  ------------------
  |  Branch (139:13): [True: 242M, False: 0]
  ------------------
  140|   242M|            && EVP_DigestUpdate(ctx, in1, in1_len) == 1
  ------------------
  |  Branch (140:16): [True: 242M, False: 0]
  ------------------
  141|   242M|            && EVP_DigestUpdate(ctx, in2, in2_len) == 1
  ------------------
  |  Branch (141:16): [True: 242M, False: 0]
  ------------------
  142|   242M|            && EVP_DigestUpdate(ctx, in3, in3_len) == 1
  ------------------
  |  Branch (142:16): [True: 242M, False: 0]
  ------------------
  143|   242M|            && EVP_DigestUpdate(ctx, in4, in4_len) == 1
  ------------------
  |  Branch (143:16): [True: 242M, False: 0]
  ------------------
  144|   242M|            && EVP_DigestFinal_ex(ctx, out, NULL) == 1);
  ------------------
  |  Branch (144:16): [True: 242M, False: 0]
  ------------------
  145|   242M|}
slh_hash.c:slh_prf_sha2:
  227|  27.8M|{
  228|  27.8M|    size_t n = hctx->key->params->n;
  229|       |
  230|  27.8M|    return do_hash(hctx->md_ctx, n, pk_seed, adrs, sk_seed, n,
  231|  27.8M|                   OSSL_SLH_DSA_SHA2_NUM_ZEROS_H_AND_T_BOUND1, out, out_len);
  ------------------
  |  |   16|  27.8M|#define OSSL_SLH_DSA_SHA2_NUM_ZEROS_H_AND_T_BOUND1 64
  ------------------
  232|  27.8M|}
slh_hash.c:do_hash:
  211|   242M|{
  212|   242M|    int ret;
  213|   242M|    uint8_t zeros[128] = { 0 };
  214|   242M|    uint8_t digest[MAX_DIGEST_SIZE];
  215|       |
  216|   242M|    ret = digest_4(ctx, pk_seed, n, zeros, b - n, adrs, SLH_ADRSC_SIZE,
  ------------------
  |  |   24|   242M|#define SLH_ADRSC_SIZE    22 /* size of a compact ADRS blob */
  ------------------
  217|   242M|                   m, m_len, digest);
  218|       |    /* Truncated returned value is n = 16 bytes */
  219|   242M|    memcpy(out, digest, n);
  220|   242M|    return ret;
  221|   242M|}
slh_hash.c:slh_prf_msg_sha2:
  172|    201|{
  173|    201|    int ret;
  174|    201|    const SLH_DSA_KEY *key = hctx->key;
  175|    201|    EVP_MAC_CTX *mctx = hctx->hmac_ctx;
  176|    201|    const SLH_DSA_PARAMS *prms = key->params;
  177|    201|    size_t n = prms->n;
  178|    201|    uint8_t mac[MAX_DIGEST_SIZE] = {0};
  179|    201|    OSSL_PARAM *p = NULL;
  180|    201|    OSSL_PARAM params[3];
  181|       |
  182|       |    /*
  183|       |     * Due to the way HMAC works, it is not possible to do this code early
  184|       |     * in hmac_ctx_new() since it requires a key in order to set the digest.
  185|       |     * So we do a lazy update here on the first call.
  186|       |     */
  187|    201|    if (hctx->hmac_digest_used == 0) {
  ------------------
  |  Branch (187:9): [True: 201, False: 0]
  ------------------
  188|    201|        p = params;
  189|       |        /* The underlying digest to be used */
  190|    201|        *p++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
  ------------------
  |  |  336|    201|# define OSSL_MAC_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
  |  |  ------------------
  |  |  |  |  122|    201|# define OSSL_ALG_PARAM_DIGEST "digest"
  |  |  ------------------
  ------------------
  191|    201|                                                (char *)EVP_MD_get0_name(key->md_big), 0);
  192|    201|        if (key->propq != NULL)
  ------------------
  |  Branch (192:13): [True: 0, False: 201]
  ------------------
  193|      0|            *p++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_PROPERTIES,
  ------------------
  |  |  345|      0|# define OSSL_MAC_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|      0|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  194|      0|                                                    (char *)key->propq, 0);
  195|    201|        *p = OSSL_PARAM_construct_end();
  196|    201|        p = params;
  197|    201|        hctx->hmac_digest_used = 1;
  198|    201|    }
  199|       |
  200|    201|    ret = EVP_MAC_init(mctx, sk_prf, n, p) == 1
  ------------------
  |  Branch (200:11): [True: 201, False: 0]
  ------------------
  201|    201|        && EVP_MAC_update(mctx, opt_rand, n) == 1
  ------------------
  |  Branch (201:12): [True: 201, False: 0]
  ------------------
  202|    201|        && EVP_MAC_update(mctx, msg, msg_len) == 1
  ------------------
  |  Branch (202:12): [True: 201, False: 0]
  ------------------
  203|    201|        && EVP_MAC_final(mctx, mac, NULL, sizeof(mac)) == 1
  ------------------
  |  Branch (203:12): [True: 201, False: 0]
  ------------------
  204|    201|        && WPACKET_memcpy(pkt, mac, n); /* Truncate output to n bytes */
  ------------------
  |  Branch (204:12): [True: 201, False: 0]
  ------------------
  205|    201|    return ret;
  206|    201|}
slh_hash.c:slh_f_sha2:
  237|   198M|{
  238|   198M|    return do_hash(hctx->md_ctx, hctx->key->params->n, pk_seed, adrs, m1, m1_len,
  239|   198M|                   OSSL_SLH_DSA_SHA2_NUM_ZEROS_H_AND_T_BOUND1, out, out_len);
  ------------------
  |  |   16|   198M|#define OSSL_SLH_DSA_SHA2_NUM_ZEROS_H_AND_T_BOUND1 64
  ------------------
  240|   198M|}
slh_hash.c:slh_h_sha2:
  245|  16.0M|{
  246|  16.0M|    uint8_t m[SLH_MAX_N * 2];
  247|  16.0M|    const SLH_DSA_PARAMS *prms = hctx->key->params;
  248|  16.0M|    size_t n = prms->n;
  249|       |
  250|  16.0M|    memcpy(m, m1, n);
  251|  16.0M|    memcpy(m + n, m2, n);
  252|  16.0M|    return do_hash(hctx->md_big_ctx, n, pk_seed, adrs, m, 2 * n,
  253|  16.0M|                   prms->sha2_h_and_t_bound, out, out_len);
  254|  16.0M|}
slh_hash.c:slh_t_sha2:
  259|   247k|{
  260|   247k|    const SLH_DSA_PARAMS *prms = hctx->key->params;
  261|       |
  262|   247k|    return do_hash(hctx->md_big_ctx, prms->n, pk_seed, adrs, ml, ml_len,
  263|   247k|                   prms->sha2_h_and_t_bound, out, out_len);
  264|   247k|}

ossl_slh_ht_sign:
   35|    306|{
   36|    306|    const SLH_DSA_KEY *key = ctx->key;
   37|    306|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|    306|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
   38|    306|    SLH_ADRS_DECLARE(adrs);
  ------------------
  |  |   36|    306|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
   39|    306|    uint8_t root[SLH_MAX_N];
   40|    306|    uint32_t layer, mask;
   41|    306|    const SLH_DSA_PARAMS *params = key->params;
   42|    306|    uint32_t n = params->n;
   43|    306|    uint32_t d = params->d;
   44|    306|    uint32_t hm = params->hm;
   45|    306|    uint8_t *psig;
   46|    306|    PACKET rpkt, *xmss_sig_rpkt = &rpkt;
   47|       |
   48|    306|    mask = (1 << hm) - 1; /* A mod 2^h = A & ((2^h - 1))) */
   49|       |
   50|    306|    adrsf->zero(adrs);
   51|       |    /*
   52|       |     * For each XMSS tree there is a current leaf node that is used for signing.
   53|       |     * The first iteration of the loop signs the input message using the bottom
   54|       |     * tree. Subsequent passes use the parent trees leaf node to sign the current
   55|       |     * trees public key.
   56|       |     * Each node in an XMSS tree has a sibling (except for the root node),
   57|       |     * so starting at the leaf node it traverses up the tree calculating
   58|       |     * hashes for all the siblings in the path to the root node,
   59|       |     * which are then stored in the XMSS signature. The verify then just needs
   60|       |     * the hash of the leaf node which is can then combine with the signature
   61|       |     * path hashes to work all the way up to the root node to calculate the
   62|       |     * public key.
   63|       |     */
   64|    306|    memcpy(root, msg, n);
   65|       |
   66|  5.41k|    for (layer = 0; layer < d; ++layer) {
  ------------------
  |  Branch (66:21): [True: 5.10k, False: 306]
  ------------------
   67|       |        /* type = SLH_ADRS_TYPE_WOTS_HASH */
   68|  5.10k|        adrsf->set_layer_address(adrs, layer);
   69|  5.10k|        adrsf->set_tree_address(adrs, tree_id);
   70|  5.10k|        psig = WPACKET_get_curr(sig_wpkt);
   71|  5.10k|        if (!ossl_slh_xmss_sign(ctx, root, sk_seed, leaf_id, pk_seed, adrs,
  ------------------
  |  Branch (71:13): [True: 0, False: 5.10k]
  ------------------
   72|  5.10k|                                sig_wpkt))
   73|      0|            return 0;
   74|       |        /*
   75|       |         * On the last loop it skips getting the public key since it is not needed
   76|       |         * to calculate another signature. If this was called it should equal
   77|       |         * the PK_ROOT (i.e. the public key of the top level tree).
   78|       |         */
   79|  5.10k|        if (layer < d - 1) {
  ------------------
  |  Branch (79:13): [True: 4.80k, False: 306]
  ------------------
   80|  4.80k|            if (!PACKET_buf_init(xmss_sig_rpkt, psig,
  ------------------
  |  Branch (80:17): [True: 0, False: 4.80k]
  ------------------
   81|  4.80k|                                 WPACKET_get_curr(sig_wpkt) - psig))
   82|      0|                return 0;
   83|  4.80k|            if (!ossl_slh_xmss_pk_from_sig(ctx, leaf_id, xmss_sig_rpkt, root,
  ------------------
  |  Branch (83:17): [True: 0, False: 4.80k]
  ------------------
   84|  4.80k|                                           pk_seed, adrs, root, sizeof(root)))
   85|      0|                return 0;
   86|  4.80k|            leaf_id = tree_id & mask;
   87|  4.80k|            tree_id >>= hm;
   88|  4.80k|        }
   89|  5.10k|    }
   90|    306|    return 1;
   91|    306|}
ossl_slh_ht_verify:
  110|    306|{
  111|    306|    const SLH_DSA_KEY *key = ctx->key;
  112|    306|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|    306|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
  113|    306|    SLH_ADRS_DECLARE(adrs);
  ------------------
  |  |   36|    306|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
  114|    306|    uint8_t node[SLH_MAX_N];
  115|    306|    const SLH_DSA_PARAMS *params = key->params;
  116|    306|    uint32_t tree_height = params->hm;
  117|    306|    uint32_t n = params->n;
  118|    306|    uint32_t d = params->d;
  119|    306|    uint32_t mask = (1 << tree_height) - 1;
  120|    306|    uint32_t layer;
  121|       |
  122|    306|    adrsf->zero(adrs);
  123|    306|    memcpy(node, msg, n);
  124|       |
  125|  5.41k|    for (layer = 0; layer < d; ++layer) {
  ------------------
  |  Branch (125:21): [True: 5.10k, False: 306]
  ------------------
  126|  5.10k|        adrsf->set_layer_address(adrs, layer);
  127|  5.10k|        adrsf->set_tree_address(adrs, tree_id);
  128|  5.10k|        if (!ossl_slh_xmss_pk_from_sig(ctx, leaf_id, sig_pkt, node,
  ------------------
  |  Branch (128:13): [True: 0, False: 5.10k]
  ------------------
  129|  5.10k|                                       pk_seed, adrs, node, sizeof(node)))
  130|      0|            return 0;
  131|  5.10k|        leaf_id = tree_id & mask;
  132|  5.10k|        tree_id >>= tree_height;
  133|  5.10k|    }
  134|    306|    return (memcmp(node, pk_root, n) == 0);
  135|    306|}

ossl_slh_dsa_params_get:
  117|    639|{
  118|    639|    const SLH_DSA_PARAMS *p;
  119|       |
  120|    639|    if (alg == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 639]
  ------------------
  121|      0|        return NULL;
  122|  4.13k|    for (p = slh_dsa_params; p->alg != NULL; ++p) {
  ------------------
  |  Branch (122:30): [True: 4.13k, False: 0]
  ------------------
  123|  4.13k|        if (strcmp(p->alg, alg) == 0)
  ------------------
  |  Branch (123:13): [True: 639, False: 3.49k]
  ------------------
  124|    639|            return p;
  125|  4.13k|    }
  126|      0|    return NULL;
  127|    639|}

ossl_slh_wots_pk_gen:
  141|   379k|{
  142|   379k|    int ret = 0;
  143|   379k|    const SLH_DSA_KEY *key = ctx->key;
  144|   379k|    size_t n = key->params->n;
  145|   379k|    size_t i, len = SLH_WOTS_LEN(n); /* 2 * n + 3 */
  ------------------
  |  |   26|   379k|#define SLH_WOTS_LEN(n) (2 * (n) + 3)
  ------------------
  146|   379k|    uint8_t sk[SLH_MAX_N];
  147|   379k|    uint8_t tmp[SLH_WOTS_LEN_MAX * SLH_MAX_N];
  148|   379k|    WPACKET pkt, *tmp_wpkt = &pkt; /* Points to the |tmp| buffer */
  149|   379k|    size_t tmp_len = 0;
  150|       |
  151|   379k|    SLH_HASH_FUNC_DECLARE(key, hashf);
  ------------------
  |  |   19|   379k|    const SLH_HASH_FUNC *hashf = ctx->hash_func       \
  ------------------
  152|   379k|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|   379k|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
  153|   379k|    SLH_HASH_FN_DECLARE(hashf, PRF);
  ------------------
  |  |   21|   379k|# define SLH_HASH_FN_DECLARE(hashf, t) OSSL_SLH_HASHFUNC_##t * t = hashf->t
  ------------------
  154|   379k|    SLH_ADRS_FN_DECLARE(adrsf, set_chain_address);
  ------------------
  |  |   39|   379k|#define SLH_ADRS_FN_DECLARE(adrsf, t) OSSL_SLH_ADRS_FUNC_##t *t = adrsf->t
  ------------------
  155|   379k|    SLH_ADRS_DECLARE(sk_adrs);
  ------------------
  |  |   36|   379k|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
  156|   379k|    SLH_ADRS_DECLARE(wots_pk_adrs);
  ------------------
  |  |   36|   379k|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
  157|       |
  158|   379k|    if (!WPACKET_init_static_len(tmp_wpkt, tmp, sizeof(tmp), 0))
  ------------------
  |  Branch (158:9): [True: 0, False: 379k]
  ------------------
  159|      0|        return 0;
  160|   379k|    adrsf->copy(sk_adrs, adrs);
  161|   379k|    adrsf->set_type_and_clear(sk_adrs, SLH_ADRS_TYPE_WOTS_PRF);
  ------------------
  |  |   33|   379k|#define SLH_ADRS_TYPE_WOTS_PRF   5
  ------------------
  162|   379k|    adrsf->copy_keypair_address(sk_adrs, adrs);
  163|       |
  164|  19.9M|    for (i = 0; i < len; ++i) { /* len = 2n + 3 */
  ------------------
  |  Branch (164:17): [True: 19.5M, False: 379k]
  ------------------
  165|  19.5M|        set_chain_address(sk_adrs, i);
  166|  19.5M|        if (!PRF(ctx, pk_seed, sk_seed, sk_adrs, sk, sizeof(sk)))
  ------------------
  |  Branch (166:13): [True: 0, False: 19.5M]
  ------------------
  167|      0|            goto end;
  168|       |
  169|  19.5M|        set_chain_address(adrs, i);
  170|  19.5M|        if (!slh_wots_chain(ctx, sk, 0, NIBBLE_MASK, pk_seed, adrs, tmp_wpkt))
  ------------------
  |  |   22|  19.5M|#define NIBBLE_MASK 15
  ------------------
  |  Branch (170:13): [True: 0, False: 19.5M]
  ------------------
  171|      0|            goto end;
  172|  19.5M|    }
  173|       |
  174|   379k|    if (!WPACKET_get_total_written(tmp_wpkt, &tmp_len)) /* should be n * (2 * n + 3) */
  ------------------
  |  Branch (174:9): [True: 0, False: 379k]
  ------------------
  175|      0|        goto end;
  176|   379k|    adrsf->copy(wots_pk_adrs, adrs);
  177|   379k|    adrsf->set_type_and_clear(wots_pk_adrs, SLH_ADRS_TYPE_WOTS_PK);
  ------------------
  |  |   29|   379k|#define SLH_ADRS_TYPE_WOTS_PK    1
  ------------------
  178|   379k|    adrsf->copy_keypair_address(wots_pk_adrs, adrs);
  179|   379k|    ret = hashf->T(ctx, pk_seed, wots_pk_adrs, tmp, tmp_len, pk_out, pk_out_len);
  180|   379k|end:
  181|   379k|    WPACKET_finish(tmp_wpkt);
  182|   379k|    OPENSSL_cleanse(tmp, sizeof(tmp));
  183|   379k|    OPENSSL_cleanse(sk, n);
  184|   379k|    return ret;
  185|   379k|}
ossl_slh_wots_sign:
  206|  5.10k|{
  207|  5.10k|    int ret = 0;
  208|  5.10k|    const SLH_DSA_KEY *key = ctx->key;
  209|  5.10k|    uint8_t msg_and_csum_nibbles[SLH_WOTS_LEN_MAX]; /* size is >= 2 * n + 3 */
  210|  5.10k|    uint8_t sk[SLH_MAX_N];
  211|  5.10k|    size_t i;
  212|  5.10k|    size_t n = key->params->n;
  213|  5.10k|    size_t len1 = SLH_WOTS_LEN1(n); /* 2 * n = the msg length in nibbles */
  ------------------
  |  |   18|  5.10k|#define SLH_WOTS_LEN1(n) (2 * (n))
  ------------------
  214|  5.10k|    size_t len = len1 + SLH_WOTS_LEN2;  /* 2 * n + 3 (3 checksum nibbles) */
  ------------------
  |  |   19|  5.10k|#define SLH_WOTS_LEN2 3
  ------------------
  215|       |
  216|  5.10k|    SLH_ADRS_DECLARE(sk_adrs);
  ------------------
  |  |   36|  5.10k|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
  217|  5.10k|    SLH_HASH_FUNC_DECLARE(key, hashf);
  ------------------
  |  |   19|  5.10k|    const SLH_HASH_FUNC *hashf = ctx->hash_func       \
  ------------------
  218|  5.10k|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|  5.10k|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
  219|  5.10k|    SLH_HASH_FN_DECLARE(hashf, PRF);
  ------------------
  |  |   21|  5.10k|# define SLH_HASH_FN_DECLARE(hashf, t) OSSL_SLH_HASHFUNC_##t * t = hashf->t
  ------------------
  220|  5.10k|    SLH_ADRS_FN_DECLARE(adrsf, set_chain_address);
  ------------------
  |  |   39|  5.10k|#define SLH_ADRS_FN_DECLARE(adrsf, t) OSSL_SLH_ADRS_FUNC_##t *t = adrsf->t
  ------------------
  221|       |
  222|       |    /*
  223|       |     * Convert n message bytes to 2*n base w=16 integers
  224|       |     * i.e. Convert message to an array of 2*n nibbles.
  225|       |     */
  226|  5.10k|    slh_bytes_to_nibbles(msg, n, msg_and_csum_nibbles);
  227|       |    /* Compute a 12 bit checksum and add it to the end */
  228|  5.10k|    compute_checksum_nibbles(msg_and_csum_nibbles, len1, msg_and_csum_nibbles + len1);
  229|       |
  230|  5.10k|    adrsf->copy(sk_adrs, adrs);
  231|  5.10k|    adrsf->set_type_and_clear(sk_adrs, SLH_ADRS_TYPE_WOTS_PRF);
  ------------------
  |  |   33|  5.10k|#define SLH_ADRS_TYPE_WOTS_PRF   5
  ------------------
  232|  5.10k|    adrsf->copy_keypair_address(sk_adrs, adrs);
  233|       |
  234|   254k|    for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (234:17): [True: 249k, False: 5.10k]
  ------------------
  235|   249k|        set_chain_address(sk_adrs, i);
  236|       |        /* compute chain i secret */
  237|   249k|        if (!PRF(ctx, pk_seed, sk_seed, sk_adrs, sk, sizeof(sk)))
  ------------------
  |  Branch (237:13): [True: 0, False: 249k]
  ------------------
  238|      0|            goto err;
  239|   249k|        set_chain_address(adrs, i);
  240|       |        /* compute chain i signature */
  241|   249k|        if (!slh_wots_chain(ctx, sk, 0, msg_and_csum_nibbles[i],
  ------------------
  |  Branch (241:13): [True: 0, False: 249k]
  ------------------
  242|   249k|                            pk_seed, adrs, sig_wpkt))
  243|      0|            goto err;
  244|   249k|    }
  245|  5.10k|    ret = 1;
  246|  5.10k|err:
  247|  5.10k|    return ret;
  248|  5.10k|}
ossl_slh_wots_pk_from_sig:
  270|  9.91k|{
  271|  9.91k|    int ret = 0;
  272|  9.91k|    const SLH_DSA_KEY *key = ctx->key;
  273|  9.91k|    uint8_t msg_and_csum_nibbles[SLH_WOTS_LEN_MAX];
  274|  9.91k|    size_t i;
  275|  9.91k|    size_t n = key->params->n;
  276|  9.91k|    size_t len1 = SLH_WOTS_LEN1(n);
  ------------------
  |  |   18|  9.91k|#define SLH_WOTS_LEN1(n) (2 * (n))
  ------------------
  277|  9.91k|    size_t len = len1 + SLH_WOTS_LEN2; /* 2n + 3 */
  ------------------
  |  |   19|  9.91k|#define SLH_WOTS_LEN2 3
  ------------------
  278|  9.91k|    const uint8_t *sig_i;  /* Pointer into |sig_rpkt| buffer */
  279|  9.91k|    uint8_t tmp[SLH_WOTS_LEN_MAX * SLH_MAX_N];
  280|  9.91k|    WPACKET pkt, *tmp_pkt = &pkt;
  281|  9.91k|    size_t tmp_len = 0;
  282|       |
  283|  9.91k|    SLH_HASH_FUNC_DECLARE(key, hashf);
  ------------------
  |  |   19|  9.91k|    const SLH_HASH_FUNC *hashf = ctx->hash_func       \
  ------------------
  284|  9.91k|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|  9.91k|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
  285|  9.91k|    SLH_ADRS_FN_DECLARE(adrsf, set_chain_address);
  ------------------
  |  |   39|  9.91k|#define SLH_ADRS_FN_DECLARE(adrsf, t) OSSL_SLH_ADRS_FUNC_##t *t = adrsf->t
  ------------------
  286|  9.91k|    SLH_ADRS_DECLARE(wots_pk_adrs);
  ------------------
  |  |   36|  9.91k|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
  287|       |
  288|  9.91k|    if (!WPACKET_init_static_len(tmp_pkt, tmp, sizeof(tmp), 0))
  ------------------
  |  Branch (288:9): [True: 0, False: 9.91k]
  ------------------
  289|      0|        return 0;
  290|       |
  291|  9.91k|    slh_bytes_to_nibbles(msg, n, msg_and_csum_nibbles);
  292|  9.91k|    compute_checksum_nibbles(msg_and_csum_nibbles, len1, msg_and_csum_nibbles + len1);
  293|       |
  294|       |    /* Compute the end nodes for each of the chains */
  295|   492k|    for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (295:17): [True: 482k, False: 9.91k]
  ------------------
  296|   482k|        set_chain_address(adrs, i);
  297|   482k|        if (!PACKET_get_bytes(sig_rpkt, &sig_i, n)
  ------------------
  |  Branch (297:13): [True: 0, False: 482k]
  ------------------
  298|   482k|                || !slh_wots_chain(ctx, sig_i, msg_and_csum_nibbles[i],
  ------------------
  |  Branch (298:20): [True: 0, False: 482k]
  ------------------
  299|   482k|                                   NIBBLE_MASK - msg_and_csum_nibbles[i],
  ------------------
  |  |   22|   482k|#define NIBBLE_MASK 15
  ------------------
  300|   482k|                                   pk_seed, adrs, tmp_pkt))
  301|      0|            goto err;
  302|   482k|    }
  303|       |    /* compress the computed public key value */
  304|  9.91k|    adrsf->copy(wots_pk_adrs, adrs);
  305|  9.91k|    adrsf->set_type_and_clear(wots_pk_adrs, SLH_ADRS_TYPE_WOTS_PK);
  ------------------
  |  |   29|  9.91k|#define SLH_ADRS_TYPE_WOTS_PK    1
  ------------------
  306|  9.91k|    adrsf->copy_keypair_address(wots_pk_adrs, adrs);
  307|  9.91k|    if (!WPACKET_get_total_written(tmp_pkt, &tmp_len))
  ------------------
  |  Branch (307:9): [True: 0, False: 9.91k]
  ------------------
  308|      0|        goto err;
  309|  9.91k|    ret = hashf->T(ctx, pk_seed, wots_pk_adrs, tmp, tmp_len,
  310|  9.91k|                   pk_out, pk_out_len);
  311|  9.91k| err:
  312|  9.91k|    if (!WPACKET_finish(tmp_pkt))
  ------------------
  |  Branch (312:9): [True: 0, False: 9.91k]
  ------------------
  313|      0|        ret = 0;
  314|  9.91k|    return ret;
  315|  9.91k|}
slh_wots.c:slh_wots_chain:
   95|  20.3M|{
   96|  20.3M|    const SLH_DSA_KEY *key = ctx->key;
   97|  20.3M|    SLH_HASH_FUNC_DECLARE(key, hashf);
  ------------------
  |  |   19|  20.3M|    const SLH_HASH_FUNC *hashf = ctx->hash_func       \
  ------------------
   98|  20.3M|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|  20.3M|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
   99|  20.3M|    SLH_HASH_FN_DECLARE(hashf, F);
  ------------------
  |  |   21|  20.3M|# define SLH_HASH_FN_DECLARE(hashf, t) OSSL_SLH_HASHFUNC_##t * t = hashf->t
  ------------------
  100|  20.3M|    SLH_ADRS_FN_DECLARE(adrsf, set_hash_address);
  ------------------
  |  |   39|  20.3M|#define SLH_ADRS_FN_DECLARE(adrsf, t) OSSL_SLH_ADRS_FUNC_##t *t = adrsf->t
  ------------------
  101|  20.3M|    size_t j = start_index, end_index;
  102|  20.3M|    size_t n = key->params->n;
  103|  20.3M|    uint8_t *tmp; /* Pointer into the |wpkt| buffer */
  104|  20.3M|    size_t tmp_len = n;
  105|       |
  106|  20.3M|    if (steps == 0)
  ------------------
  |  Branch (106:9): [True: 46.8k, False: 20.2M]
  ------------------
  107|  46.8k|        return WPACKET_memcpy(wpkt, in, n);
  108|       |
  109|  20.2M|    if (!WPACKET_allocate_bytes(wpkt, tmp_len, &tmp))
  ------------------
  |  Branch (109:9): [True: 0, False: 20.2M]
  ------------------
  110|      0|        return 0;
  111|       |
  112|  20.2M|    set_hash_address(adrs, j++);
  113|  20.2M|    if (!F(ctx, pk_seed, adrs, in, n, tmp, tmp_len))
  ------------------
  |  Branch (113:9): [True: 0, False: 20.2M]
  ------------------
  114|      0|        return 0;
  115|       |
  116|  20.2M|    end_index = start_index + steps;
  117|   299M|    for (; j < end_index; ++j) {
  ------------------
  |  Branch (117:12): [True: 278M, False: 20.2M]
  ------------------
  118|   278M|        set_hash_address(adrs, j);
  119|   278M|        if (!F(ctx, pk_seed, adrs, tmp, n, tmp, tmp_len))
  ------------------
  |  Branch (119:13): [True: 0, False: 278M]
  ------------------
  120|      0|            return 0;
  121|   278M|    }
  122|  20.2M|    return 1;
  123|  20.2M|}
slh_wots.c:slh_bytes_to_nibbles:
   35|  15.0k|{
   36|  15.0k|    size_t consumed = 0;
   37|       |
   38|   358k|    for (consumed = 0; consumed < in_len; consumed++) {
  ------------------
  |  Branch (38:24): [True: 343k, False: 15.0k]
  ------------------
   39|   343k|        *out++ = (*in >> NIBBLE_SHIFT);
  ------------------
  |  |   23|   343k|#define NIBBLE_SHIFT 4
  ------------------
   40|   343k|        *out++ = (*in++ & NIBBLE_MASK);
  ------------------
  |  |   22|   343k|#define NIBBLE_MASK 15
  ------------------
   41|   343k|    }
   42|  15.0k|}
slh_wots.c:compute_checksum_nibbles:
   53|  15.0k|{
   54|  15.0k|    size_t i;
   55|  15.0k|    uint16_t csum = 0;
   56|       |
   57|       |    /* Compute checksum */
   58|   701k|    for (i = 0; i < in_len; ++i)
  ------------------
  |  Branch (58:17): [True: 686k, False: 15.0k]
  ------------------
   59|   686k|        csum += in[i];
   60|       |    /*
   61|       |     * This line is effectively the same as doing csum += NIBBLE_MASK - in[i]
   62|       |     * in the loop above.
   63|       |     */
   64|  15.0k|    csum = (uint16_t)(NIBBLE_MASK * in_len) - csum;
  ------------------
  |  |   22|  15.0k|#define NIBBLE_MASK 15
  ------------------
   65|       |
   66|       |    /* output checksum as 3 nibbles */
   67|  15.0k|    out[0] = (csum >> (2 * NIBBLE_SHIFT)) & NIBBLE_MASK;
  ------------------
  |  |   23|  15.0k|#define NIBBLE_SHIFT 4
  ------------------
                  out[0] = (csum >> (2 * NIBBLE_SHIFT)) & NIBBLE_MASK;
  ------------------
  |  |   22|  15.0k|#define NIBBLE_MASK 15
  ------------------
   68|  15.0k|    out[1] = (csum >> NIBBLE_SHIFT) & NIBBLE_MASK;
  ------------------
  |  |   23|  15.0k|#define NIBBLE_SHIFT 4
  ------------------
                  out[1] = (csum >> NIBBLE_SHIFT) & NIBBLE_MASK;
  ------------------
  |  |   22|  15.0k|#define NIBBLE_MASK 15
  ------------------
   69|  15.0k|    out[2] = csum & NIBBLE_MASK;
  ------------------
  |  |   22|  15.0k|#define NIBBLE_MASK 15
  ------------------
   70|  15.0k|}

ossl_slh_xmss_node:
   39|   738k|{
   40|   738k|    const SLH_DSA_KEY *key = ctx->key;
   41|   738k|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|   738k|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
   42|       |
   43|   738k|    if (h == 0) {
  ------------------
  |  Branch (43:9): [True: 379k, False: 359k]
  ------------------
   44|       |        /* For leaf nodes generate the public key */
   45|   379k|        adrsf->set_type_and_clear(adrs, SLH_ADRS_TYPE_WOTS_HASH);
  ------------------
  |  |   28|   379k|#define SLH_ADRS_TYPE_WOTS_HASH  0
  ------------------
   46|   379k|        adrsf->set_keypair_address(adrs, node_id);
   47|   379k|        if (!ossl_slh_wots_pk_gen(ctx, sk_seed, pk_seed, adrs,
  ------------------
  |  Branch (47:13): [True: 0, False: 379k]
  ------------------
   48|   379k|                                  pk_out, pk_out_len))
   49|      0|            return 0;
   50|   379k|    } else {
   51|   359k|        uint8_t lnode[SLH_MAX_N], rnode[SLH_MAX_N];
   52|       |
   53|   359k|        if (!ossl_slh_xmss_node(ctx, sk_seed, 2 * node_id, h - 1, pk_seed, adrs,
  ------------------
  |  Branch (53:13): [True: 0, False: 359k]
  ------------------
   54|   359k|                                lnode, sizeof(lnode))
   55|   359k|                || !ossl_slh_xmss_node(ctx, sk_seed, 2 * node_id + 1, h - 1,
  ------------------
  |  Branch (55:20): [True: 0, False: 359k]
  ------------------
   56|   359k|                                       pk_seed, adrs, rnode, sizeof(rnode)))
   57|      0|            return 0;
   58|   359k|        adrsf->set_type_and_clear(adrs, SLH_ADRS_TYPE_TREE);
  ------------------
  |  |   30|   359k|#define SLH_ADRS_TYPE_TREE       2
  ------------------
   59|   359k|        adrsf->set_tree_height(adrs, h);
   60|   359k|        adrsf->set_tree_index(adrs, node_id);
   61|   359k|        if (!key->hash_func->H(ctx, pk_seed, adrs, lnode, rnode, pk_out, pk_out_len))
  ------------------
  |  Branch (61:13): [True: 0, False: 359k]
  ------------------
   62|      0|            return 0;
   63|   359k|    }
   64|   738k|    return 1;
   65|   738k|}
ossl_slh_xmss_sign:
   88|  5.10k|{
   89|  5.10k|    const SLH_DSA_KEY *key = ctx->key;
   90|  5.10k|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|  5.10k|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
   91|  5.10k|    SLH_ADRS_DECLARE(tmp_adrs);
  ------------------
  |  |   36|  5.10k|#define SLH_ADRS_DECLARE(a) uint8_t a[SLH_ADRS_SIZE_MAX]
  ------------------
   92|  5.10k|    size_t n = key->params->n;
   93|  5.10k|    uint32_t h, hm = key->params->hm;
   94|  5.10k|    uint32_t id = node_id;
   95|  5.10k|    uint8_t *auth_path; /* Pointer to a buffer offset inside |sig_wpkt| */
   96|  5.10k|    size_t auth_path_len = n;
   97|       |
   98|       |    /*
   99|       |     * This code reverses the order of the FIPS 205 code so that it does the
  100|       |     * sign first. This simplifies the WPACKET writing.
  101|       |     */
  102|  5.10k|    adrsf->copy(tmp_adrs, adrs);
  103|  5.10k|    adrsf->set_type_and_clear(adrs, SLH_ADRS_TYPE_WOTS_HASH);
  ------------------
  |  |   28|  5.10k|#define SLH_ADRS_TYPE_WOTS_HASH  0
  ------------------
  104|  5.10k|    adrsf->set_keypair_address(adrs, node_id);
  105|  5.10k|    if (!ossl_slh_wots_sign(ctx, msg, sk_seed, pk_seed, adrs, sig_wpkt))
  ------------------
  |  Branch (105:9): [True: 0, False: 5.10k]
  ------------------
  106|      0|        return 0;
  107|       |
  108|  5.10k|    adrsf->copy(adrs, tmp_adrs);
  109|  25.1k|    for (h = 0; h < hm; ++h) {
  ------------------
  |  Branch (109:17): [True: 20.0k, False: 5.10k]
  ------------------
  110|  20.0k|        if (!WPACKET_allocate_bytes(sig_wpkt, auth_path_len, &auth_path)
  ------------------
  |  Branch (110:13): [True: 0, False: 20.0k]
  ------------------
  111|  20.0k|                || !ossl_slh_xmss_node(ctx, sk_seed, id ^ 1, h, pk_seed, adrs,
  ------------------
  |  Branch (111:20): [True: 0, False: 20.0k]
  ------------------
  112|  20.0k|                                       auth_path, auth_path_len))
  113|      0|            return 0;
  114|  20.0k|        id >>= 1;
  115|  20.0k|    }
  116|  5.10k|    return 1;
  117|  5.10k|}
ossl_slh_xmss_pk_from_sig:
  143|  9.91k|{
  144|  9.91k|    const SLH_DSA_KEY *key = ctx->key;
  145|  9.91k|    SLH_HASH_FUNC_DECLARE(key, hashf);
  ------------------
  |  |   19|  9.91k|    const SLH_HASH_FUNC *hashf = ctx->hash_func       \
  ------------------
  146|  9.91k|    SLH_ADRS_FUNC_DECLARE(key, adrsf);
  ------------------
  |  |   38|  9.91k|    const SLH_ADRS_FUNC *adrsf = ctx->adrs_func
  ------------------
  147|  9.91k|    SLH_HASH_FN_DECLARE(hashf, H);
  ------------------
  |  |   21|  9.91k|# define SLH_HASH_FN_DECLARE(hashf, t) OSSL_SLH_HASHFUNC_##t * t = hashf->t
  ------------------
  148|  9.91k|    SLH_ADRS_FN_DECLARE(adrsf, set_tree_index);
  ------------------
  |  |   39|  9.91k|#define SLH_ADRS_FN_DECLARE(adrsf, t) OSSL_SLH_ADRS_FUNC_##t *t = adrsf->t
  ------------------
  149|  9.91k|    SLH_ADRS_FN_DECLARE(adrsf, set_tree_height);
  ------------------
  |  |   39|  9.91k|#define SLH_ADRS_FN_DECLARE(adrsf, t) OSSL_SLH_ADRS_FUNC_##t *t = adrsf->t
  ------------------
  150|  9.91k|    uint32_t k;
  151|  9.91k|    size_t n = key->params->n;
  152|  9.91k|    uint32_t hm = key->params->hm;
  153|  9.91k|    uint8_t *node = pk_out;
  154|  9.91k|    const uint8_t *auth_path; /* Pointer to buffer offset in |pkt_sig| */
  155|       |
  156|  9.91k|    adrsf->set_type_and_clear(adrs, SLH_ADRS_TYPE_WOTS_HASH);
  ------------------
  |  |   28|  9.91k|#define SLH_ADRS_TYPE_WOTS_HASH  0
  ------------------
  157|  9.91k|    adrsf->set_keypair_address(adrs, node_id);
  158|  9.91k|    if (!ossl_slh_wots_pk_from_sig(ctx, sig_rpkt, msg, pk_seed, adrs,
  ------------------
  |  Branch (158:9): [True: 0, False: 9.91k]
  ------------------
  159|  9.91k|                                   node, pk_out_len))
  160|      0|        return 0;
  161|       |
  162|  9.91k|    adrsf->set_type_and_clear(adrs, SLH_ADRS_TYPE_TREE);
  ------------------
  |  |   30|  9.91k|#define SLH_ADRS_TYPE_TREE       2
  ------------------
  163|       |
  164|  48.5k|    for (k = 0; k < hm; ++k) {
  ------------------
  |  Branch (164:17): [True: 38.5k, False: 9.91k]
  ------------------
  165|  38.5k|        if (!PACKET_get_bytes(sig_rpkt, &auth_path, n))
  ------------------
  |  Branch (165:13): [True: 0, False: 38.5k]
  ------------------
  166|      0|            return 0;
  167|  38.5k|        set_tree_height(adrs, k + 1);
  168|  38.5k|        if ((node_id & 1) == 0) { /* even */
  ------------------
  |  Branch (168:13): [True: 19.0k, False: 19.5k]
  ------------------
  169|  19.0k|            node_id >>= 1;
  170|  19.0k|            set_tree_index(adrs, node_id);
  171|  19.0k|            if (!H(ctx, pk_seed, adrs, node, auth_path, node, pk_out_len))
  ------------------
  |  Branch (171:17): [True: 0, False: 19.0k]
  ------------------
  172|      0|                return 0;
  173|  19.5k|        } else { /* odd */
  174|  19.5k|            node_id = (node_id - 1) >> 1;
  175|  19.5k|            set_tree_index(adrs, node_id);
  176|  19.5k|            if (!H(ctx, pk_seed, adrs, auth_path, node, node, pk_out_len))
  ------------------
  |  Branch (176:17): [True: 0, False: 19.5k]
  ------------------
  177|      0|                return 0;
  178|  19.5k|        }
  179|  38.5k|    }
  180|  9.91k|    return 1;
  181|  9.91k|}

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

ossl_sa_new:
   59|      4|{
   60|      4|    OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   61|       |
   62|      4|    return res;
   63|      4|}
ossl_sa_free:
  111|      4|{
  112|      4|    if (sa != NULL) {
  ------------------
  |  Branch (112:9): [True: 4, False: 0]
  ------------------
  113|      4|        sa_doall(sa, &sa_free_node, NULL, NULL);
  114|      4|        OPENSSL_free(sa);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  115|      4|    }
  116|      4|}
ossl_sa_doall_arg:
  146|      4|{
  147|      4|    if (sa != NULL)
  ------------------
  |  Branch (147:9): [True: 4, False: 0]
  ------------------
  148|      4|        sa_doall(sa, NULL, leaf, arg);
  149|      4|}
ossl_sa_get:
  157|  3.61k|{
  158|  3.61k|    int level;
  159|  3.61k|    void **p, *r = NULL;
  160|       |
  161|  3.61k|    if (sa == NULL || sa->nelem == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 3.61k]
  |  Branch (161:23): [True: 2, False: 3.61k]
  ------------------
  162|      2|        return NULL;
  163|       |
  164|  3.61k|    if (n <= sa->top) {
  ------------------
  |  Branch (164:9): [True: 3.32k, False: 290]
  ------------------
  165|  3.32k|        p = sa->nodes;
  166|  16.1k|        for (level = sa->levels - 1; p != NULL && level > 0; level--)
  ------------------
  |  Branch (166:38): [True: 15.9k, False: 190]
  |  Branch (166:51): [True: 12.8k, False: 3.13k]
  ------------------
  167|  12.8k|            p = (void **)p[(n >> (OPENSSL_SA_BLOCK_BITS * level))
  ------------------
  |  |   34|  12.8k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  168|  12.8k|                           & SA_BLOCK_MASK];
  ------------------
  |  |   46|  12.8k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  12.8k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  12.8k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  3.32k|        r = p == NULL ? NULL : p[n & SA_BLOCK_MASK];
  ------------------
  |  |   46|  3.13k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  3.13k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.13k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (169:13): [True: 190, False: 3.13k]
  ------------------
  170|  3.32k|    }
  171|  3.61k|    return r;
  172|  3.61k|}
ossl_sa_set:
  180|    540|{
  181|    540|    int i, level = 1;
  182|    540|    ossl_uintmax_t n = posn;
  183|    540|    void **p;
  184|       |
  185|    540|    if (sa == NULL)
  ------------------
  |  Branch (185:9): [True: 0, False: 540]
  ------------------
  186|      0|        return 0;
  187|       |
  188|  2.14k|    for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++)
  ------------------
  |  |   47|  2.14k|#define SA_BLOCK_MAX_LEVELS     (((int)sizeof(ossl_uintmax_t) * 8 \
  |  |   48|  2.14k|                                  + OPENSSL_SA_BLOCK_BITS - 1) \
  |  |  ------------------
  |  |  |  |   34|  2.14k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  |  |   49|  2.14k|                                 / OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  2.14k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (188:21): [True: 2.14k, False: 0]
  ------------------
  189|  2.14k|        if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0)
  ------------------
  |  |   34|  2.14k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
  |  Branch (189:13): [True: 540, False: 1.60k]
  ------------------
  190|    540|            break;
  191|       |
  192|    545|    for (;sa->levels < level; sa->levels++) {
  ------------------
  |  Branch (192:11): [True: 5, False: 540]
  ------------------
  193|      5|        p = alloc_node();
  194|      5|        if (p == NULL)
  ------------------
  |  Branch (194:13): [True: 0, False: 5]
  ------------------
  195|      0|            return 0;
  196|      5|        p[0] = sa->nodes;
  197|      5|        sa->nodes = p;
  198|      5|    }
  199|    540|    if (sa->top < posn)
  ------------------
  |  Branch (199:9): [True: 146, False: 394]
  ------------------
  200|    146|        sa->top = posn;
  201|       |
  202|    540|    p = sa->nodes;
  203|  2.45k|    for (level = sa->levels - 1; level > 0; level--) {
  ------------------
  |  Branch (203:34): [True: 1.91k, False: 540]
  ------------------
  204|  1.91k|        i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   34|  1.91k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
                      i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK;
  ------------------
  |  |   46|  1.91k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.91k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.91k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  1.91k|        if (p[i] == NULL && (p[i] = alloc_node()) == NULL)
  ------------------
  |  Branch (205:13): [True: 499, False: 1.41k]
  |  Branch (205:29): [True: 0, False: 499]
  ------------------
  206|      0|            return 0;
  207|  1.91k|        p = p[i];
  208|  1.91k|    }
  209|    540|    p += posn & SA_BLOCK_MASK;
  ------------------
  |  |   46|    540|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|    540|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|    540|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|    540|    if (val == NULL && *p != NULL)
  ------------------
  |  Branch (210:9): [True: 270, False: 270]
  |  Branch (210:24): [True: 270, False: 0]
  ------------------
  211|    270|        sa->nelem--;
  212|    270|    else if (val != NULL && *p == NULL)
  ------------------
  |  Branch (212:14): [True: 270, False: 0]
  |  Branch (212:29): [True: 270, False: 0]
  ------------------
  213|    270|        sa->nelem++;
  214|    540|    *p = val;
  215|    540|    return 1;
  216|    540|}
sparse_array.c:sa_doall:
   67|      8|{
   68|      8|    int i[SA_BLOCK_MAX_LEVELS];
   69|      8|    void *nodes[SA_BLOCK_MAX_LEVELS];
   70|      8|    ossl_uintmax_t idx = 0;
   71|      8|    int l = 0;
   72|       |
   73|      8|    i[0] = 0;
   74|      8|    nodes[0] = sa->nodes;
   75|  17.2k|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 17.2k, False: 8]
  ------------------
   76|  17.2k|        const int n = i[l];
   77|  17.2k|        void ** const p = nodes[l];
   78|       |
   79|  17.2k|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|  17.2k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|  17.2k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 1.01k, False: 16.2k]
  ------------------
   80|  1.01k|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 1.00k, False: 6]
  |  Branch (80:30): [True: 504, False: 504]
  ------------------
   81|    504|                (*node)(p);
   82|  1.01k|            l--;
   83|  1.01k|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|  1.01k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   84|  16.2k|        } else {
   85|  16.2k|            i[l] = n + 1;
   86|  16.2k|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 16.1k, False: 96]
  |  Branch (86:30): [True: 1.27k, False: 14.8k]
  ------------------
   87|  1.27k|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|  1.27k|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|  1.27k|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  1.27k|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|  1.27k|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 1.00k, False: 270]
  ------------------
   89|  1.00k|                    i[++l] = 0;
   90|  1.00k|                    nodes[l] = p[n];
   91|  1.00k|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|  1.00k|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   92|  1.00k|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 270, False: 0]
  ------------------
   93|    270|                    (*leaf)(idx, p[n], arg);
   94|    270|                }
   95|  1.27k|            }
   96|  16.2k|        }
   97|  17.2k|    }
   98|      8|}
sparse_array.c:sa_free_node:
  101|    504|{
  102|    504|    OPENSSL_free(p);
  ------------------
  |  |  115|    504|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    504|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    504|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    504|}
sparse_array.c:alloc_node:
  175|    504|{
  176|    504|    return OPENSSL_zalloc(SA_BLOCK_MAX * sizeof(void *));
  ------------------
  |  |  104|    504|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    504|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    504|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  177|    504|}

OPENSSL_sk_dup:
   49|    848|{
   50|    848|    OPENSSL_STACK *ret;
   51|       |
   52|    848|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (52:9): [True: 0, False: 848]
  ------------------
   53|      0|        goto err;
   54|       |
   55|    848|    if (sk == NULL) {
  ------------------
  |  Branch (55:9): [True: 1, False: 847]
  ------------------
   56|      1|        ret->num = 0;
   57|      1|        ret->sorted = 0;
   58|      1|        ret->comp = NULL;
   59|    847|    } else {
   60|       |        /* direct structure assignment */
   61|    847|        *ret = *sk;
   62|    847|    }
   63|       |
   64|    848|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (64:9): [True: 1, False: 847]
  |  Branch (64:23): [True: 0, False: 847]
  ------------------
   65|       |        /* postpone |ret->data| allocation */
   66|      1|        ret->data = NULL;
   67|      1|        ret->num_alloc = 0;
   68|      1|        return ret;
   69|      1|    }
   70|       |
   71|       |    /* duplicate |sk->data| content */
   72|    847|    ret->data = OPENSSL_malloc(sizeof(*ret->data) * sk->num_alloc);
  ------------------
  |  |  102|    847|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    847|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    847|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   73|    847|    if (ret->data == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 847]
  ------------------
   74|      0|        goto err;
   75|    847|    memcpy(ret->data, sk->data, sizeof(void *) * sk->num);
   76|    847|    return ret;
   77|       |
   78|      0| err:
   79|      0|    OPENSSL_sk_free(ret);
   80|      0|    return NULL;
   81|    847|}
OPENSSL_sk_deep_copy:
   86|      1|{
   87|      1|    OPENSSL_STACK *ret;
   88|      1|    int i;
   89|       |
   90|      1|    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
  ------------------
  |  |  102|      1|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (90:9): [True: 0, False: 1]
  ------------------
   91|      0|        goto err;
   92|       |
   93|      1|    if (sk == NULL) {
  ------------------
  |  Branch (93:9): [True: 1, False: 0]
  ------------------
   94|      1|        ret->num = 0;
   95|      1|        ret->sorted = 0;
   96|      1|        ret->comp = NULL;
   97|      1|    } else {
   98|       |        /* direct structure assignment */
   99|      0|        *ret = *sk;
  100|      0|    }
  101|       |
  102|      1|    if (sk == NULL || sk->num == 0) {
  ------------------
  |  Branch (102:9): [True: 1, False: 0]
  |  Branch (102:23): [True: 0, False: 0]
  ------------------
  103|       |        /* postpone |ret| data allocation */
  104|      1|        ret->data = NULL;
  105|      1|        ret->num_alloc = 0;
  106|      1|        return ret;
  107|      1|    }
  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|    660|{
  133|    660|    return OPENSSL_sk_new_reserve(NULL, 0);
  134|    660|}
OPENSSL_sk_new:
  137|     35|{
  138|     35|    return OPENSSL_sk_new_reserve(c, 0);
  139|     35|}
OPENSSL_sk_new_reserve:
  228|    695|{
  229|    695|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |  104|    695|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    695|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    695|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|       |
  231|    695|    if (st == NULL)
  ------------------
  |  Branch (231:9): [True: 0, False: 695]
  ------------------
  232|      0|        return NULL;
  233|       |
  234|    695|    st->comp = c;
  235|       |
  236|    695|    if (n <= 0)
  ------------------
  |  Branch (236:9): [True: 695, False: 0]
  ------------------
  237|    695|        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|  1.00k|{
  261|  1.00k|    if (st != NULL)
  ------------------
  |  Branch (261:9): [True: 342, False: 661]
  ------------------
  262|    342|        st->free_thunk = f_thunk;
  263|       |
  264|  1.00k|    return st;
  265|  1.00k|}
OPENSSL_sk_insert:
  268|  1.39k|{
  269|  1.39k|    if (st == NULL) {
  ------------------
  |  Branch (269:9): [True: 0, False: 1.39k]
  ------------------
  270|      0|        ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  271|      0|        return 0;
  272|      0|    }
  273|  1.39k|    if (st->num == max_nodes) {
  ------------------
  |  Branch (273:9): [True: 0, False: 1.39k]
  ------------------
  274|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  275|      0|        return 0;
  276|      0|    }
  277|       |
  278|  1.39k|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (278:9): [True: 0, False: 1.39k]
  ------------------
  279|      0|        return 0;
  280|       |
  281|  1.39k|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (281:9): [True: 1.39k, False: 0]
  |  Branch (281:29): [True: 0, False: 0]
  ------------------
  282|  1.39k|        st->data[st->num] = data;
  283|  1.39k|    } else {
  284|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  285|      0|                sizeof(st->data[0]) * (st->num - loc));
  286|      0|        st->data[loc] = data;
  287|      0|    }
  288|  1.39k|    st->num++;
  289|  1.39k|    st->sorted = 0;
  290|  1.39k|    return st->num;
  291|  1.39k|}
OPENSSL_sk_delete:
  319|      1|{
  320|      1|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (320:9): [True: 0, False: 1]
  |  Branch (320:23): [True: 0, False: 1]
  |  Branch (320:34): [True: 0, False: 1]
  ------------------
  321|      0|        return NULL;
  322|       |
  323|      1|    return internal_delete(st, loc);
  324|      1|}
OPENSSL_sk_find:
  392|      3|{
  393|      3|    return internal_find(st, data, OSSL_BSEARCH_FIRST_VALUE_ON_MATCH, NULL);
  ------------------
  |  |  153|      3|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  394|      3|}
OPENSSL_sk_push:
  407|  1.39k|{
  408|  1.39k|    if (st == NULL)
  ------------------
  |  Branch (408:9): [True: 0, False: 1.39k]
  ------------------
  409|      0|        return 0;
  410|  1.39k|    return OPENSSL_sk_insert(st, data, st->num);
  411|  1.39k|}
OPENSSL_sk_pop:
  426|    252|{
  427|    252|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (427:9): [True: 0, False: 252]
  |  Branch (427:23): [True: 0, False: 252]
  ------------------
  428|      0|        return NULL;
  429|    252|    return internal_delete(st, st->num - 1);
  430|    252|}
OPENSSL_sk_pop_free:
  441|  1.86k|{
  442|  1.86k|    int i;
  443|       |
  444|  1.86k|    if (st == NULL)
  ------------------
  |  Branch (444:9): [True: 1.30k, False: 567]
  ------------------
  445|  1.30k|        return;
  446|       |
  447|  1.69k|    for (i = 0; i < st->num; i++) {
  ------------------
  |  Branch (447:17): [True: 1.13k, False: 567]
  ------------------
  448|  1.13k|        if (st->data[i] != NULL) {
  ------------------
  |  Branch (448:13): [True: 1.13k, False: 0]
  ------------------
  449|  1.13k|            if (st->free_thunk != NULL)
  ------------------
  |  Branch (449:17): [True: 530, False: 600]
  ------------------
  450|    530|                st->free_thunk(func, (void *)st->data[i]);
  451|    600|            else
  452|    600|                func((void *)st->data[i]);
  453|  1.13k|        }
  454|  1.13k|    }
  455|    567|    OPENSSL_sk_free(st);
  456|    567|}
OPENSSL_sk_free:
  459|  2.18k|{
  460|  2.18k|    if (st == NULL)
  ------------------
  |  Branch (460:9): [True: 644, False: 1.54k]
  ------------------
  461|    644|        return;
  462|  1.54k|    OPENSSL_free(st->data);
  ------------------
  |  |  115|  1.54k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.54k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.54k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  463|  1.54k|    OPENSSL_free(st);
  ------------------
  |  |  115|  1.54k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.54k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.54k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  464|  1.54k|}
OPENSSL_sk_num:
  467|  5.78k|{
  468|  5.78k|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (468:12): [True: 1.27k, False: 4.50k]
  ------------------
  469|  5.78k|}
OPENSSL_sk_value:
  472|  3.81k|{
  473|  3.81k|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (473:9): [True: 0, False: 3.81k]
  |  Branch (473:23): [True: 0, False: 3.81k]
  |  Branch (473:32): [True: 0, False: 3.81k]
  ------------------
  474|      0|        return NULL;
  475|  3.81k|    return (void *)st->data[i];
  476|  3.81k|}
OPENSSL_sk_sort:
  495|     36|{
  496|     36|    if (st != NULL && !st->sorted && st->comp != NULL) {
  ------------------
  |  Branch (496:9): [True: 36, False: 0]
  |  Branch (496:23): [True: 34, False: 2]
  |  Branch (496:38): [True: 34, False: 0]
  ------------------
  497|     34|        if (st->num > 1)
  ------------------
  |  Branch (497:13): [True: 0, False: 34]
  ------------------
  498|      0|            qsort(st->data, st->num, sizeof(void *), st->comp);
  499|     34|        st->sorted = 1; /* empty or single-element stack is considered sorted */
  500|     34|    }
  501|     36|}
stack.c:sk_reserve:
  179|  1.39k|{
  180|  1.39k|    const void **tmpdata;
  181|  1.39k|    int num_alloc;
  182|       |
  183|       |    /* Check to see the reservation isn't exceeding the hard limit */
  184|  1.39k|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (184:9): [True: 0, False: 1.39k]
  ------------------
  185|      0|        ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  186|      0|        return 0;
  187|      0|    }
  188|       |
  189|       |    /* Figure out the new size */
  190|  1.39k|    num_alloc = st->num + n;
  191|  1.39k|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (191:9): [True: 1.07k, False: 317]
  ------------------
  192|  1.07k|        num_alloc = min_nodes;
  193|       |
  194|       |    /* If |st->data| allocation was postponed */
  195|  1.39k|    if (st->data == NULL) {
  ------------------
  |  Branch (195:9): [True: 660, False: 732]
  ------------------
  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|    660|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |  104|    660|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    660|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    660|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (200:13): [True: 0, False: 660]
  ------------------
  201|      0|            return 0;
  202|    660|        st->num_alloc = num_alloc;
  203|    660|        return 1;
  204|    660|    }
  205|       |
  206|    732|    if (!exact) {
  ------------------
  |  Branch (206:9): [True: 732, False: 0]
  ------------------
  207|    732|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (207:13): [True: 715, False: 17]
  ------------------
  208|    715|            return 1;
  209|     17|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  210|     17|        if (num_alloc == 0) {
  ------------------
  |  Branch (210:13): [True: 0, False: 17]
  ------------------
  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|     17|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (214:16): [True: 0, False: 0]
  ------------------
  215|      0|        return 1;
  216|      0|    }
  217|       |
  218|     17|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  109|     17|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     17|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     17|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|     17|    if (tmpdata == NULL)
  ------------------
  |  Branch (219:9): [True: 0, False: 17]
  ------------------
  220|      0|        return 0;
  221|       |
  222|     17|    st->data = tmpdata;
  223|     17|    st->num_alloc = num_alloc;
  224|     17|    return 1;
  225|     17|}
stack.c:compute_growth:
  161|     17|{
  162|     17|    int err = 0;
  163|       |
  164|     34|    while (current < target) {
  ------------------
  |  Branch (164:12): [True: 17, False: 17]
  ------------------
  165|     17|        if (current >= max_nodes)
  ------------------
  |  Branch (165:13): [True: 0, False: 17]
  ------------------
  166|      0|            return 0;
  167|       |
  168|     17|        current = safe_muldiv_int(current, 8, 5, &err);
  169|     17|        if (err != 0)
  ------------------
  |  Branch (169:13): [True: 0, False: 17]
  ------------------
  170|      0|            return 0;
  171|     17|        if (current >= max_nodes)
  ------------------
  |  Branch (171:13): [True: 0, False: 17]
  ------------------
  172|      0|            current = max_nodes;
  173|     17|    }
  174|     17|    return current;
  175|     17|}
stack.c:internal_delete:
  294|    253|{
  295|    253|    const void *ret = st->data[loc];
  296|       |
  297|    253|    if (loc != st->num - 1)
  ------------------
  |  Branch (297:9): [True: 0, False: 253]
  ------------------
  298|      0|        memmove(&st->data[loc], &st->data[loc + 1],
  299|      0|                sizeof(st->data[0]) * (st->num - loc - 1));
  300|    253|    st->num--;
  301|       |
  302|    253|    return (void *)ret;
  303|    253|}
stack.c:internal_find:
  328|      3|{
  329|      3|    const void *r;
  330|      3|    int i, count = 0;
  331|      3|    int *pnum = pnum_matched;
  332|       |
  333|      3|    if (st == NULL || st->num == 0)
  ------------------
  |  Branch (333:9): [True: 0, False: 3]
  |  Branch (333:23): [True: 0, False: 3]
  ------------------
  334|      0|        return -1;
  335|       |
  336|      3|    if (pnum == NULL)
  ------------------
  |  Branch (336:9): [True: 3, False: 0]
  ------------------
  337|      3|        pnum = &count;
  338|       |
  339|      3|    if (st->comp == NULL) {
  ------------------
  |  Branch (339:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (data == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 3]
  ------------------
  350|      0|        return -1;
  351|       |
  352|      3|    if (!st->sorted) {
  ------------------
  |  Branch (352:9): [True: 0, False: 3]
  ------------------
  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|      3|    if (pnum_matched != NULL)
  ------------------
  |  Branch (369:9): [True: 0, False: 3]
  ------------------
  370|      0|        ret_val_options |= OSSL_BSEARCH_FIRST_VALUE_ON_MATCH;
  ------------------
  |  |  153|      0|# define OSSL_BSEARCH_FIRST_VALUE_ON_MATCH        0x02
  ------------------
  371|      3|    r = ossl_bsearch(&data, st->data, st->num, sizeof(void *), st->comp,
  372|      3|                     ret_val_options);
  373|       |
  374|      3|    if (pnum_matched != NULL) {
  ------------------
  |  Branch (374:9): [True: 0, False: 3]
  ------------------
  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|      3|    return r == NULL ? -1 : (int)((const void **)r - st->data);
  ------------------
  |  Branch (388:12): [True: 0, False: 3]
  ------------------
  389|      3|}

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

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

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

ossl_crypto_mutex_new:
   97|      1|{
   98|      1|    pthread_mutex_t *mutex;
   99|       |
  100|      1|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 0, False: 1]
  ------------------
  101|      0|        return NULL;
  102|      1|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1]
  ------------------
  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|      1|    return (CRYPTO_MUTEX *)mutex;
  107|      1|}
ossl_crypto_mutex_free:
  142|      1|{
  143|      1|    pthread_mutex_t **mutex_p;
  144|       |
  145|      1|    if (mutex == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 1]
  ------------------
  146|      0|        return;
  147|       |
  148|      1|    mutex_p = (pthread_mutex_t **)mutex;
  149|      1|    if (*mutex_p != NULL)
  ------------------
  |  Branch (149:9): [True: 1, False: 0]
  ------------------
  150|      1|        pthread_mutex_destroy(*mutex_p);
  151|      1|    OPENSSL_free(*mutex_p);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  152|      1|    *mutex = NULL;
  153|      1|}
ossl_crypto_condvar_new:
  156|      1|{
  157|      1|    pthread_cond_t *cv_p;
  158|       |
  159|      1|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 1]
  ------------------
  160|      0|        return NULL;
  161|      1|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 1]
  ------------------
  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|      1|    return (CRYPTO_CONDVAR *) cv_p;
  166|      1|}
ossl_crypto_condvar_free:
  220|      1|{
  221|      1|    pthread_cond_t **cv_p;
  222|       |
  223|      1|    if (cv == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 1]
  ------------------
  224|      0|        return;
  225|       |
  226|      1|    cv_p = (pthread_cond_t **)cv;
  227|      1|    if (*cv_p != NULL)
  ------------------
  |  Branch (227:9): [True: 1, False: 0]
  ------------------
  228|      1|        pthread_cond_destroy(*cv_p);
  229|      1|    OPENSSL_free(*cv_p);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  230|      1|    *cv_p = NULL;
  231|      1|}

ossl_threads_ctx_new:
  128|      1|{
  129|      1|    struct openssl_threads_st *t = OPENSSL_zalloc(sizeof(*t));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  130|       |
  131|      1|    if (t == NULL)
  ------------------
  |  Branch (131:9): [True: 0, False: 1]
  ------------------
  132|      0|        return NULL;
  133|       |
  134|      1|    t->lock = ossl_crypto_mutex_new();
  135|      1|    t->cond_finished = ossl_crypto_condvar_new();
  136|       |
  137|      1|    if (t->lock == NULL || t->cond_finished == NULL)
  ------------------
  |  Branch (137:9): [True: 0, False: 1]
  |  Branch (137:28): [True: 0, False: 1]
  ------------------
  138|      0|        goto fail;
  139|       |
  140|      1|    return t;
  141|       |
  142|      0|fail:
  143|      0|    ossl_threads_ctx_free((void *)t);
  144|      0|    return NULL;
  145|      1|}
ossl_threads_ctx_free:
  148|      1|{
  149|      1|    OSSL_LIB_CTX_THREADS *t = (OSSL_LIB_CTX_THREADS *) vdata;
  150|       |
  151|      1|    if (t == NULL)
  ------------------
  |  Branch (151:9): [True: 0, False: 1]
  ------------------
  152|      0|        return;
  153|       |
  154|      1|    ossl_crypto_mutex_free(&t->lock);
  155|      1|    ossl_crypto_condvar_free(&t->cond_finished);
  156|      1|    OPENSSL_free(t);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  157|      1|}

ossl_rcu_write_lock:
  441|      3|{
  442|      3|    pthread_mutex_lock(&lock->write_lock);
  443|      3|    TSAN_FAKE_UNLOCK(&lock->write_lock);
  444|      3|}
ossl_rcu_write_unlock:
  447|      3|{
  448|      3|    TSAN_FAKE_LOCK(&lock->write_lock);
  449|      3|    pthread_mutex_unlock(&lock->write_lock);
  450|      3|}
ossl_synchronize_rcu:
  453|      5|{
  454|      5|    struct rcu_qp *qp;
  455|      5|    uint64_t count;
  456|      5|    uint32_t curr_id;
  457|      5|    struct rcu_cb_item *cb_items, *tmpcb;
  458|       |
  459|      5|    pthread_mutex_lock(&lock->write_lock);
  460|      5|    cb_items = lock->cb_items;
  461|      5|    lock->cb_items = NULL;
  462|      5|    pthread_mutex_unlock(&lock->write_lock);
  463|       |
  464|      5|    qp = update_qp(lock, &curr_id);
  465|       |
  466|       |    /* retire in order */
  467|      5|    pthread_mutex_lock(&lock->prior_lock);
  468|      5|    while (lock->next_to_retire != curr_id)
  ------------------
  |  Branch (468:12): [True: 0, False: 5]
  ------------------
  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|      5|    do {
  481|      5|        count = ATOMIC_LOAD_N(uint64_t, &qp->users, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|      5|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  482|      5|    } while (count != (uint64_t)0);
  ------------------
  |  Branch (482:14): [True: 0, False: 5]
  ------------------
  483|       |
  484|      5|    lock->next_to_retire++;
  485|      5|    pthread_cond_broadcast(&lock->prior_signal);
  486|      5|    pthread_mutex_unlock(&lock->prior_lock);
  487|       |
  488|      5|    retire_qp(lock, qp);
  489|       |
  490|       |    /* handle any callbacks that we have */
  491|      6|    while (cb_items != NULL) {
  ------------------
  |  Branch (491:12): [True: 1, False: 5]
  ------------------
  492|      1|        tmpcb = cb_items;
  493|      1|        cb_items = cb_items->next;
  494|      1|        tmpcb->fn(tmpcb->data);
  495|      1|        OPENSSL_free(tmpcb);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  496|      1|    }
  497|      5|}
ossl_rcu_call:
  504|      1|{
  505|      1|    struct rcu_cb_item *new =
  506|      1|        OPENSSL_zalloc(sizeof(*new));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  507|       |
  508|      1|    if (new == NULL)
  ------------------
  |  Branch (508:9): [True: 0, False: 1]
  ------------------
  509|      0|        return 0;
  510|       |
  511|      1|    new->data = data;
  512|      1|    new->fn = cb;
  513|       |
  514|      1|    new->next = lock->cb_items;
  515|      1|    lock->cb_items = new;
  516|       |
  517|      1|    return 1;
  518|      1|}
ossl_rcu_uptr_deref:
  521|  12.9k|{
  522|  12.9k|    return ATOMIC_LOAD_N(pvoid, p, __ATOMIC_ACQUIRE);
  ------------------
  |  |   96|  12.9k|#  define ATOMIC_LOAD_N(t, p, o) __atomic_load_n(p, o)
  ------------------
  523|  12.9k|}
ossl_rcu_assign_uptr:
  526|    603|{
  527|    603|    ATOMIC_STORE(pvoid, p, v, __ATOMIC_RELEASE);
  ------------------
  |  |   98|    603|#  define ATOMIC_STORE(t, p, v, o) __atomic_store(p, v, o)
  ------------------
  528|    603|}
ossl_rcu_lock_new:
  531|      2|{
  532|      2|    struct rcu_lock_st *new;
  533|       |
  534|       |    /*
  535|       |     * We need a minimum of 2 qp's
  536|       |     */
  537|      2|    if (num_writers < 2)
  ------------------
  |  Branch (537:9): [True: 2, False: 0]
  ------------------
  538|      2|        num_writers = 2;
  539|       |
  540|      2|    ctx = ossl_lib_ctx_get_concrete(ctx);
  541|      2|    if (ctx == NULL)
  ------------------
  |  Branch (541:9): [True: 0, False: 2]
  ------------------
  542|      0|        return 0;
  543|       |
  544|      2|    new = 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__
  |  |  ------------------
  ------------------
  545|      2|    if (new == NULL)
  ------------------
  |  Branch (545:9): [True: 0, False: 2]
  ------------------
  546|      0|        return NULL;
  547|       |
  548|      2|    new->ctx = ctx;
  549|      2|    pthread_mutex_init(&new->write_lock, NULL);
  550|      2|    pthread_mutex_init(&new->prior_lock, NULL);
  551|      2|    pthread_mutex_init(&new->alloc_lock, NULL);
  552|      2|    pthread_cond_init(&new->prior_signal, NULL);
  553|      2|    pthread_cond_init(&new->alloc_signal, NULL);
  554|       |
  555|      2|    new->qp_group = allocate_new_qp_group(new, num_writers);
  556|      2|    if (new->qp_group == NULL) {
  ------------------
  |  Branch (556:9): [True: 0, False: 2]
  ------------------
  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|      2|    return new;
  562|      2|}
ossl_rcu_lock_free:
  565|      2|{
  566|      2|    struct rcu_lock_st *rlock = (struct rcu_lock_st *)lock;
  567|       |
  568|      2|    if (lock == NULL)
  ------------------
  |  Branch (568:9): [True: 0, False: 2]
  ------------------
  569|      0|        return;
  570|       |
  571|       |    /* make sure we're synchronized */
  572|      2|    ossl_synchronize_rcu(rlock);
  573|       |
  574|      2|    OPENSSL_free(rlock->qp_group);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  575|       |    /* There should only be a single qp left now */
  576|      2|    OPENSSL_free(rlock);
  ------------------
  |  |  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|}
CRYPTO_THREAD_lock_new:
  580|    671|{
  581|    671|# ifdef USE_RWLOCK
  582|    671|    CRYPTO_RWLOCK *lock;
  583|       |
  584|    671|    if ((lock = OPENSSL_zalloc(sizeof(pthread_rwlock_t))) == NULL)
  ------------------
  |  |  104|    671|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    671|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    671|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (584:9): [True: 0, False: 671]
  ------------------
  585|       |        /* Don't set error, to avoid recursion blowup. */
  586|      0|        return NULL;
  587|       |
  588|    671|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (588:9): [True: 0, False: 671]
  ------------------
  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|    671|    return lock;
  622|    671|}
CRYPTO_THREAD_read_lock:
  625|  10.4k|{
  626|  10.4k|# ifdef USE_RWLOCK
  627|  10.4k|    if (!ossl_assert(pthread_rwlock_rdlock(lock) == 0))
  ------------------
  |  |   52|  10.4k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  10.4k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (627:9): [True: 0, False: 10.4k]
  ------------------
  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|  10.4k|    return 1;
  637|  10.4k|}
CRYPTO_THREAD_write_lock:
  640|  2.05k|{
  641|  2.05k|# ifdef USE_RWLOCK
  642|  2.05k|    if (!ossl_assert(pthread_rwlock_wrlock(lock) == 0))
  ------------------
  |  |   52|  2.05k|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|  2.05k|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (642:9): [True: 0, False: 2.05k]
  ------------------
  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.05k|    return 1;
  652|  2.05k|}
CRYPTO_THREAD_unlock:
  655|  12.4k|{
  656|  12.4k|# ifdef USE_RWLOCK
  657|  12.4k|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (657:9): [True: 0, False: 12.4k]
  ------------------
  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|  12.4k|    return 1;
  667|  12.4k|}
CRYPTO_THREAD_lock_free:
  670|    678|{
  671|    678|    if (lock == NULL)
  ------------------
  |  Branch (671:9): [True: 7, False: 671]
  ------------------
  672|      7|        return;
  673|       |
  674|    671|# ifdef USE_RWLOCK
  675|    671|    pthread_rwlock_destroy(lock);
  676|       |# else
  677|       |    pthread_mutex_destroy(lock);
  678|       |# endif
  679|    671|    OPENSSL_free(lock);
  ------------------
  |  |  115|    671|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    671|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    671|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  680|       |
  681|    671|    return;
  682|    678|}
CRYPTO_THREAD_run_once:
  685|  28.7k|{
  686|  28.7k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (686:9): [True: 0, False: 28.7k]
  ------------------
  687|      0|        return 0;
  688|       |
  689|  28.7k|    return 1;
  690|  28.7k|}
CRYPTO_THREAD_init_local:
  693|      7|{
  694|      7|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (694:9): [True: 0, False: 7]
  ------------------
  695|      0|        return 0;
  696|       |
  697|      7|    return 1;
  698|      7|}
CRYPTO_THREAD_get_local:
  701|  14.6k|{
  702|  14.6k|    return pthread_getspecific(*key);
  703|  14.6k|}
CRYPTO_THREAD_set_local:
  706|     12|{
  707|     12|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (707:9): [True: 0, False: 12]
  ------------------
  708|      0|        return 0;
  709|       |
  710|     12|    return 1;
  711|     12|}
CRYPTO_THREAD_cleanup_local:
  714|      7|{
  715|      7|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (715:9): [True: 0, False: 7]
  ------------------
  716|      0|        return 0;
  717|       |
  718|      7|    return 1;
  719|      7|}
CRYPTO_atomic_add:
  732|     62|{
  733|     62|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  734|     62|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (734:9): [Folded - Ignored]
  ------------------
  735|     62|        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);
  736|     62|        return 1;
  737|     62|    }
  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|      3|{
  812|      3|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  813|      3|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (813:9): [Folded - Ignored]
  ------------------
  814|      3|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  815|      3|        return 1;
  816|      3|    }
  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|   403M|{
  837|   403M|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  838|   403M|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (838:9): [Folded - Ignored]
  ------------------
  839|   403M|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  840|   403M|        return 1;
  841|   403M|    }
  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|    600|{
  860|    600|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  861|    600|    if (__atomic_is_lock_free(sizeof(*dst), dst)) {
  ------------------
  |  Branch (861:9): [Folded - Ignored]
  ------------------
  862|    600|        __atomic_store(dst, &val, __ATOMIC_RELEASE);
  863|    600|        return 1;
  864|    600|    }
  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|}
openssl_get_fork_id:
  912|  1.32k|{
  913|  1.32k|    return getpid();
  914|  1.32k|}
threads_pthread.c:update_qp:
  380|      5|{
  381|      5|    uint32_t current_idx;
  382|       |
  383|      5|    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|      5|    while (lock->group_count - lock->writers_alloced < 2)
  ------------------
  |  Branch (390:12): [True: 0, False: 5]
  ------------------
  391|       |        /* we have to wait for one to be free */
  392|      0|        pthread_cond_wait(&lock->alloc_signal, &lock->alloc_lock);
  393|       |
  394|      5|    current_idx = lock->current_alloc_idx;
  395|       |
  396|       |    /* Allocate the qp */
  397|      5|    lock->writers_alloced++;
  398|       |
  399|       |    /* increment the allocation index */
  400|      5|    lock->current_alloc_idx =
  401|      5|        (lock->current_alloc_idx + 1) % lock->group_count;
  402|       |
  403|      5|    *curr_id = lock->id_ctr;
  404|      5|    lock->id_ctr++;
  405|       |
  406|      5|    ATOMIC_STORE_N(uint32_t, &lock->reader_idx, lock->current_alloc_idx,
  ------------------
  |  |   97|      5|#  define ATOMIC_STORE_N(t, p, v, o) __atomic_store_n(p, v, o)
  ------------------
  407|      5|                   __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|      5|    ATOMIC_ADD_FETCH(&lock->qp_group[current_idx].users, (uint64_t)0,
  ------------------
  |  |   99|      5|#  define ATOMIC_ADD_FETCH(p, v, o) __atomic_add_fetch(p, v, o)
  ------------------
  414|      5|                     __ATOMIC_RELEASE);
  415|       |
  416|       |    /* wake up any waiters */
  417|      5|    pthread_cond_signal(&lock->alloc_signal);
  418|      5|    pthread_mutex_unlock(&lock->alloc_lock);
  419|      5|    return &lock->qp_group[current_idx];
  420|      5|}
threads_pthread.c:retire_qp:
  423|      5|{
  424|      5|    pthread_mutex_lock(&lock->alloc_lock);
  425|      5|    lock->writers_alloced--;
  426|      5|    pthread_cond_signal(&lock->alloc_signal);
  427|      5|    pthread_mutex_unlock(&lock->alloc_lock);
  428|      5|}
threads_pthread.c:allocate_new_qp_group:
  432|      2|{
  433|      2|    struct rcu_qp *new =
  434|      2|        OPENSSL_zalloc(sizeof(*new) * count);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  435|       |
  436|      2|    lock->group_count = count;
  437|      2|    return new;
  438|      2|}

ossl_trace_cleanup:
  340|      1|{
  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|      1|}
OSSL_trace_set_channel:
  362|      1|{
  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|      1|    return 0;
  369|      1|}

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

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

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

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

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

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

FuzzerInitialize:
  550|      2|{
  551|      2|    return 0;
  552|      2|}
FuzzerTestOneInput:
  571|    443|{
  572|    443|    uint8_t operation;
  573|    443|    uint8_t *buffer_cursor;
  574|    443|    void *in1 = NULL, *in2 = NULL;
  575|    443|    void *out1 = NULL, *out2 = NULL;
  576|       |
  577|    443|    if (len < 32)
  ------------------
  |  Branch (577:9): [True: 8, False: 435]
  ------------------
  578|      8|        return -1;
  579|       |    /*
  580|       |     * Get the first byte of the buffer to tell us what operation
  581|       |     * to preform
  582|       |     */
  583|    435|    buffer_cursor = consume_uint8t(buf, &len, &operation);
  584|    435|    if (buffer_cursor == NULL)
  ------------------
  |  Branch (584:9): [True: 0, False: 435]
  ------------------
  585|      0|        return -1;
  586|       |
  587|       |    /*
  588|       |     * Adjust for operational array size
  589|       |     */
  590|    435|    operation %= OSSL_NELEM(ops);
  ------------------
  |  |   14|    435|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  591|       |
  592|       |    /*
  593|       |     * And run our setup/doit/cleanup sequence
  594|       |     */
  595|    435|    if (ops[operation].setup != NULL)
  ------------------
  |  Branch (595:9): [True: 102, False: 333]
  ------------------
  596|    102|        ops[operation].setup(&buffer_cursor, &len, &in1, &in2);
  597|    435|    if (ops[operation].doit != NULL)
  ------------------
  |  Branch (597:9): [True: 396, False: 39]
  ------------------
  598|    396|        ops[operation].doit(&buffer_cursor, &len, in1, in2, &out1, &out2);
  599|    435|    if (ops[operation].cleanup != NULL)
  ------------------
  |  Branch (599:9): [True: 435, False: 0]
  ------------------
  600|    435|        ops[operation].cleanup(in1, in2, out1, out2);
  601|       |
  602|    435|    return 0;
  603|    435|}
slh-dsa.c:consume_uint8t:
   38|  1.28k|{
   39|  1.28k|    if (*len < sizeof(uint8_t))
  ------------------
  |  Branch (39:9): [True: 0, False: 1.28k]
  ------------------
   40|      0|        return NULL;
   41|  1.28k|    *val = *buf;
   42|  1.28k|    *len -= sizeof(uint8_t);
   43|  1.28k|    return (uint8_t *)buf + 1;
   44|  1.28k|}
slh-dsa.c:slh_dsa_gen_keys:
  170|     78|{
  171|     78|    uint8_t selector = 0;
  172|     78|    const char *keytype = NULL;
  173|     78|    uint32_t keysize;
  174|       |
  175|     78|    *buf = consume_uint8t(*buf, len, &selector);
  176|     78|    keytype = select_keytype(selector, &keysize);
  177|     78|    *out1 = (void *)slh_dsa_gen_key(keytype, keysize, NULL, 0);
  178|       |
  179|     78|    *buf = consume_uint8t(*buf, len, &selector);
  180|     78|    keytype = select_keytype(selector, &keysize);
  181|     78|    *out2 = (void *)slh_dsa_gen_key(keytype, keysize, NULL, 0);
  182|     78|    return;
  183|     78|}
slh-dsa.c:select_keytype:
  108|    513|{
  109|    513|    unsigned int choice;
  110|    513|    const char *name = NULL;
  111|       |
  112|    513|    *keysize = 0;
  113|       |    /*
  114|       |     * There are 12 SLH-DSA algs with registered NIDS at the moment
  115|       |     * So use our random selector value to get one of them by computing
  116|       |     * its modulo 12 value and adding the offset of the first NID, 1460
  117|       |     * Then convert that to a long name
  118|       |     */
  119|    513|    choice = (selector % 12) + 1460;
  120|       |
  121|    513|    name = OBJ_nid2ln(choice);
  122|       |
  123|       |    /*
  124|       |     * Select a keysize, values taken from
  125|       |     * man7/EVP_PKEY-SLH-DSA.pod
  126|       |     */
  127|    513|    switch (choice) {
  128|     48|    case NID_SLH_DSA_SHA2_128s:
  ------------------
  |  | 3451|     48|#define NID_SLH_DSA_SHA2_128s           1460
  ------------------
  |  Branch (128:5): [True: 48, False: 465]
  ------------------
  129|    126|    case NID_SLH_DSA_SHA2_128f:
  ------------------
  |  | 3456|    126|#define NID_SLH_DSA_SHA2_128f           1461
  ------------------
  |  Branch (129:5): [True: 78, False: 435]
  ------------------
  130|    140|    case NID_SLH_DSA_SHAKE_128s:
  ------------------
  |  | 3481|    140|#define NID_SLH_DSA_SHAKE_128s          1466
  ------------------
  |  Branch (130:5): [True: 14, False: 499]
  ------------------
  131|    167|    case NID_SLH_DSA_SHAKE_128f:
  ------------------
  |  | 3486|    167|#define NID_SLH_DSA_SHAKE_128f          1467
  ------------------
  |  Branch (131:5): [True: 27, False: 486]
  ------------------
  132|    167|        *keysize = 16;
  133|    167|        break;
  134|     29|    case NID_SLH_DSA_SHA2_192s:
  ------------------
  |  | 3461|     29|#define NID_SLH_DSA_SHA2_192s           1462
  ------------------
  |  Branch (134:5): [True: 29, False: 484]
  ------------------
  135|    121|    case NID_SLH_DSA_SHA2_192f:
  ------------------
  |  | 3466|    121|#define NID_SLH_DSA_SHA2_192f           1463
  ------------------
  |  Branch (135:5): [True: 92, False: 421]
  ------------------
  136|    142|    case NID_SLH_DSA_SHAKE_192s:
  ------------------
  |  | 3491|    142|#define NID_SLH_DSA_SHAKE_192s          1468
  ------------------
  |  Branch (136:5): [True: 21, False: 492]
  ------------------
  137|    196|    case NID_SLH_DSA_SHAKE_192f:
  ------------------
  |  | 3496|    196|#define NID_SLH_DSA_SHAKE_192f          1469
  ------------------
  |  Branch (137:5): [True: 54, False: 459]
  ------------------
  138|    196|        *keysize = 24;
  139|    196|        break;
  140|     39|    case NID_SLH_DSA_SHA2_256s:
  ------------------
  |  | 3471|     39|#define NID_SLH_DSA_SHA2_256s           1464
  ------------------
  |  Branch (140:5): [True: 39, False: 474]
  ------------------
  141|     88|    case NID_SLH_DSA_SHA2_256f:
  ------------------
  |  | 3476|     88|#define NID_SLH_DSA_SHA2_256f           1465
  ------------------
  |  Branch (141:5): [True: 49, False: 464]
  ------------------
  142|    125|    case NID_SLH_DSA_SHAKE_256s:
  ------------------
  |  | 3501|    125|#define NID_SLH_DSA_SHAKE_256s          1470
  ------------------
  |  Branch (142:5): [True: 37, False: 476]
  ------------------
  143|    150|    case NID_SLH_DSA_SHAKE_256f:
  ------------------
  |  | 3506|    150|#define NID_SLH_DSA_SHAKE_256f          1471
  ------------------
  |  Branch (143:5): [True: 25, False: 488]
  ------------------
  144|    150|        *keysize = 32;
  145|    150|        break;
  146|      0|    default:
  ------------------
  |  Branch (146:5): [True: 0, False: 513]
  ------------------
  147|      0|        fprintf(stderr, "Selecting invalid key size\n");
  148|      0|        *keysize = 0;
  149|      0|        break;
  150|    513|    }
  151|    513|    return name;
  152|    513|}
slh-dsa.c:slh_dsa_gen_key:
   63|    513|{
   64|    513|    EVP_PKEY_CTX *ctx;
   65|    513|    EVP_PKEY *new = NULL;
   66|    513|    int rc;
   67|       |
   68|    513|    ctx = EVP_PKEY_CTX_new_from_name(NULL, name, NULL);
   69|    513|    OPENSSL_assert(ctx != NULL);
  ------------------
  |  |  438|    513|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 513, False: 0]
  |  |  ------------------
  ------------------
   70|    513|    if (params != NULL) {
  ------------------
  |  Branch (70:9): [True: 24, False: 489]
  ------------------
   71|     24|        new = EVP_PKEY_new();
   72|     24|        OPENSSL_assert(EVP_PKEY_fromdata_init(ctx));
  ------------------
  |  |  438|     24|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 24, False: 0]
  |  |  ------------------
  ------------------
   73|     24|        if (*param_broken) {
  ------------------
  |  Branch (73:13): [True: 19, False: 5]
  ------------------
   74|     19|            rc = EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params);
  ------------------
  |  |  113|     19|    ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  111|     19|    ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|     19|    ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  647|     19|    ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS     \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  642|     19|# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS      0x04
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  648|     19|      | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  643|     19|# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS       0x80
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|     19|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY )
  |  |  ------------------
  |  |  |  |  640|     19|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  ------------------
   75|     19|            OPENSSL_assert(rc == 0);
  ------------------
  |  |  438|     19|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 19, False: 0]
  |  |  ------------------
  ------------------
   76|     19|            EVP_PKEY_free(new);
   77|     19|            new = NULL;
   78|     19|        } else {
   79|      5|            OPENSSL_assert(EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params) == 1);
  ------------------
  |  |  438|      5|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 5, False: 0]
  |  |  ------------------
  ------------------
   80|      5|        }
   81|     24|        goto out;
   82|     24|    }
   83|       |
   84|    489|    OPENSSL_assert(EVP_PKEY_keygen_init(ctx));
  ------------------
  |  |  438|    489|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 489, False: 0]
  |  |  ------------------
  ------------------
   85|    489|    OPENSSL_assert(EVP_PKEY_generate(ctx, &new));
  ------------------
  |  |  438|    489|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 489, False: 0]
  |  |  ------------------
  ------------------
   86|       |
   87|    513|out:
   88|    513|    EVP_PKEY_CTX_free(ctx);
   89|    513|    return new;
   90|    489|}
slh-dsa.c:slh_dsa_clean_keys:
  283|    435|{
  284|    435|    EVP_PKEY_free((EVP_PKEY *)in1);
  285|    435|    EVP_PKEY_free((EVP_PKEY *)in2);
  286|    435|    EVP_PKEY_free((EVP_PKEY *)out1);
  287|    435|    EVP_PKEY_free((EVP_PKEY *)out2);
  288|    435|}
slh-dsa.c:slh_dsa_gen_key_with_params:
  207|     24|{
  208|     24|    uint8_t selector = 0;
  209|     24|    const char *keytype = NULL;
  210|     24|    uint32_t keysize;
  211|     24|    uint8_t pubbuf[PARAM_BUF_SZ]; /* expressly bigger than max key size * 3 */
  212|     24|    uint8_t prvbuf[PARAM_BUF_SZ]; /* expressly bigger than max key size * 3 */
  213|     24|    uint8_t sdbuf[PARAM_BUF_SZ]; /* expressly bigger than max key size * 3 */
  214|     24|    uint8_t *bufptr;
  215|     24|    OSSL_PARAM params[3];
  216|     24|    size_t buflen;
  217|     24|    uint8_t broken = 0;
  218|       |
  219|     24|    *out1 = NULL;
  220|       |
  221|     24|    *buf = consume_uint8t(*buf, len, &selector);
  222|     24|    keytype = select_keytype(selector, &keysize);
  223|       |
  224|     24|    RAND_bytes(pubbuf, PARAM_BUF_SZ);
  ------------------
  |  |  185|     24|#define PARAM_BUF_SZ 256
  ------------------
  225|     24|    RAND_bytes(prvbuf, PARAM_BUF_SZ);
  ------------------
  |  |  185|     24|#define PARAM_BUF_SZ 256
  ------------------
  226|     24|    RAND_bytes(sdbuf, PARAM_BUF_SZ);
  ------------------
  |  |  185|     24|#define PARAM_BUF_SZ 256
  ------------------
  227|       |
  228|       |    /*
  229|       |     * select an invalid length if the buffer 0th bit is one
  230|       |     * make it too big if the 2nd bit is 0, smaller otherwise
  231|       |     */
  232|     24|    buflen = keysize * 2; /* these params are 2 * the keysize */
  233|     24|    if ((*buf)[0] & 0x1) {
  ------------------
  |  Branch (233:9): [True: 13, False: 11]
  ------------------
  234|     13|        buflen = ((*buf)[0] & 0x2) ? buflen - 1 : buflen + 1;
  ------------------
  |  Branch (234:18): [True: 8, False: 5]
  ------------------
  235|     13|        broken = 1;
  236|     13|    }
  237|       |
  238|       |    /* pass a null buffer if the third bit of the buffer is 1 */
  239|     24|    bufptr = ((*buf)[0] & 0x4) ? NULL : pubbuf;
  ------------------
  |  Branch (239:14): [True: 10, False: 14]
  ------------------
  240|     24|    if (!broken)
  ------------------
  |  Branch (240:9): [True: 11, False: 13]
  ------------------
  241|     11|        broken = (bufptr == NULL) ? 1 : 0;
  ------------------
  |  Branch (241:18): [True: 5, False: 6]
  ------------------
  242|       |
  243|     24|    params[0] = OSSL_PARAM_construct_octet_string(OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  433|     24|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  244|     24|                                                  (char *)bufptr, buflen);
  245|       |
  246|     24|    buflen = keysize * 2;
  247|       |    /* select an invalid length if the 4th bit is true  */
  248|     24|    if ((*buf)[0] & 0x8) {
  ------------------
  |  Branch (248:9): [True: 8, False: 16]
  ------------------
  249|      8|        buflen = (*buf[0] & 0x1) ? buflen - 1 : buflen + 1;
  ------------------
  |  Branch (249:18): [True: 5, False: 3]
  ------------------
  250|      8|        broken = 1;
  251|      8|    }
  252|       |
  253|       |    /* pass a null buffer if the 5th bit is true */
  254|     24|    bufptr = ((*buf)[0] & 0x10) ? NULL : prvbuf;
  ------------------
  |  Branch (254:14): [True: 4, False: 20]
  ------------------
  255|     24|    if (!broken)
  ------------------
  |  Branch (255:9): [True: 5, False: 19]
  ------------------
  256|      5|        broken = (bufptr == NULL) ? 1 : 0;
  ------------------
  |  Branch (256:18): [True: 0, False: 5]
  ------------------
  257|     24|    params[1] = OSSL_PARAM_construct_octet_string(OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  431|     24|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  258|     24|                                                  (char *)bufptr, buflen);
  259|       |
  260|     24|    params[2] = OSSL_PARAM_construct_end();
  261|       |
  262|     24|    *out1 = (void *)slh_dsa_gen_key(keytype, keysize, params, &broken);
  263|       |
  264|     24|    if (broken)
  ------------------
  |  Branch (264:9): [True: 19, False: 5]
  ------------------
  265|     19|        OPENSSL_assert(*out1 == NULL);
  ------------------
  |  |  438|     19|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 19, False: 0]
  |  |  ------------------
  ------------------
  266|      5|    else
  267|      5|        OPENSSL_assert(*out1 != NULL);
  ------------------
  |  |  438|      5|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 5, False: 0]
  |  |  ------------------
  ------------------
  268|     24|    return;
  269|     24|}
slh-dsa.c:slh_dsa_export_import:
  419|     63|{
  420|     63|    int rc;
  421|     63|    EVP_PKEY *alice = (EVP_PKEY *)key1;
  422|     63|    EVP_PKEY *bob = (EVP_PKEY *)key2;
  423|     63|    EVP_PKEY *new = NULL;
  424|     63|    EVP_PKEY_CTX *ctx = NULL;
  425|     63|    OSSL_PARAM *params = NULL;
  426|       |
  427|     63|    OPENSSL_assert(EVP_PKEY_todata(alice, EVP_PKEY_KEYPAIR, &params) == 1);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  428|       |
  429|     63|    ctx = EVP_PKEY_CTX_new_from_pkey(NULL, alice, NULL);
  430|     63|    OPENSSL_assert(ctx != NULL);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  431|       |
  432|     63|    OPENSSL_assert(EVP_PKEY_fromdata_init(ctx));
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  433|       |
  434|     63|    new = EVP_PKEY_new();
  435|     63|    OPENSSL_assert(new != NULL);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  436|     63|    OPENSSL_assert(EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params) == 1);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  437|       |
  438|       |    /*
  439|       |     * EVP_PKEY returns:
  440|       |     * 1 if the keys are equivalent
  441|       |     * 0 if the keys are not equivalent
  442|       |     * -1 if the key types are differnt
  443|       |     * -2 if the operation is not supported
  444|       |     */
  445|     63|    OPENSSL_assert(EVP_PKEY_eq(alice, new) == 1);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  446|     63|    EVP_PKEY_free(new);
  447|     63|    EVP_PKEY_CTX_free(ctx);
  448|     63|    OSSL_PARAM_free(params);
  449|     63|    params = NULL;
  450|     63|    ctx = NULL;
  451|     63|    new = NULL;
  452|       |
  453|     63|    OPENSSL_assert(EVP_PKEY_todata(bob, EVP_PKEY_KEYPAIR, &params) == 1);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  454|       |
  455|     63|    ctx = EVP_PKEY_CTX_new_from_pkey(NULL, bob, NULL);
  456|     63|    OPENSSL_assert(ctx != NULL);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  457|       |
  458|     63|    OPENSSL_assert(EVP_PKEY_fromdata_init(ctx));
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  459|       |
  460|     63|    new = EVP_PKEY_new();
  461|     63|    OPENSSL_assert(new != NULL);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  462|     63|    OPENSSL_assert(EVP_PKEY_fromdata(ctx, &new, EVP_PKEY_KEYPAIR, params) == 1);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  463|       |
  464|     63|    OPENSSL_assert(EVP_PKEY_eq(bob, new) == 1);
  ------------------
  |  |  438|     63|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 63, False: 0]
  |  |  ------------------
  ------------------
  465|       |
  466|       |    /*
  467|       |     * Depending on the types of eys that get generated
  468|       |     * we might get a simple non-equivalence or a type mismatch here
  469|       |     */
  470|     63|    rc = EVP_PKEY_eq(alice, new);
  471|     63|    OPENSSL_assert(rc == 0 || rc == -1);
  ------------------
  |  |  438|     89|    (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: 37, False: 26]
  |  |  |  Branch (438:13): [True: 26, False: 0]
  |  |  ------------------
  ------------------
  472|       |
  473|     63|    EVP_PKEY_CTX_free(ctx);
  474|     63|    EVP_PKEY_free(new);
  475|     63|    OSSL_PARAM_free(params);
  476|     63|}
slh-dsa.c:slh_dsa_sign_verify:
  308|    333|{
  309|    333|    EVP_PKEY_CTX *ctx = NULL;
  310|    333|    EVP_PKEY *key = NULL;
  311|    333|    EVP_SIGNATURE *sig_alg = NULL;
  312|    333|    const char *keytype;
  313|    333|    uint32_t keylen;
  314|    333|    uint8_t selector = 0;
  315|    333|    unsigned char *msg = NULL;
  316|    333|    size_t msg_len;
  317|    333|    size_t sig_len;
  318|    333|    unsigned char *sig = NULL;
  319|    333|    OSSL_PARAM params[4];
  320|    333|    int paramidx = 0;
  321|    333|    int intval1, intval2;
  322|    333|    int expect_init_rc = 1;
  323|       |
  324|    333|    *buf = consume_uint8t(*buf, len, &selector);
  325|    333|    if (*buf == NULL)
  ------------------
  |  Branch (325:9): [True: 0, False: 333]
  ------------------
  326|      0|        return;
  327|       |
  328|    333|    keytype = select_keytype(selector, &keylen);
  329|       |
  330|       |    /*
  331|       |     * Consume another byte to figure out our params
  332|       |     */
  333|    333|    *buf = consume_uint8t(*buf, len, &selector);
  334|    333|    if (*buf == NULL)
  ------------------
  |  Branch (334:9): [True: 0, False: 333]
  ------------------
  335|      0|        return;
  336|       |
  337|       |    /*
  338|       |     * Remainder of the buffer is the msg to sign
  339|       |     */
  340|    333|    msg = (unsigned char *)*buf;
  341|    333|    msg_len = *len;
  342|       |
  343|       |    /* if msg_len > 255, sign_message_init will fail */
  344|    333|    if (msg_len > 255 && (selector & 0x1) != 0)
  ------------------
  |  Branch (344:9): [True: 192, False: 141]
  |  Branch (344:26): [True: 27, False: 165]
  ------------------
  345|     27|        expect_init_rc = 0;
  346|       |
  347|    333|    *len = 0;
  348|       |
  349|    333|    if (selector & 0x1)
  ------------------
  |  Branch (349:9): [True: 98, False: 235]
  ------------------
  350|     98|        params[paramidx++] = OSSL_PARAM_construct_octet_string(OSSL_SIGNATURE_PARAM_CONTEXT_STRING,
  ------------------
  |  |  540|     98|# define OSSL_SIGNATURE_PARAM_CONTEXT_STRING "context-string"
  ------------------
  351|     98|                                                               msg, msg_len);
  352|       |
  353|    333|    if (selector & 0x2) {
  ------------------
  |  Branch (353:9): [True: 109, False: 224]
  ------------------
  354|    109|        intval1 = selector & 0x4;
  355|    109|        params[paramidx++] = OSSL_PARAM_construct_int(OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING,
  ------------------
  |  |  553|    109|# define OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING "message-encoding"
  ------------------
  356|    109|                                                      &intval1);
  357|    109|    }
  358|       |
  359|    333|    if (selector & 0x8) {
  ------------------
  |  Branch (359:9): [True: 178, False: 155]
  ------------------
  360|    178|        intval2 = selector & 0x10;
  361|    178|        params[paramidx++] = OSSL_PARAM_construct_int(OSSL_SIGNATURE_PARAM_DETERMINISTIC,
  ------------------
  |  |  541|    178|# define OSSL_SIGNATURE_PARAM_DETERMINISTIC "deterministic"
  ------------------
  362|    178|                                                      &intval2);
  363|    178|    }
  364|       |
  365|    333|    params[paramidx] = OSSL_PARAM_construct_end();
  366|       |
  367|    333|    key = (void *)slh_dsa_gen_key(keytype, keylen, NULL, 0);
  368|    333|    OPENSSL_assert(key != NULL);
  ------------------
  |  |  438|    333|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 333, False: 0]
  |  |  ------------------
  ------------------
  369|    333|    *out1 = key; /* for cleanup */
  370|       |
  371|    333|    ctx = EVP_PKEY_CTX_new_from_pkey(NULL, key, NULL);
  372|    333|    OPENSSL_assert(ctx != NULL);
  ------------------
  |  |  438|    333|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 333, False: 0]
  |  |  ------------------
  ------------------
  373|       |
  374|    333|    sig_alg = EVP_SIGNATURE_fetch(NULL, keytype, NULL);
  375|    333|    OPENSSL_assert(sig_alg != NULL);
  ------------------
  |  |  438|    333|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 333, False: 0]
  |  |  ------------------
  ------------------
  376|       |
  377|    333|    OPENSSL_assert(EVP_PKEY_sign_message_init(ctx, sig_alg, params) == expect_init_rc);
  ------------------
  |  |  438|    333|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 333, False: 0]
  |  |  ------------------
  ------------------
  378|       |    /*
  379|       |     * the context_string parameter can be no more than 255 bytes, so if
  380|       |     * our random input buffer is greater than that, we expect failure above,
  381|       |     * which we check for.  In that event, theres nothing more we can do here
  382|       |     * so bail out
  383|       |     */
  384|    333|    if (expect_init_rc == 0)
  ------------------
  |  Branch (384:9): [True: 27, False: 306]
  ------------------
  385|     27|        goto out;
  386|       |
  387|    306|    OPENSSL_assert(EVP_PKEY_sign(ctx, NULL, &sig_len, msg, msg_len));
  ------------------
  |  |  438|    306|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 306, False: 0]
  |  |  ------------------
  ------------------
  388|    306|    sig = OPENSSL_zalloc(sig_len);
  ------------------
  |  |  104|    306|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    306|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    306|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  389|    306|    OPENSSL_assert(sig != NULL);
  ------------------
  |  |  438|    306|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 306, False: 0]
  |  |  ------------------
  ------------------
  390|       |
  391|    306|    OPENSSL_assert(EVP_PKEY_sign(ctx, sig, &sig_len, msg, msg_len));
  ------------------
  |  |  438|    306|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 306, False: 0]
  |  |  ------------------
  ------------------
  392|       |
  393|    306|    OPENSSL_assert(EVP_PKEY_verify_message_init(ctx, sig_alg, params));
  ------------------
  |  |  438|    306|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 306, False: 0]
  |  |  ------------------
  ------------------
  394|    306|    OPENSSL_assert(EVP_PKEY_verify(ctx, sig, sig_len, msg, msg_len));
  ------------------
  |  |  438|    306|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (438:12): [True: 306, False: 0]
  |  |  ------------------
  ------------------
  395|       |
  396|    333|out:
  397|    333|    OPENSSL_free(sig);
  ------------------
  |  |  115|    333|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    333|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    333|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  398|    333|    EVP_SIGNATURE_free(sig_alg);
  399|    333|    EVP_PKEY_CTX_free(ctx);
  400|    333|}

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

SHA256_Update:
  155|   911M|{
  156|   911M|    const unsigned char *data = data_;
  157|   911M|    unsigned char *p;
  158|   911M|    HASH_LONG l;
  ------------------
  |  |   76|   911M|#define HASH_LONG               SHA_LONG
  |  |  ------------------
  |  |  |  |   34|   911M|#  define SHA_LONG unsigned int
  |  |  ------------------
  ------------------
  159|   911M|    size_t n;
  160|       |
  161|   911M|    if (len == 0)
  ------------------
  |  Branch (161:9): [True: 0, False: 911M]
  ------------------
  162|      0|        return 1;
  163|       |
  164|   911M|    l = (c->Nl + (((HASH_LONG) len) << 3)) & 0xffffffffUL;
  165|   911M|    if (l < c->Nl)              /* overflow */
  ------------------
  |  Branch (165:9): [True: 0, False: 911M]
  ------------------
  166|      0|        c->Nh++;
  167|   911M|    c->Nh += (HASH_LONG) (len >> 29); /* might cause compiler warning on
  168|       |                                       * 16-bit */
  169|   911M|    c->Nl = l;
  170|       |
  171|   911M|    n = c->num;
  172|   911M|    if (n != 0) {
  ------------------
  |  Branch (172:9): [True: 455M, False: 455M]
  ------------------
  173|   455M|        p = (unsigned char *)c->data;
  174|       |
  175|   455M|        if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   78|   455M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   911M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   455M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (len >= HASH_CBLOCK || len + n >= HASH_CBLOCK) {
  ------------------
  |  |   78|   455M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   455M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   455M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (175:13): [True: 97.7k, False: 455M]
  |  Branch (175:35): [True: 227M, False: 227M]
  ------------------
  176|   228M|            memcpy(p + n, data, HASH_CBLOCK - n);
  ------------------
  |  |   78|   228M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   228M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   228M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|   228M|            HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |  120|   228M|#define HASH_BLOCK_DATA_ORDER   sha256_block_data_order
  ------------------
  178|   228M|            n = HASH_CBLOCK - n;
  ------------------
  |  |   78|   228M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   228M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   228M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  179|   228M|            data += n;
  180|   228M|            len -= n;
  181|   228M|            c->num = 0;
  182|       |            /*
  183|       |             * We use memset rather than OPENSSL_cleanse() here deliberately.
  184|       |             * Using OPENSSL_cleanse() here could be a performance issue. It
  185|       |             * will get properly cleansed on finalisation so this isn't a
  186|       |             * security problem.
  187|       |             */
  188|   228M|            memset(p, 0, HASH_CBLOCK); /* keep it zeroed */
  ------------------
  |  |   78|   228M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   228M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   228M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|   228M|        } else {
  190|   227M|            memcpy(p + n, data, len);
  191|   227M|            c->num += (unsigned int)len;
  192|   227M|            return 1;
  193|   227M|        }
  194|   455M|    }
  195|       |
  196|   683M|    n = len / HASH_CBLOCK;
  ------------------
  |  |   78|   683M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   683M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   683M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|   683M|    if (n > 0) {
  ------------------
  |  Branch (197:9): [True: 98.1k, False: 683M]
  ------------------
  198|  98.1k|        HASH_BLOCK_DATA_ORDER(c, data, n);
  ------------------
  |  |  120|  98.1k|#define HASH_BLOCK_DATA_ORDER   sha256_block_data_order
  ------------------
  199|  98.1k|        n *= HASH_CBLOCK;
  ------------------
  |  |   78|  98.1k|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|  98.1k|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  98.1k|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|  98.1k|        data += n;
  201|  98.1k|        len -= n;
  202|  98.1k|    }
  203|       |
  204|   683M|    if (len != 0) {
  ------------------
  |  Branch (204:9): [True: 455M, False: 227M]
  ------------------
  205|   455M|        p = (unsigned char *)c->data;
  206|   455M|        c->num = (unsigned int)len;
  207|   455M|        memcpy(p, data, len);
  208|   455M|    }
  209|   683M|    return 1;
  210|   911M|}
SHA256_Final:
  218|   227M|{
  219|   227M|    unsigned char *p = (unsigned char *)c->data;
  220|   227M|    size_t n = c->num;
  221|       |
  222|   227M|    p[n] = 0x80;                /* there is always room for one */
  223|   227M|    n++;
  224|       |
  225|   227M|    if (n > (HASH_CBLOCK - 8)) {
  ------------------
  |  |   78|   227M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   227M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   227M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (225:9): [True: 29, False: 227M]
  ------------------
  226|     29|        memset(p + n, 0, HASH_CBLOCK - n);
  ------------------
  |  |   78|     29|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|     29|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|     29|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  227|     29|        n = 0;
  228|     29|        HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |  120|     29|#define HASH_BLOCK_DATA_ORDER   sha256_block_data_order
  ------------------
  229|     29|    }
  230|   227M|    memset(p + n, 0, HASH_CBLOCK - 8 - n);
  ------------------
  |  |   78|   227M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   227M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   227M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|       |
  232|   227M|    p += HASH_CBLOCK - 8;
  ------------------
  |  |   78|   227M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   227M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   227M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|   227M|# if   defined(DATA_ORDER_IS_BIG_ENDIAN)
  234|   227M|    (void)HOST_l2c(c->Nh, p);
  ------------------
  |  |  130|   227M|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|   227M|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|   227M|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|   227M|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|   227M|                         l)
  ------------------
  235|   227M|    (void)HOST_l2c(c->Nl, p);
  ------------------
  |  |  130|   227M|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  131|   227M|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  132|   227M|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  133|   227M|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  134|   227M|                         l)
  ------------------
  236|       |# elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
  237|       |    (void)HOST_l2c(c->Nl, p);
  238|       |    (void)HOST_l2c(c->Nh, p);
  239|       |# endif
  240|   227M|    p -= HASH_CBLOCK;
  ------------------
  |  |   78|   227M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   227M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   227M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|   227M|    HASH_BLOCK_DATA_ORDER(c, p, 1);
  ------------------
  |  |  120|   227M|#define HASH_BLOCK_DATA_ORDER   sha256_block_data_order
  ------------------
  242|   227M|    c->num = 0;
  243|   227M|    OPENSSL_cleanse(p, HASH_CBLOCK);
  ------------------
  |  |   78|   227M|#define HASH_CBLOCK             SHA_CBLOCK
  |  |  ------------------
  |  |  |  |   37|   227M|#  define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   227M|#  define SHA_LBLOCK      16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|       |
  245|       |# ifndef HASH_MAKE_STRING
  246|       |#  error "HASH_MAKE_STRING must be defined!"
  247|       |# else
  248|   227M|    HASH_MAKE_STRING(c, md);
  ------------------
  |  |   88|   227M|#define HASH_MAKE_STRING(c,s)   do {    \
  |  |   89|   227M|        unsigned long ll;               \
  |  |   90|   227M|        unsigned int  nn;               \
  |  |   91|   227M|        switch ((c)->md_len) {          \
  |  |   92|      0|            case SHA256_192_DIGEST_LENGTH: \
  |  |  ------------------
  |  |  |  |   84|      0|# define SHA256_192_DIGEST_LENGTH 24
  |  |  ------------------
  |  |  |  Branch (92:13): [True: 0, False: 227M]
  |  |  ------------------
  |  |   93|      0|                for (nn=0;nn<SHA256_192_DIGEST_LENGTH/4;nn++) { \
  |  |  ------------------
  |  |  |  |   84|      0|# define SHA256_192_DIGEST_LENGTH 24
  |  |  ------------------
  |  |  |  Branch (93:27): [True: 0, False: 0]
  |  |  ------------------
  |  |   94|      0|                    ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  130|      0|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|      0|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|      0|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|      0|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|      0|                         l)
  |  |  ------------------
  |  |   95|      0|                }                       \
  |  |   96|      0|                break;                  \
  |  |   97|      0|            case SHA224_DIGEST_LENGTH:  \
  |  |  ------------------
  |  |  |  |   85|      0|# define SHA224_DIGEST_LENGTH    28
  |  |  ------------------
  |  |  |  Branch (97:13): [True: 0, False: 227M]
  |  |  ------------------
  |  |   98|      0|                for (nn=0;nn<SHA224_DIGEST_LENGTH/4;nn++) {     \
  |  |  ------------------
  |  |  |  |   85|      0|# define SHA224_DIGEST_LENGTH    28
  |  |  ------------------
  |  |  |  Branch (98:27): [True: 0, False: 0]
  |  |  ------------------
  |  |   99|      0|                    ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  130|      0|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|      0|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|      0|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|      0|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|      0|                         l)
  |  |  ------------------
  |  |  100|      0|                }                       \
  |  |  101|      0|                break;                  \
  |  |  102|   227M|            case SHA256_DIGEST_LENGTH:  \
  |  |  ------------------
  |  |  |  |   86|   227M|# define SHA256_DIGEST_LENGTH    32
  |  |  ------------------
  |  |  |  Branch (102:13): [True: 227M, False: 0]
  |  |  ------------------
  |  |  103|  2.05G|                for (nn=0;nn<SHA256_DIGEST_LENGTH/4;nn++) {     \
  |  |  ------------------
  |  |  |  |   86|  2.05G|# define SHA256_DIGEST_LENGTH    32
  |  |  ------------------
  |  |  |  Branch (103:27): [True: 1.82G, False: 227M]
  |  |  ------------------
  |  |  104|  1.82G|                    ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  130|  1.82G|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|  1.82G|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|  1.82G|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|  1.82G|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|  1.82G|                         l)
  |  |  ------------------
  |  |  105|  1.82G|                }                       \
  |  |  106|   227M|                break;                  \
  |  |  107|      0|            default:                    \
  |  |  ------------------
  |  |  |  Branch (107:13): [True: 0, False: 227M]
  |  |  ------------------
  |  |  108|      0|                if ((c)->md_len > SHA256_DIGEST_LENGTH) \
  |  |  ------------------
  |  |  |  |   86|      0|# define SHA256_DIGEST_LENGTH    32
  |  |  ------------------
  |  |  |  Branch (108:21): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|                    return 0;                           \
  |  |  110|      0|                for (nn=0;nn<(c)->md_len/4;nn++) {              \
  |  |  ------------------
  |  |  |  Branch (110:27): [True: 0, False: 0]
  |  |  ------------------
  |  |  111|      0|                    ll=(c)->h[nn]; (void)HOST_l2c(ll,(s));      \
  |  |  ------------------
  |  |  |  |  130|      0|#  define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
  |  |  |  |  131|      0|                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
  |  |  |  |  132|      0|                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
  |  |  |  |  133|      0|                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
  |  |  |  |  134|      0|                         l)
  |  |  ------------------
  |  |  112|      0|                }                       \
  |  |  113|      0|                break;                  \
  |  |  114|   227M|        }                               \
  |  |  115|   227M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (115:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  249|   227M|# endif
  250|       |
  251|   227M|    return 1;
  252|   227M|}

property.c:ossl_sa_ALGORITHM_new:
   27|      4|    { \
   28|      4|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
   29|      4|    } \
property.c:ossl_sa_ALGORITHM_doall_arg:
   56|      4|    { \
   57|      4|        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
   58|      4|                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
   59|      4|    } \
property.c:ossl_sa_ALGORITHM_set:
   68|    540|    { \
   69|    540|        return ossl_sa_set((OPENSSL_SA *)sa, n, (void *)val); \
   70|    540|    } \
property.c:ossl_sa_ALGORITHM_free:
   32|      4|    { \
   33|      4|        ossl_sa_free((OPENSSL_SA *)sa); \
   34|      4|    } \
property.c:ossl_sa_ALGORITHM_get:
   62|  3.61k|    { \
   63|  3.61k|        return (type *)ossl_sa_get((OPENSSL_SA *)sa, n); \
   64|  3.61k|    } \

p_lib.c:ossl_assert_int:
   45|  5.14k|{
   46|  5.14k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 5.14k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  5.14k|    return expr;
   50|  5.14k|}
core_algorithm.c:ossl_assert_int:
   45|      2|{
   46|      2|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 2]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|      2|    return expr;
   50|      2|}
core_namemap.c:ossl_assert_int:
   45|  1.21k|{
   46|  1.21k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 1.21k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  1.21k|    return expr;
   50|  1.21k|}
provider_core.c:ossl_assert_int:
   45|     34|{
   46|     34|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 34]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     34|    return expr;
   50|     34|}
threads_pthread.c:ossl_assert_int:
   45|  12.4k|{
   46|  12.4k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 12.4k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  12.4k|    return expr;
   50|  12.4k|}
defn_cache.c:ossl_assert_int:
   45|    540|{
   46|    540|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 540]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    540|    return expr;
   50|    540|}
property.c:ossl_assert_int:
   45|    302|{
   46|    302|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 302]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    302|    return expr;
   50|    302|}
drbg_ctr.c:ossl_assert_int:
   45|     13|{
   46|     13|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 13]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     13|    return expr;
   50|     13|}
bio_print.c:ossl_assert_int:
   45|  10.7k|{
   46|  10.7k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 10.7k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  10.7k|    return expr;
   50|  10.7k|}
digest.c:ossl_assert_int:
   45|   403M|{
   46|   403M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 403M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|   403M|    return expr;
   50|   403M|}
evp_enc.c:ossl_assert_int:
   45|  4.01k|{
   46|  4.01k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 4.01k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  4.01k|    return expr;
   50|  4.01k|}
evp_fetch.c:ossl_assert_int:
   45|  9.70k|{
   46|  9.70k|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 9.70k]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  9.70k|    return expr;
   50|  9.70k|}
hmac.c:ossl_assert_int:
   45|    201|{
   46|    201|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 201]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|    201|    return expr;
   50|    201|}
core_fetch.c:ossl_assert_int:
   45|     38|{
   46|     38|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 38]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|     38|    return expr;
   50|     38|}
packet.c:ossl_assert_int:
   45|  21.2M|{
   46|  21.2M|    if (!expr)
  ------------------
  |  Branch (46:9): [True: 0, False: 21.2M]
  ------------------
   47|      0|        OPENSSL_die(exprstr, file, line);
   48|       |
   49|  21.2M|    return expr;
   50|  21.2M|}

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

slh_dsa.c:PACKET_buf_init:
   72|  1.22k|{
   73|       |    /* Sanity check for negative values. */
   74|  1.22k|    if (len > (size_t)(SIZE_MAX / 2))
  ------------------
  |  Branch (74:9): [True: 0, False: 1.22k]
  ------------------
   75|      0|        return 0;
   76|       |
   77|  1.22k|    pkt->curr = buf;
   78|  1.22k|    pkt->remaining = len;
   79|  1.22k|    return 1;
   80|  1.22k|}
slh_dsa.c:PACKET_get_bytes:
  383|  2.14k|{
  384|  2.14k|    if (!PACKET_peek_bytes(pkt, data, len))
  ------------------
  |  Branch (384:9): [True: 0, False: 2.14k]
  ------------------
  385|      0|        return 0;
  386|       |
  387|  2.14k|    packet_forward(pkt, len);
  388|       |
  389|  2.14k|    return 1;
  390|  2.14k|}
slh_dsa.c:PACKET_peek_bytes:
  365|  2.14k|{
  366|  2.14k|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (366:9): [True: 0, False: 2.14k]
  ------------------
  367|      0|        return 0;
  368|       |
  369|  2.14k|    *data = pkt->curr;
  370|       |
  371|  2.14k|    return 1;
  372|  2.14k|}
slh_dsa.c:PACKET_remaining:
   40|  2.44k|{
   41|  2.44k|    return pkt->remaining;
   42|  2.44k|}
slh_dsa.c:packet_forward:
   31|  2.14k|{
   32|  2.14k|    pkt->curr += len;
   33|  2.14k|    pkt->remaining -= len;
   34|  2.14k|}
slh_fors.c:PACKET_get_bytes:
  383|   172k|{
  384|   172k|    if (!PACKET_peek_bytes(pkt, data, len))
  ------------------
  |  Branch (384:9): [True: 0, False: 172k]
  ------------------
  385|      0|        return 0;
  386|       |
  387|   172k|    packet_forward(pkt, len);
  388|       |
  389|   172k|    return 1;
  390|   172k|}
slh_fors.c:PACKET_peek_bytes:
  365|   172k|{
  366|   172k|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (366:9): [True: 0, False: 172k]
  ------------------
  367|      0|        return 0;
  368|       |
  369|   172k|    *data = pkt->curr;
  370|       |
  371|   172k|    return 1;
  372|   172k|}
slh_fors.c:PACKET_remaining:
   40|   172k|{
   41|   172k|    return pkt->remaining;
   42|   172k|}
slh_fors.c:packet_forward:
   31|   172k|{
   32|   172k|    pkt->curr += len;
   33|   172k|    pkt->remaining -= len;
   34|   172k|}
slh_hypertree.c:PACKET_buf_init:
   72|  4.80k|{
   73|       |    /* Sanity check for negative values. */
   74|  4.80k|    if (len > (size_t)(SIZE_MAX / 2))
  ------------------
  |  Branch (74:9): [True: 0, False: 4.80k]
  ------------------
   75|      0|        return 0;
   76|       |
   77|  4.80k|    pkt->curr = buf;
   78|  4.80k|    pkt->remaining = len;
   79|  4.80k|    return 1;
   80|  4.80k|}
slh_xmss.c:PACKET_get_bytes:
  383|  38.5k|{
  384|  38.5k|    if (!PACKET_peek_bytes(pkt, data, len))
  ------------------
  |  Branch (384:9): [True: 0, False: 38.5k]
  ------------------
  385|      0|        return 0;
  386|       |
  387|  38.5k|    packet_forward(pkt, len);
  388|       |
  389|  38.5k|    return 1;
  390|  38.5k|}
slh_xmss.c:PACKET_peek_bytes:
  365|  38.5k|{
  366|  38.5k|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (366:9): [True: 0, False: 38.5k]
  ------------------
  367|      0|        return 0;
  368|       |
  369|  38.5k|    *data = pkt->curr;
  370|       |
  371|  38.5k|    return 1;
  372|  38.5k|}
slh_xmss.c:PACKET_remaining:
   40|  38.5k|{
   41|  38.5k|    return pkt->remaining;
   42|  38.5k|}
slh_xmss.c:packet_forward:
   31|  38.5k|{
   32|  38.5k|    pkt->curr += len;
   33|  38.5k|    pkt->remaining -= len;
   34|  38.5k|}
slh_wots.c:PACKET_get_bytes:
  383|   482k|{
  384|   482k|    if (!PACKET_peek_bytes(pkt, data, len))
  ------------------
  |  Branch (384:9): [True: 0, False: 482k]
  ------------------
  385|      0|        return 0;
  386|       |
  387|   482k|    packet_forward(pkt, len);
  388|       |
  389|   482k|    return 1;
  390|   482k|}
slh_wots.c:PACKET_peek_bytes:
  365|   482k|{
  366|   482k|    if (PACKET_remaining(pkt) < len)
  ------------------
  |  Branch (366:9): [True: 0, False: 482k]
  ------------------
  367|      0|        return 0;
  368|       |
  369|   482k|    *data = pkt->curr;
  370|       |
  371|   482k|    return 1;
  372|   482k|}
slh_wots.c:PACKET_remaining:
   40|   482k|{
   41|   482k|    return pkt->remaining;
   42|   482k|}
slh_wots.c:packet_forward:
   31|   482k|{
   32|   482k|    pkt->curr += len;
   33|   482k|    pkt->remaining -= len;
   34|   482k|}

p_lib.c:CRYPTO_NEW_REF:
  280|    639|{
  281|    639|    refcnt->val = n;
  282|    639|    return 1;
  283|    639|}
p_lib.c:CRYPTO_FREE_REF:
  285|    639|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|    639|{
  287|    639|}
p_lib.c:CRYPTO_UP_REF:
   40|    459|{
   41|    459|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    459|    return 1;
   43|    459|}
p_lib.c:CRYPTO_DOWN_REF:
   56|  1.09k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  1.09k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  1.09k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 639, False: 459]
  ------------------
   66|    639|        atomic_thread_fence(memory_order_acquire);
   67|  1.09k|#   endif
   68|  1.09k|    return 1;
   69|  1.09k|}
signature.c:CRYPTO_DOWN_REF:
   56|  1.10k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  1.10k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  1.10k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 59, False: 1.04k]
  ------------------
   66|     59|        atomic_thread_fence(memory_order_acquire);
   67|  1.10k|#   endif
   68|  1.10k|    return 1;
   69|  1.10k|}
signature.c:CRYPTO_FREE_REF:
  285|     59|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     59|{
  287|     59|}
signature.c:CRYPTO_UP_REF:
   40|  1.04k|{
   41|  1.04k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  1.04k|    return 1;
   43|  1.04k|}
signature.c:CRYPTO_NEW_REF:
  280|     59|{
  281|     59|    refcnt->val = n;
  282|     59|    return 1;
  283|     59|}
provider_core.c:CRYPTO_UP_REF:
   40|    303|{
   41|    303|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    303|    return 1;
   43|    303|}
provider_core.c:CRYPTO_NEW_REF:
  280|      1|{
  281|      1|    refcnt->val = n;
  282|      1|    return 1;
  283|      1|}
provider_core.c:CRYPTO_DOWN_REF:
   56|    304|{
   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|    304|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    304|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 1, False: 303]
  ------------------
   66|      1|        atomic_thread_fence(memory_order_acquire);
   67|    304|#   endif
   68|    304|    return 1;
   69|    304|}
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|}
bio_lib.c:CRYPTO_FREE_REF:
  285|      1|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      1|{
  287|      1|}
digest.c:CRYPTO_NEW_REF:
  280|     27|{
  281|     27|    refcnt->val = n;
  282|     27|    return 1;
  283|     27|}
digest.c:CRYPTO_UP_REF:
   40|  3.71k|{
   41|  3.71k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  3.71k|    return 1;
   43|  3.71k|}
digest.c:CRYPTO_DOWN_REF:
   56|  3.74k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  3.74k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  3.74k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 27, False: 3.71k]
  ------------------
   66|     27|        atomic_thread_fence(memory_order_acquire);
   67|  3.74k|#   endif
   68|  3.74k|    return 1;
   69|  3.74k|}
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|    147|{
   41|    147|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|    147|    return 1;
   43|    147|}
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|    277|{
   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|    277|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|    277|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 130, False: 147]
  ------------------
   66|    130|        atomic_thread_fence(memory_order_acquire);
   67|    277|#   endif
   68|    277|    return 1;
   69|    277|}
evp_lib.c:CRYPTO_FREE_REF:
  285|     27|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     27|{
  287|     27|}
evp_rand.c:CRYPTO_UP_REF:
   40|     18|{
   41|     18|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|     18|    return 1;
   43|     18|}
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|     27|{
   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|     27|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|     27|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 9, False: 18]
  ------------------
   66|      9|        atomic_thread_fence(memory_order_acquire);
   67|     27|#   endif
   68|     27|    return 1;
   69|     27|}
keymgmt_meth.c:CRYPTO_NEW_REF:
  280|     40|{
  281|     40|    refcnt->val = n;
  282|     40|    return 1;
  283|     40|}
keymgmt_meth.c:CRYPTO_UP_REF:
   40|  2.28k|{
   41|  2.28k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  2.28k|    return 1;
   43|  2.28k|}
keymgmt_meth.c:CRYPTO_DOWN_REF:
   56|  2.32k|{
   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.32k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  2.32k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 40, False: 2.28k]
  ------------------
   66|     40|        atomic_thread_fence(memory_order_acquire);
   67|  2.32k|#   endif
   68|  2.32k|    return 1;
   69|  2.32k|}
keymgmt_meth.c:CRYPTO_FREE_REF:
  285|     40|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|     40|{
  287|     40|}
mac_meth.c:CRYPTO_NEW_REF:
  280|      9|{
  281|      9|    refcnt->val = n;
  282|      9|    return 1;
  283|      9|}
mac_meth.c:CRYPTO_UP_REF:
   40|  1.16k|{
   41|  1.16k|    *ret = atomic_fetch_add_explicit(&refcnt->val, 1, memory_order_relaxed) + 1;
   42|  1.16k|    return 1;
   43|  1.16k|}
mac_meth.c:CRYPTO_DOWN_REF:
   56|  1.17k|{
   57|       |#   ifdef OSSL_TSAN_BUILD
   58|       |    /*
   59|       |     * TSAN requires acq_rel as it indicates a false positive error when
   60|       |     * the object that contains the refcount is freed otherwise.
   61|       |     */
   62|       |    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_acq_rel) - 1;
   63|       |#   else
   64|  1.17k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_release) - 1;
   65|  1.17k|    if (*ret == 0)
  ------------------
  |  Branch (65:9): [True: 9, False: 1.16k]
  ------------------
   66|      9|        atomic_thread_fence(memory_order_acquire);
   67|  1.17k|#   endif
   68|  1.17k|    return 1;
   69|  1.17k|}
mac_meth.c:CRYPTO_FREE_REF:
  285|      9|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  286|      9|{
  287|      9|}

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

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

slh_adrs.c:OPENSSL_store_u32_be:
  143|   492M|{
  144|   492M|# ifdef OSSL_HTOBE32
  145|   492M|    uint32_t t = OSSL_HTOBE32(val);
  ------------------
  |  |   45|   492M|#   define OSSL_HTOBE32(x) htobe32(x)
  ------------------
  146|       |
  147|   492M|    memcpy(out, (unsigned char *)&t, 4);
  148|   492M|    return out + 4;
  149|       |# else
  150|       |    *out++ = (val >> 24) & 0xff;
  151|       |    *out++ = (val >> 16) & 0xff;
  152|       |    *out++ = (val >> 8) & 0xff;
  153|       |    *out++ = (val & 0xff);
  154|       |    return out;
  155|       |# endif
  156|   492M|}
slh_adrs.c:OPENSSL_store_u64_be:
  181|  10.8k|{
  182|  10.8k|# ifdef OSSL_HTOLE64
  183|  10.8k|    uint64_t t = OSSL_HTOBE64(val);
  ------------------
  |  |   46|  10.8k|#   define OSSL_HTOBE64(x) htobe64(x)
  ------------------
  184|       |
  185|  10.8k|    memcpy(out, (unsigned char *)&t, 8);
  186|  10.8k|    return out + 8;
  187|       |# else
  188|       |    *out++ = (val >> 56) & 0xff;
  189|       |    *out++ = (val >> 48) & 0xff;
  190|       |    *out++ = (val >> 40) & 0xff;
  191|       |    *out++ = (val >> 32) & 0xff;
  192|       |    *out++ = (val >> 24) & 0xff;
  193|       |    *out++ = (val >> 16) & 0xff;
  194|       |    *out++ = (val >> 8) & 0xff;
  195|       |    *out++ = (val & 0xff);
  196|       |    return out;
  197|       |# endif
  198|  10.8k|}

signature.c:OSSL_FUNC_signature_newctx:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_sign_init:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
signature.c:OSSL_FUNC_signature_sign:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_sign_message_init:
   59|     51|    {                                                                   \
   60|     51|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     51|    }
signature.c:OSSL_FUNC_signature_sign_message_update:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_sign_message_final:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_verify_init:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
signature.c:OSSL_FUNC_signature_verify:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_verify_message_init:
   59|     51|    {                                                                   \
   60|     51|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     51|    }
signature.c:OSSL_FUNC_signature_verify_message_update:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_verify_message_final:
   59|     34|    {                                                                   \
   60|     34|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     34|    }
signature.c:OSSL_FUNC_signature_verify_recover_init:
   59|     14|    {                                                                   \
   60|     14|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     14|    }
signature.c:OSSL_FUNC_signature_verify_recover:
   59|     14|    {                                                                   \
   60|     14|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     14|    }
signature.c:OSSL_FUNC_signature_digest_sign_init:
   59|     25|    {                                                                   \
   60|     25|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     25|    }
signature.c:OSSL_FUNC_signature_digest_sign_update:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
signature.c:OSSL_FUNC_signature_digest_sign_final:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
signature.c:OSSL_FUNC_signature_digest_sign:
   59|     17|    {                                                                   \
   60|     17|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     17|    }
signature.c:OSSL_FUNC_signature_digest_verify_init:
   59|     21|    {                                                                   \
   60|     21|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     21|    }
signature.c:OSSL_FUNC_signature_digest_verify_update:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_digest_verify_final:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_digest_verify:
   59|     17|    {                                                                   \
   60|     17|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     17|    }
signature.c:OSSL_FUNC_signature_freectx:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_dupctx:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_get_ctx_params:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_gettable_ctx_params:
   59|     55|    {                                                                   \
   60|     55|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     55|    }
signature.c:OSSL_FUNC_signature_set_ctx_params:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_settable_ctx_params:
   59|     59|    {                                                                   \
   60|     59|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     59|    }
signature.c:OSSL_FUNC_signature_get_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_gettable_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_set_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_settable_ctx_md_params:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
signature.c:OSSL_FUNC_signature_query_key_types:
   59|     36|    {                                                                   \
   60|     36|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     36|    }
provider_core.c:OSSL_FUNC_provider_teardown:
   59|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
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|      1|    {                                                                   \
   60|      1|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      1|    }
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|    }
drbg.c:OSSL_FUNC_rand_enable_locking:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_lock:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_unlock:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_get_ctx_params:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_get_seed:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
drbg.c:OSSL_FUNC_rand_clear_seed:
   59|      3|    {                                                                   \
   60|      3|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      3|    }
digest.c:OSSL_FUNC_digest_newctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_init:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_update:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_final:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_squeeze:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
digest.c:OSSL_FUNC_digest_freectx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_dupctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_get_params:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_set_ctx_params:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
digest.c:OSSL_FUNC_digest_get_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
digest.c:OSSL_FUNC_digest_gettable_params:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
digest.c:OSSL_FUNC_digest_settable_ctx_params:
   59|      8|    {                                                                   \
   60|      8|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      8|    }
digest.c:OSSL_FUNC_digest_gettable_ctx_params:
   59|      6|    {                                                                   \
   60|      6|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      6|    }
digest.c:OSSL_FUNC_digest_copyctx:
   59|     27|    {                                                                   \
   60|     27|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     27|    }
evp_enc.c:OSSL_FUNC_cipher_newctx:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_init:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_init:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_encrypt_skey_init:
   59|     68|    {                                                                   \
   60|     68|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     68|    }
evp_enc.c:OSSL_FUNC_cipher_decrypt_skey_init:
   59|     68|    {                                                                   \
   60|     68|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     68|    }
evp_enc.c:OSSL_FUNC_cipher_update:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_final:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_cipher:
   59|    118|    {                                                                   \
   60|    118|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    118|    }
evp_enc.c:OSSL_FUNC_cipher_freectx:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_dupctx:
   59|    129|    {                                                                   \
   60|    129|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    129|    }
evp_enc.c:OSSL_FUNC_cipher_get_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_get_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_set_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_gettable_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_enc.c:OSSL_FUNC_cipher_settable_ctx_params:
   59|    130|    {                                                                   \
   60|    130|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|    130|    }
evp_rand.c:OSSL_FUNC_rand_newctx:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_freectx:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_instantiate:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_uninstantiate:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
evp_rand.c:OSSL_FUNC_rand_generate:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
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|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
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|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
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|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
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|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_new:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_init:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_template:
   59|      5|    {                                                                   \
   60|      5|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      5|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_set_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_settable_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_get_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_gettable_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gen_cleanup:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_free:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_load:
   59|     29|    {                                                                   \
   60|     29|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     29|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_get_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_gettable_params:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_set_params:
   59|     19|    {                                                                   \
   60|     19|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     19|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_settable_params:
   59|     19|    {                                                                   \
   60|     19|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     19|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_query_operation_name:
   59|      4|    {                                                                   \
   60|      4|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      4|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_has:
   59|     40|    {                                                                   \
   60|     40|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     40|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_dup:
   59|     33|    {                                                                   \
   60|     33|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     33|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_validate:
   59|     29|    {                                                                   \
   60|     29|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     29|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_match:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_import_types:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
keymgmt_meth.c:OSSL_FUNC_keymgmt_export_types:
   59|     37|    {                                                                   \
   60|     37|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|     37|    }
mac_meth.c:OSSL_FUNC_mac_newctx:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_dupctx:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_freectx:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_init:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_update:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_final:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_gettable_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
mac_meth.c:OSSL_FUNC_mac_gettable_ctx_params:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
mac_meth.c:OSSL_FUNC_mac_settable_ctx_params:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }
mac_meth.c:OSSL_FUNC_mac_get_params:
   59|      2|    {                                                                   \
   60|      2|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      2|    }
mac_meth.c:OSSL_FUNC_mac_get_ctx_params:
   59|      7|    {                                                                   \
   60|      7|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      7|    }
mac_meth.c:OSSL_FUNC_mac_set_ctx_params:
   59|      9|    {                                                                   \
   60|      9|        return (OSSL_FUNC_##name##_fn *)opf->function;                  \
   61|      9|    }

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

o_names.c:lh_OBJ_NAME_new:
  317|      1|    { \
  318|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      1|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      1|                                lh_##type##_doall_thunk, \
  321|      1|                                lh_##type##_doall_arg_thunk); \
  322|      1|    } \
o_names.c:lh_OBJ_NAME_hfn_thunk:
  243|  1.31k|    { \
  244|  1.31k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  1.31k|        return hfn_conv((const type *)data); \
  246|  1.31k|    } \
o_names.c:lh_OBJ_NAME_cfn_thunk:
  248|    918|    { \
  249|    918|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    918|        return cfn_conv((const type *)da, (const type *)db); \
  251|    918|    } \
o_names.c:lh_OBJ_NAME_doall_thunk:
  299|    543|    { \
  300|    543|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|    543|        doall_conv((type *)node); \
  302|    543|    } \
o_names.c:lh_OBJ_NAME_retrieve:
  274|    651|    { \
  275|    651|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    651|    } \
o_names.c:lh_OBJ_NAME_insert:
  264|    424|    { \
  265|    424|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|    424|    } \
o_names.c:lh_OBJ_NAME_error:
  279|    242|    { \
  280|    242|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|    242|    } \
o_names.c:lh_OBJ_NAME_delete:
  269|    242|    { \
  270|    242|        return (type *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d); \
  271|    242|    } \
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|      4|    { \
  290|      4|        return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); \
  291|      4|    } \
o_names.c:lh_OBJ_NAME_set_down_load:
  294|      7|    { \
  295|      7|        OPENSSL_LH_set_down_load((OPENSSL_LHASH *)lh, dl); \
  296|      7|    } \
o_names.c:lh_OBJ_NAME_doall:
  311|      4|    { \
  312|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      4|    } \
o_names.c:lh_OBJ_NAME_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  311|      1|    { \
  312|      1|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  317|      1|    { \
  318|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      1|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      1|                                lh_##type##_doall_thunk, \
  321|      1|                                lh_##type##_doall_arg_thunk); \
  322|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_hfn_thunk:
  243|    272|    { \
  244|    272|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|    272|        return hfn_conv((const type *)data); \
  246|    272|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_cfn_thunk:
  248|    269|    { \
  249|    269|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|    269|        return cfn_conv((const type *)da, (const type *)db); \
  251|    269|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall_thunk:
  299|      1|    { \
  300|      1|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|      1|        doall_conv((type *)node); \
  302|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_retrieve:
  274|    271|    { \
  275|    271|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|    271|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_insert:
  264|      1|    { \
  265|      1|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|      1|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_error:
  279|      1|    { \
  280|      1|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|      1|    } \
property.c:lh_QUERY_doall:
  311|    270|    { \
  312|    270|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|    270|    } \
property.c:lh_QUERY_free:
  254|    270|    { \
  255|    270|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|    270|    } \
property.c:lh_QUERY_new:
  317|    270|    { \
  318|    270|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|    270|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|    270|                                lh_##type##_doall_thunk, \
  321|    270|                                lh_##type##_doall_arg_thunk); \
  322|    270|    } \
property.c:lh_QUERY_hfn_thunk:
  243|  3.04k|    { \
  244|  3.04k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|  3.04k|        return hfn_conv((const type *)data); \
  246|  3.04k|    } \
property.c:lh_QUERY_cfn_thunk:
  248|  2.98k|    { \
  249|  2.98k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|  2.98k|        return cfn_conv((const type *)da, (const type *)db); \
  251|  2.98k|    } \
property.c:lh_QUERY_doall_thunk:
  299|     32|    { \
  300|     32|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|     32|        doall_conv((type *)node); \
  302|     32|    } \
property.c:lh_QUERY_retrieve:
  274|  3.00k|    { \
  275|  3.00k|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|  3.00k|    } \
property.c:lh_QUERY_insert:
  264|     32|    { \
  265|     32|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|     32|    } \
property.c:lh_QUERY_error:
  279|     32|    { \
  280|     32|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|     32|    } \
property_string.c:lh_PROPERTY_STRING_doall:
  311|      2|    { \
  312|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      2|    } \
property_string.c:lh_PROPERTY_STRING_free:
  254|      2|    { \
  255|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      2|    } \
property_string.c:lh_PROPERTY_STRING_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|    } \
property_string.c:lh_PROPERTY_STRING_hfn_thunk:
  243|     28|    { \
  244|     28|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  245|     28|        return hfn_conv((const type *)data); \
  246|     28|    } \
property_string.c:lh_PROPERTY_STRING_cfn_thunk:
  248|      1|    { \
  249|      1|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  250|      1|        return cfn_conv((const type *)da, (const type *)db); \
  251|      1|    } \
property_string.c:lh_PROPERTY_STRING_doall_thunk:
  299|      9|    { \
  300|      9|        void (*doall_conv)(type *) = (void (*)(type *))doall; \
  301|      9|        doall_conv((type *)node); \
  302|      9|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  274|     19|    { \
  275|     19|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  276|     19|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  264|      9|    { \
  265|      9|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  266|      9|    } \
property_string.c:lh_PROPERTY_STRING_error:
  279|      9|    { \
  280|      9|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  281|      9|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  317|      1|    { \
  318|      1|        return (LHASH_OF(type) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn), \
  319|      1|                                lh_##type##_hfn_thunk, lh_##type##_cfn_thunk, \
  320|      1|                                lh_##type##_doall_thunk, \
  321|      1|                                lh_##type##_doall_arg_thunk); \
  322|      1|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  311|      1|    { \
  312|      1|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  313|      1|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  254|      1|    { \
  255|      1|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  256|      1|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_type:
  196|  4.38k|    { \
  197|  4.38k|        return (OPENSSL_LHASH *)lh; \
  198|  4.38k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  206|      1|    { \
  207|      1|        return (OPENSSL_LH_HASHFUNC)hfn; \
  208|      1|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  201|      1|    { \
  202|      1|        return (OPENSSL_LH_COMPFUNC)cmp; \
  203|      1|    } \
err.c:lh_ERR_STRING_DATA_hash_thunk:
  160|  4.37k|    { \
  161|  4.37k|        unsigned long (*hfn_conv)(const type *) = (unsigned long (*)(const type *))hfn; \
  162|  4.37k|        return hfn_conv((const type *)data); \
  163|  4.37k|    } \
err.c:lh_ERR_STRING_DATA_comp_thunk:
  165|  2.94k|    { \
  166|  2.94k|        int (*cfn_conv)(const type *, const type *) = (int (*)(const type *, const type *))cfn; \
  167|  2.94k|        return cfn_conv((const type *)da, (const type *)db); \
  168|  2.94k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  181|  4.31k|    { \
  182|  4.31k|        return ptr; \
  183|  4.31k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  186|     68|    { \
  187|     68|        return ptr; \
  188|     68|    } \

obj_dat.c:OBJ_bsearch_ln:
  129|  1.04k|      { \
  130|  1.04k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  1.04k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  1.04k|      } \
obj_dat.c:ln_cmp_BSEARCH_CMP_FN:
  123|  10.1k|      { \
  124|  10.1k|      type1 const *a = a_; \
  125|  10.1k|      type2 const *b = b_; \
  126|  10.1k|      return nm##_cmp(a,b); \
  127|  10.1k|      } \
obj_dat.c:OBJ_bsearch_sn:
  129|  1.05k|      { \
  130|  1.05k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  1.05k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  1.05k|      } \
obj_dat.c:sn_cmp_BSEARCH_CMP_FN:
  123|  11.5k|      { \
  124|  11.5k|      type1 const *a = a_; \
  125|  11.5k|      type2 const *b = b_; \
  126|  11.5k|      return nm##_cmp(a,b); \
  127|  11.5k|      } \
ameth_lib.c:OBJ_bsearch_ameth:
  129|  2.09k|      { \
  130|  2.09k|      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
  131|  2.09k|                                        nm##_cmp_BSEARCH_CMP_FN); \
  132|  2.09k|      } \
ameth_lib.c:ameth_cmp_BSEARCH_CMP_FN:
  123|  8.37k|      { \
  124|  8.37k|      type1 const *a = a_; \
  125|  8.37k|      type2 const *b = b_; \
  126|  8.37k|      return nm##_cmp(a,b); \
  127|  8.37k|      } \

p_lib.c:ossl_check_X509_ATTRIBUTE_sk_type:
   53|    639|    { \
   54|    639|        return (OPENSSL_STACK *)sk; \
   55|    639|    } \
p_lib.c:ossl_check_X509_ATTRIBUTE_freefunc_type:
   65|    639|    { \
   66|    639|        return (OPENSSL_sk_freefunc)fr; \
   67|    639|    }
core_namemap.c:sk_NAMES_value:
   84|  1.15k|    { \
   85|  1.15k|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|  1.15k|    } \
core_namemap.c:ossl_check_const_OPENSSL_STRING_sk_type:
   49|  6.19k|    { \
   50|  6.19k|        return (const OPENSSL_STACK *)sk; \
   51|  6.19k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_sk_type:
   53|  1.67k|    { \
   54|  1.67k|        return (OPENSSL_STACK *)sk; \
   55|  1.67k|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_type:
   45|    600|    { \
   46|    600|        return ptr; \
   47|    600|    } \
core_namemap.c:sk_NAMES_push:
  129|    258|    { \
  130|    258|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    258|    } \
core_namemap.c:sk_NAMES_num:
   80|    258|    { \
   81|    258|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    258|    } \
core_namemap.c:ossl_check_OPENSSL_STRING_freefunc_type:
   65|    258|    { \
   66|    258|        return (OPENSSL_sk_freefunc)fr; \
   67|    258|    }
core_namemap.c:sk_NAMES_new_null:
   96|      1|    { \
   97|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      1|    } \
core_namemap.c:sk_NAMES_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \
core_namemap.c:sk_NAMES_freefunc_thunk:
   75|    258|    { \
   76|    258|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    258|        freefunc((t3 *)ptr);\
   78|    258|    } \
ex_data.c:sk_EX_CALLBACK_pop_free:
  145|     18|    { \
  146|     18|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     18|        \
  148|     18|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     18|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     18|        \
  151|     18|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     18|    } \
ex_data.c:sk_EX_CALLBACK_num:
   80|  1.27k|    { \
   81|  1.27k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|  1.27k|    } \
ex_data.c:ossl_check_void_sk_type:
   53|    639|    { \
   54|    639|        return (OPENSSL_STACK *)sk; \
   55|    639|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   96|      1|    { \
   97|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      1|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
  112|      1|    { \
  113|      1|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      1|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  129|      1|    { \
  130|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      1|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   80|      3|    { \
   81|      3|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      3|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   84|      1|    { \
   85|      1|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      1|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  120|      1|    { \
  121|      1|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  122|      1|    } \
provider_conf.c:sk_OSSL_PROVIDER_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \
provider_core.c:sk_INFOPAIR_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_freefunc_thunk:
   75|      1|    { \
   76|      1|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|      1|        freefunc((t3 *)ptr);\
   78|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_new:
   88|      1|    { \
   89|      1|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|      1|        \
   92|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|      1|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   96|      1|    { \
   97|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_sort:
  174|      3|    { \
  175|      3|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_find:
  162|      3|    { \
  163|      3|        return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr); \
  164|      3|    } \
provider_core.c:sk_OSSL_PROVIDER_value:
   84|     93|    { \
   85|     93|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|     93|    } \
provider_core.c:sk_INFOPAIR_deep_copy:
  188|      1|    { \
  189|      1|        return (STACK_OF(t1) *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, \
  190|      1|                                            (OPENSSL_sk_copyfunc)copyfunc, \
  191|      1|                                            (OPENSSL_sk_freefunc)freefunc); \
  192|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_push:
  129|      1|    { \
  130|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      1|    } \
provider_core.c:sk_OSSL_PROVIDER_dup:
  182|     30|    { \
  183|     30|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|     30|    } \
provider_core.c:sk_OSSL_PROVIDER_num:
   80|     30|    { \
   81|     30|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|     30|    } \
provider_core.c:sk_OSSL_PROVIDER_free:
  112|     30|    { \
  113|     30|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|     30|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_num:
   80|      1|    { \
   81|      1|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      1|    } \
o_names.c:sk_NAME_FUNCS_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \
obj_xref.c:sk_nid_triple_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \
obj_xref.c:sk_nid_triple_free:
  112|      1|    { \
  113|      1|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      1|    } \
property.c:sk_IMPLEMENTATION_pop_free:
  145|    270|    { \
  146|    270|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    270|        \
  148|    270|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    270|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    270|        \
  151|    270|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    270|    } \
property.c:sk_IMPLEMENTATION_freefunc_thunk:
   75|    270|    { \
   76|    270|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|    270|        freefunc((t3 *)ptr);\
   78|    270|    } \
property.c:sk_IMPLEMENTATION_new_null:
   96|    270|    { \
   97|    270|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    270|    } \
property.c:sk_IMPLEMENTATION_num:
   80|    572|    { \
   81|    572|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    572|    } \
property.c:sk_IMPLEMENTATION_value:
   84|     32|    { \
   85|     32|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|     32|    } \
property.c:sk_IMPLEMENTATION_push:
  129|    270|    { \
  130|    270|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    270|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_new:
   88|     33|    { \
   89|     33|        OPENSSL_STACK *ret = OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   90|     33|        OPENSSL_sk_freefunc_thunk f_thunk; \
   91|     33|        \
   92|     33|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
   93|     33|        return (STACK_OF(t1) *)OPENSSL_sk_set_thunks(ret, f_thunk); \
   94|     33|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_freefunc_thunk:
   75|      1|    { \
   76|      1|        sk_##t1##_freefunc freefunc = (sk_##t1##_freefunc) freefunc_arg;\
   77|      1|        freefunc((t3 *)ptr);\
   78|      1|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_push:
  129|      1|    { \
  130|      1|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|      1|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_num:
   80|     33|    { \
   81|     33|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|     33|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_sort:
  174|     33|    { \
  175|     33|        OPENSSL_sk_sort((OPENSSL_STACK *)sk); \
  176|     33|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_value:
   84|      1|    { \
   85|      1|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|      1|    } \
property_parse.c:sk_OSSL_PROPERTY_DEFINITION_pop_free:
  145|     33|    { \
  146|     33|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|     33|        \
  148|     33|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|     33|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|     33|        \
  151|     33|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|     33|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   53|     11|    { \
   54|     11|        return (OPENSSL_STACK *)sk; \
   55|     11|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   45|      9|    { \
   46|      9|        return ptr; \
   47|      9|    } \
conf_mod.c:sk_CONF_IMODULE_free:
  112|      2|    { \
  113|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      2|    } \
conf_mod.c:sk_CONF_MODULE_dup:
  182|      1|    { \
  183|      1|        return (STACK_OF(t1) *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk); \
  184|      1|    } \
conf_mod.c:sk_CONF_MODULE_new_null:
   96|      1|    { \
   97|      1|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|      1|    } \
conf_mod.c:sk_CONF_MODULE_num:
   80|      2|    { \
   81|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      2|    } \
conf_mod.c:sk_CONF_MODULE_free:
  112|      3|    { \
  113|      3|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|      3|    } \
conf_mod.c:sk_CONF_MODULE_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   80|      1|    { \
   81|      1|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|      1|    } \
keymgmt_lib.c:sk_OP_CACHE_ELEM_pop_free:
  145|    639|    { \
  146|    639|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|    639|        \
  148|    639|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|    639|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|    639|        \
  151|    639|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|    639|    } \
comp_methods.c:ossl_check_SSL_COMP_compfunc_type:
   57|      1|    { \
   58|      1|        return (OPENSSL_sk_compfunc)cmp; \
   59|      1|    } \
comp_methods.c:ossl_check_SSL_COMP_sk_type:
   53|      1|    { \
   54|      1|        return (OPENSSL_STACK *)sk; \
   55|      1|    } \
comp_methods.c:ossl_check_SSL_COMP_freefunc_type:
   65|      1|    { \
   66|      1|        return (OPENSSL_sk_freefunc)fr; \
   67|      1|    }
param_build.c:sk_OSSL_PARAM_BLD_DEF_new_null:
   96|    126|    { \
   97|    126|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   98|    126|    } \
param_build.c:sk_OSSL_PARAM_BLD_DEF_pop:
  137|    252|    { \
  138|    252|        return (t2 *)OPENSSL_sk_pop((OPENSSL_STACK *)sk); \
  139|    252|    } \
param_build.c:sk_OSSL_PARAM_BLD_DEF_free:
  112|    126|    { \
  113|    126|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
  114|    126|    } \
param_build.c:sk_OSSL_PARAM_BLD_DEF_push:
  129|    252|    { \
  130|    252|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  131|    252|    } \
param_build.c:sk_OSSL_PARAM_BLD_DEF_num:
   80|    504|    { \
   81|    504|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   82|    504|    } \
param_build.c:sk_OSSL_PARAM_BLD_DEF_value:
   84|    252|    { \
   85|    252|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   86|    252|    } \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  145|      1|    { \
  146|      1|        OPENSSL_sk_freefunc_thunk f_thunk; \
  147|      1|        \
  148|      1|        f_thunk = (OPENSSL_sk_freefunc_thunk)sk_##t1##_freefunc_thunk; \
  149|      1|        sk = (STACK_OF(t1) *)OPENSSL_sk_set_thunks((OPENSSL_STACK *)sk, f_thunk); \
  150|      1|        \
  151|      1|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  152|      1|    } \

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

ossl_DER_w_algorithmIdentifier_SLH_DSA:
   22|    639|{
   23|    639|    const uint8_t *alg;
   24|    639|    size_t len;
   25|    639|    int nid = ossl_slh_dsa_key_get_type(key);
   26|       |
   27|    639|    switch (nid) {
   28|     35|        CASE_OID(NID_SLH_DSA_SHA2_128s, id_slh_dsa_sha2_128s);
  ------------------
  |  |   16|     35|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 35, False: 604]
  |  |  ------------------
  |  |   17|     35|        alg = ossl_der_oid_##name;           \
  |  |   18|     35|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     35|        break
  ------------------
   29|    136|        CASE_OID(NID_SLH_DSA_SHA2_128f, id_slh_dsa_sha2_128f);
  ------------------
  |  |   16|    136|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 136, False: 503]
  |  |  ------------------
  |  |   17|    136|        alg = ossl_der_oid_##name;           \
  |  |   18|    136|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|    136|        break
  ------------------
   30|     30|        CASE_OID(NID_SLH_DSA_SHA2_192s, id_slh_dsa_sha2_192s);
  ------------------
  |  |   16|     30|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 30, False: 609]
  |  |  ------------------
  |  |   17|     30|        alg = ossl_der_oid_##name;           \
  |  |   18|     30|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     30|        break
  ------------------
   31|     89|        CASE_OID(NID_SLH_DSA_SHA2_192f, id_slh_dsa_sha2_192f);
  ------------------
  |  |   16|     89|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 89, False: 550]
  |  |  ------------------
  |  |   17|     89|        alg = ossl_der_oid_##name;           \
  |  |   18|     89|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     89|        break
  ------------------
   32|     60|        CASE_OID(NID_SLH_DSA_SHA2_256s, id_slh_dsa_sha2_256s);
  ------------------
  |  |   16|     60|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 60, False: 579]
  |  |  ------------------
  |  |   17|     60|        alg = ossl_der_oid_##name;           \
  |  |   18|     60|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     60|        break
  ------------------
   33|     69|        CASE_OID(NID_SLH_DSA_SHA2_256f, id_slh_dsa_sha2_256f);
  ------------------
  |  |   16|     69|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 69, False: 570]
  |  |  ------------------
  |  |   17|     69|        alg = ossl_der_oid_##name;           \
  |  |   18|     69|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     69|        break
  ------------------
   34|     13|        CASE_OID(NID_SLH_DSA_SHAKE_128s, id_slh_dsa_shake_128s);
  ------------------
  |  |   16|     13|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 13, False: 626]
  |  |  ------------------
  |  |   17|     13|        alg = ossl_der_oid_##name;           \
  |  |   18|     13|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     13|        break
  ------------------
   35|     25|        CASE_OID(NID_SLH_DSA_SHAKE_128f, id_slh_dsa_shake_128f);
  ------------------
  |  |   16|     25|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 25, False: 614]
  |  |  ------------------
  |  |   17|     25|        alg = ossl_der_oid_##name;           \
  |  |   18|     25|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     25|        break
  ------------------
   36|     18|        CASE_OID(NID_SLH_DSA_SHAKE_192s, id_slh_dsa_shake_192s);
  ------------------
  |  |   16|     18|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 18, False: 621]
  |  |  ------------------
  |  |   17|     18|        alg = ossl_der_oid_##name;           \
  |  |   18|     18|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     18|        break
  ------------------
   37|     92|        CASE_OID(NID_SLH_DSA_SHAKE_192f, id_slh_dsa_shake_192f);
  ------------------
  |  |   16|     92|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 92, False: 547]
  |  |  ------------------
  |  |   17|     92|        alg = ossl_der_oid_##name;           \
  |  |   18|     92|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     92|        break
  ------------------
   38|     51|        CASE_OID(NID_SLH_DSA_SHAKE_256s, id_slh_dsa_shake_256s);
  ------------------
  |  |   16|     51|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 51, False: 588]
  |  |  ------------------
  |  |   17|     51|        alg = ossl_der_oid_##name;           \
  |  |   18|     51|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     51|        break
  ------------------
   39|     21|        CASE_OID(NID_SLH_DSA_SHAKE_256f, id_slh_dsa_shake_256f);
  ------------------
  |  |   16|     21|    case nid:                                \
  |  |  ------------------
  |  |  |  Branch (16:5): [True: 21, False: 618]
  |  |  ------------------
  |  |   17|     21|        alg = ossl_der_oid_##name;           \
  |  |   18|     21|        len = sizeof(ossl_der_oid_##name);   \
  |  |   19|     21|        break
  ------------------
   40|      0|        default:
  ------------------
  |  Branch (40:9): [True: 0, False: 639]
  ------------------
   41|      0|            return 0;
   42|    639|    }
   43|    639|    return ossl_DER_w_begin_sequence(pkt, tag)
  ------------------
  |  Branch (43:12): [True: 639, False: 0]
  ------------------
   44|       |        /* No parameters */
   45|    639|        && ossl_DER_w_precompiled(pkt, -1, alg, len)
  ------------------
  |  Branch (45:12): [True: 639, False: 0]
  ------------------
   46|    639|        && ossl_DER_w_end_sequence(pkt, tag);
  ------------------
  |  Branch (46:12): [True: 639, False: 0]
  ------------------
   47|    639|}

provider_util.c:ossl_param_is_empty:
   30|    201|{
   31|    201|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 0, False: 201]
  |  Branch (31:30): [True: 0, False: 201]
  ------------------
   32|    201|}
sha3_prov.c:ossl_param_is_empty:
   30|   321M|{
   31|   321M|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 160M, False: 160M]
  |  Branch (31:30): [True: 0, False: 160M]
  ------------------
   32|   321M|}
hmac_prov.c:ossl_param_is_empty:
   30|    201|{
   31|    201|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 0, False: 201]
  |  Branch (31:30): [True: 0, False: 201]
  ------------------
   32|    201|}
drbg.c:ossl_param_is_empty:
   30|      3|{
   31|      3|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 0, False: 3]
  |  Branch (31:30): [True: 0, False: 3]
  ------------------
   32|      3|}
slh_dsa_sig.c:ossl_param_is_empty:
   30|    639|{
   31|    639|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 0, False: 639]
  |  Branch (31:30): [True: 166, False: 473]
  ------------------
   32|    639|}
ciphercommon.c:ossl_param_is_empty:
   30|  4.01k|{
   31|  4.01k|    return params == NULL || params->key == NULL;
  ------------------
  |  Branch (31:12): [True: 4.01k, False: 0]
  |  Branch (31:30): [True: 0, False: 0]
  ------------------
   32|  4.01k|}

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.49k|{
   53|  1.49k|    if (ctx == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 1.49k]
  ------------------
   54|      0|        return NULL;
   55|  1.49k|    return ctx->libctx;
   56|  1.49k|}
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|      1|{
  260|      1|#ifndef OPENSSL_NO_ERR
  261|      1|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (261:9): [True: 1, False: 0]
  ------------------
  262|      1|        ERR_load_strings_const(PROV_str_reasons);
  263|      1|#endif
  264|      1|    return 1;
  265|      1|}

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_digest_reset:
  141|    738|{
  142|    738|    EVP_MD_free(pd->alloc_md);
  143|    738|    pd->alloc_md = NULL;
  144|    738|    pd->md = NULL;
  145|    738|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
  146|    738|    ENGINE_finish(pd->engine);
  147|    738|#endif
  148|    738|    pd->engine = NULL;
  149|    738|}
ossl_prov_digest_fetch:
  169|    201|{
  170|    201|    EVP_MD_free(pd->alloc_md);
  171|    201|    pd->md = pd->alloc_md = EVP_MD_fetch(libctx, mdname, propquery);
  172|       |
  173|    201|    return pd->md;
  174|    201|}
ossl_prov_digest_load_from_params:
  179|    201|{
  180|    201|    const OSSL_PARAM *p;
  181|    201|    const char *propquery;
  182|       |
  183|    201|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (183:9): [True: 0, False: 201]
  ------------------
  184|      0|        return 1;
  185|       |
  186|    201|    if (!load_common(params, &propquery, &pd->engine))
  ------------------
  |  Branch (186:9): [True: 0, False: 201]
  ------------------
  187|      0|        return 0;
  188|       |
  189|    201|    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST);
  ------------------
  |  |  122|    201|# define OSSL_ALG_PARAM_DIGEST "digest"
  ------------------
  190|    201|    if (p == NULL)
  ------------------
  |  Branch (190:9): [True: 0, False: 201]
  ------------------
  191|      0|        return 1;
  192|    201|    if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|    201|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (192:9): [True: 0, False: 201]
  ------------------
  193|      0|        return 0;
  194|       |
  195|    201|    ERR_set_mark();
  196|    201|    ossl_prov_digest_fetch(pd, ctx, p->data, propquery);
  197|    201|#ifndef FIPS_MODULE /* Inside the FIPS module, we don't support legacy digests */
  198|    201|    if (pd->md == NULL) {
  ------------------
  |  Branch (198:9): [True: 0, False: 201]
  ------------------
  199|      0|        const EVP_MD *md;
  200|       |
  201|      0|        md = EVP_get_digestbyname(p->data);
  202|       |        /* Do not use global EVP_MDs */
  203|      0|        if (md != NULL && md->origin != EVP_ORIG_GLOBAL)
  ------------------
  |  |  253|      0|#define EVP_ORIG_GLOBAL     1
  ------------------
  |  Branch (203:13): [True: 0, False: 0]
  |  Branch (203:27): [True: 0, False: 0]
  ------------------
  204|      0|            pd->md = md;
  205|      0|    }
  206|    201|#endif
  207|    201|    if (pd->md != NULL)
  ------------------
  |  Branch (207:9): [True: 201, False: 0]
  ------------------
  208|    201|        ERR_pop_to_mark();
  209|      0|    else
  210|      0|        ERR_clear_last_mark();
  211|    201|    return pd->md != NULL;
  212|    201|}
ossl_prov_digest_md:
  221|    201|{
  222|    201|    return pd->md;
  223|    201|}
ossl_prov_digest_engine:
  226|    201|{
  227|    201|    return pd->engine;
  228|    201|}
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|}
provider_util.c:load_common:
   53|    201|{
   54|    201|    const OSSL_PARAM *p;
   55|       |
   56|    201|    *propquery = NULL;
   57|    201|    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_PROPERTIES);
  ------------------
  |  |  126|    201|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  ------------------
   58|    201|    if (p != NULL) {
  ------------------
  |  Branch (58:9): [True: 0, False: 201]
  ------------------
   59|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (59:13): [True: 0, False: 0]
  ------------------
   60|      0|            return 0;
   61|      0|        *propquery = p->data;
   62|      0|    }
   63|       |
   64|    201|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   65|    201|    ENGINE_finish(*engine);
   66|    201|#endif
   67|    201|    *engine = NULL;
   68|       |    /* Inside the FIPS module, we don't support legacy ciphers */
   69|    201|#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_ENGINE)
   70|    201|    p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_ENGINE);
  ------------------
  |  |  123|    201|# define OSSL_ALG_PARAM_ENGINE "engine"
  ------------------
   71|    201|    if (p != NULL) {
  ------------------
  |  Branch (71:9): [True: 0, False: 201]
  ------------------
   72|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (72:13): [True: 0, False: 0]
  ------------------
   73|      0|            return 0;
   74|       |        /* Get a structural reference */
   75|      0|        *engine = ENGINE_by_id(p->data);
   76|      0|        if (*engine == NULL)
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|            return 0;
   78|       |        /* Get a functional reference */
   79|      0|        if (!ENGINE_init(*engine)) {
  ------------------
  |  Branch (79:13): [True: 0, False: 0]
  ------------------
   80|      0|            ENGINE_free(*engine);
   81|      0|            *engine = NULL;
   82|      0|            return 0;
   83|      0|        }
   84|       |        /* Free the structural reference */
   85|      0|        ENGINE_free(*engine);
   86|      0|    }
   87|    201|#endif
   88|    201|    return 1;
   89|    201|}

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

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

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

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

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|      9|{
  333|      9|    if (ctx != NULL && ctx->alloced) {
  ------------------
  |  Branch (333:9): [True: 9, False: 0]
  |  Branch (333:24): [True: 0, False: 9]
  ------------------
  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|      9|}
ossl_cipher_generic_einit:
  383|  4.01k|{
  384|  4.01k|    return cipher_generic_init_internal((PROV_CIPHER_CTX *)vctx, key, keylen,
  385|  4.01k|                                        iv, ivlen, params, 1);
  386|  4.01k|}
ossl_cipher_generic_block_update:
  424|  1.40k|{
  425|  1.40k|    size_t outlint = 0;
  426|  1.40k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  427|  1.40k|    size_t blksz = ctx->blocksize;
  428|  1.40k|    size_t nextblocks;
  429|       |
  430|  1.40k|    if (!ctx->key_set) {
  ------------------
  |  Branch (430:9): [True: 0, False: 1.40k]
  ------------------
  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|  1.40k|    if (ctx->tlsversion > 0) {
  ------------------
  |  Branch (435:9): [True: 0, False: 1.40k]
  ------------------
  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|  1.40k|    if (ctx->bufsz != 0)
  ------------------
  |  Branch (511:9): [True: 0, False: 1.40k]
  ------------------
  512|      0|        nextblocks = ossl_cipher_fillblock(ctx->buf, &ctx->bufsz, blksz,
  513|      0|                                           &in, &inl);
  514|  1.40k|    else
  515|  1.40k|        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|  1.40k|    if (ctx->bufsz == blksz && (ctx->enc || inl > 0 || !ctx->pad)) {
  ------------------
  |  Branch (522:9): [True: 0, False: 1.40k]
  |  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|  1.40k|    if (nextblocks > 0) {
  ------------------
  |  Branch (535:9): [True: 1.40k, False: 0]
  ------------------
  536|  1.40k|        if (!ctx->enc && ctx->pad && nextblocks == inl) {
  ------------------
  |  Branch (536:13): [True: 0, False: 1.40k]
  |  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|  1.40k|        outlint += nextblocks;
  544|  1.40k|        if (outsize < outlint) {
  ------------------
  |  Branch (544:13): [True: 0, False: 1.40k]
  ------------------
  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|  1.40k|    }
  549|  1.40k|    if (nextblocks > 0) {
  ------------------
  |  Branch (549:9): [True: 1.40k, False: 0]
  ------------------
  550|  1.40k|        if (!ctx->hw->cipher(ctx, out, in, nextblocks)) {
  ------------------
  |  Branch (550:13): [True: 0, False: 1.40k]
  ------------------
  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|  1.40k|        in += nextblocks;
  555|  1.40k|        inl -= nextblocks;
  556|  1.40k|    }
  557|  1.40k|    if (inl != 0
  ------------------
  |  Branch (557:9): [True: 0, False: 1.40k]
  ------------------
  558|  1.40k|        && !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|  1.40k|    *outl = outlint;
  564|  1.40k|    return inl == 0;
  565|  1.40k|}
ossl_cipher_generic_stream_update:
  644|  1.32k|{
  645|  1.32k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  646|       |
  647|  1.32k|    if (!ctx->key_set) {
  ------------------
  |  Branch (647:9): [True: 0, False: 1.32k]
  ------------------
  648|      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)
  |  |  ------------------
  ------------------
  649|      0|        return 0;
  650|      0|    }
  651|       |
  652|  1.32k|    if (inl == 0) {
  ------------------
  |  Branch (652:9): [True: 0, False: 1.32k]
  ------------------
  653|      0|        *outl = 0;
  654|      0|        return 1;
  655|      0|    }
  656|       |
  657|  1.32k|    if (outsize < inl) {
  ------------------
  |  Branch (657:9): [True: 0, False: 1.32k]
  ------------------
  658|      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)
  |  |  ------------------
  ------------------
  659|      0|        return 0;
  660|      0|    }
  661|       |
  662|  1.32k|    if (!ctx->hw->cipher(ctx, out, in, inl)) {
  ------------------
  |  Branch (662:9): [True: 0, False: 1.32k]
  ------------------
  663|      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)
  |  |  ------------------
  ------------------
  664|      0|        return 0;
  665|      0|    }
  666|       |
  667|  1.32k|    *outl = inl;
  668|  1.32k|    if (!ctx->enc && ctx->tlsversion > 0) {
  ------------------
  |  Branch (668:9): [True: 0, False: 1.32k]
  |  Branch (668:22): [True: 0, False: 0]
  ------------------
  669|       |        /*
  670|       |        * Remove any TLS padding. Only used by cipher_aes_cbc_hmac_sha1_hw.c and
  671|       |        * cipher_aes_cbc_hmac_sha256_hw.c
  672|       |        */
  673|      0|        if (ctx->removetlspad) {
  ------------------
  |  Branch (673:13): [True: 0, False: 0]
  ------------------
  674|       |            /*
  675|       |             * We should have already failed in the cipher() call above if this
  676|       |             * isn't true.
  677|       |             */
  678|      0|            if (!ossl_assert(*outl >= (size_t)(out[inl - 1] + 1)))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (678:17): [True: 0, False: 0]
  ------------------
  679|      0|                return 0;
  680|       |            /* The actual padding length */
  681|      0|            *outl -= out[inl - 1] + 1;
  682|      0|        }
  683|       |
  684|       |        /* TLS MAC and explicit IV if relevant. We should have already failed
  685|       |         * in the cipher() call above if *outl is too short.
  686|       |         */
  687|      0|        if (!ossl_assert(*outl >= ctx->removetlsfixed))
  ------------------
  |  |   52|      0|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|      0|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (687:13): [True: 0, False: 0]
  ------------------
  688|      0|            return 0;
  689|      0|        *outl -= ctx->removetlsfixed;
  690|       |
  691|       |        /* Extract the MAC if there is one */
  692|      0|        if (ctx->tlsmacsize > 0) {
  ------------------
  |  Branch (692:13): [True: 0, False: 0]
  ------------------
  693|      0|            if (*outl < ctx->tlsmacsize)
  ------------------
  |  Branch (693:17): [True: 0, False: 0]
  ------------------
  694|      0|                return 0;
  695|       |
  696|      0|            ctx->tlsmac = out + *outl - ctx->tlsmacsize;
  697|      0|            *outl -= ctx->tlsmacsize;
  698|      0|        }
  699|      0|    }
  700|       |
  701|  1.32k|    return 1;
  702|  1.32k|}
ossl_cipher_generic_get_ctx_params:
  749|     12|{
  750|     12|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  751|     12|    OSSL_PARAM *p;
  752|       |
  753|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IVLEN);
  ------------------
  |  |  193|     12|# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
  ------------------
  754|     12|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->ivlen)) {
  ------------------
  |  Branch (754:9): [True: 3, False: 9]
  |  Branch (754:22): [True: 0, False: 3]
  ------------------
  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|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_PADDING);
  ------------------
  |  |  197|     12|# define OSSL_CIPHER_PARAM_PADDING "padding"
  ------------------
  759|     12|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->pad)) {
  ------------------
  |  Branch (759:9): [True: 0, False: 12]
  |  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|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_IV);
  ------------------
  |  |  192|     12|# define OSSL_CIPHER_PARAM_IV "iv"
  ------------------
  764|     12|    if (p != NULL
  ------------------
  |  Branch (764:9): [True: 0, False: 12]
  ------------------
  765|     12|        && !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|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_UPDATED_IV);
  ------------------
  |  |  215|     12|# define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv"
  ------------------
  770|     12|    if (p != NULL
  ------------------
  |  Branch (770:9): [True: 0, False: 12]
  ------------------
  771|     12|        && !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|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_NUM);
  ------------------
  |  |  196|     12|# define OSSL_CIPHER_PARAM_NUM "num"
  ------------------
  776|     12|    if (p != NULL && !OSSL_PARAM_set_uint(p, ctx->num)) {
  ------------------
  |  Branch (776:9): [True: 0, False: 12]
  |  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|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_KEYLEN);
  ------------------
  |  |  194|     12|# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
  ------------------
  781|     12|    if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->keylen)) {
  ------------------
  |  Branch (781:9): [True: 9, False: 3]
  |  Branch (781:22): [True: 0, False: 9]
  ------------------
  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|     12|    p = OSSL_PARAM_locate(params, OSSL_CIPHER_PARAM_TLS_MAC);
  ------------------
  |  |  212|     12|# define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac"
  ------------------
  786|     12|    if (p != NULL
  ------------------
  |  Branch (786:9): [True: 0, False: 12]
  ------------------
  787|     12|        && !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|     12|    return 1;
  792|     12|}
ossl_cipher_generic_set_ctx_params:
  795|  4.01k|{
  796|  4.01k|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  797|  4.01k|    const OSSL_PARAM *p;
  798|       |
  799|  4.01k|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (799:9): [True: 4.01k, False: 0]
  ------------------
  800|  4.01k|        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_initiv:
  851|  1.32k|{
  852|  1.32k|    if (ivlen != ctx->ivlen
  ------------------
  |  Branch (852:9): [True: 0, False: 1.32k]
  ------------------
  853|  1.32k|        || ivlen > sizeof(ctx->iv)) {
  ------------------
  |  Branch (853:12): [True: 0, False: 1.32k]
  ------------------
  854|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  855|      0|        return 0;
  856|      0|    }
  857|  1.32k|    ctx->iv_set = 1;
  858|  1.32k|    memcpy(ctx->iv, iv, ivlen);
  859|  1.32k|    memcpy(ctx->oiv, iv, ivlen);
  860|  1.32k|    return 1;
  861|  1.32k|}
ossl_cipher_generic_initkey:
  867|      9|{
  868|      9|    PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
  869|       |
  870|      9|    if ((flags & PROV_CIPHER_FLAG_INVERSE_CIPHER) != 0)
  ------------------
  |  |   46|      9|# define PROV_CIPHER_FLAG_INVERSE_CIPHER   0x0200
  ------------------
  |  Branch (870:9): [True: 0, False: 9]
  ------------------
  871|      0|        ctx->inverse_cipher = 1;
  872|      9|    if ((flags & PROV_CIPHER_FLAG_VARIABLE_LENGTH) != 0)
  ------------------
  |  |   45|      9|# define PROV_CIPHER_FLAG_VARIABLE_LENGTH  0x0100
  ------------------
  |  Branch (872:9): [True: 0, False: 9]
  ------------------
  873|      0|        ctx->variable_keylength = 1;
  874|       |
  875|      9|    ctx->pad = 1;
  876|      9|    ctx->keylen = ((kbits) / 8);
  877|      9|    ctx->ivlen = ((ivbits) / 8);
  878|      9|    ctx->hw = hw;
  879|      9|    ctx->mode = mode;
  880|      9|    ctx->blocksize = blkbits / 8;
  881|      9|    if (provctx != NULL)
  ------------------
  |  Branch (881:9): [True: 9, False: 0]
  ------------------
  882|      9|        ctx->libctx = PROV_LIBCTX_OF(provctx); /* used for rand */
  ------------------
  |  |   31|      9|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  883|      9|}
ciphercommon.c:cipher_generic_init_internal:
  344|  4.01k|{
  345|  4.01k|    ctx->num = 0;
  346|  4.01k|    ctx->bufsz = 0;
  347|  4.01k|    ctx->updated = 0;
  348|  4.01k|    ctx->enc = enc ? 1 : 0;
  ------------------
  |  Branch (348:16): [True: 4.01k, False: 0]
  ------------------
  349|       |
  350|  4.01k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (350:9): [True: 0, False: 4.01k]
  ------------------
  351|      0|        return 0;
  352|       |
  353|  4.01k|    if (iv != NULL && ctx->mode != EVP_CIPH_ECB_MODE) {
  ------------------
  |  |  322|  1.32k|# define         EVP_CIPH_ECB_MODE               0x1
  ------------------
  |  Branch (353:9): [True: 1.32k, False: 2.68k]
  |  Branch (353:23): [True: 1.32k, False: 0]
  ------------------
  354|  1.32k|        if (!ossl_cipher_generic_initiv(ctx, iv, ivlen))
  ------------------
  |  Branch (354:13): [True: 0, False: 1.32k]
  ------------------
  355|      0|            return 0;
  356|  1.32k|    }
  357|  4.01k|    if (iv == NULL && ctx->iv_set
  ------------------
  |  Branch (357:9): [True: 2.68k, False: 1.32k]
  |  Branch (357:23): [True: 1.32k, False: 1.36k]
  ------------------
  358|  4.01k|        && (ctx->mode == EVP_CIPH_CBC_MODE
  ------------------
  |  |  323|  2.65k|# define         EVP_CIPH_CBC_MODE               0x2
  ------------------
  |  Branch (358:13): [True: 0, False: 1.32k]
  ------------------
  359|  1.32k|            || ctx->mode == EVP_CIPH_CFB_MODE
  ------------------
  |  |  324|  2.65k|# define         EVP_CIPH_CFB_MODE               0x3
  ------------------
  |  Branch (359:16): [True: 0, False: 1.32k]
  ------------------
  360|  1.32k|            || ctx->mode == EVP_CIPH_OFB_MODE))
  ------------------
  |  |  325|  1.32k|# define         EVP_CIPH_OFB_MODE               0x4
  ------------------
  |  Branch (360:16): [True: 0, False: 1.32k]
  ------------------
  361|       |        /* reset IV for these modes to keep compatibility with 1.1.1 */
  362|      0|        memcpy(ctx->iv, ctx->oiv, ctx->ivlen);
  363|       |
  364|  4.01k|    if (key != NULL) {
  ------------------
  |  Branch (364:9): [True: 2.68k, False: 1.33k]
  ------------------
  365|  2.68k|        if (ctx->variable_keylength == 0) {
  ------------------
  |  Branch (365:13): [True: 2.68k, False: 0]
  ------------------
  366|  2.68k|            if (keylen != ctx->keylen) {
  ------------------
  |  Branch (366:17): [True: 0, False: 2.68k]
  ------------------
  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|  2.68k|        } else {
  371|      0|            ctx->keylen = keylen;
  372|      0|        }
  373|  2.68k|        if (!ctx->hw->init(ctx, key, ctx->keylen))
  ------------------
  |  Branch (373:13): [True: 0, False: 2.68k]
  ------------------
  374|      0|            return 0;
  375|  2.68k|        ctx->key_set = 1;
  376|  2.68k|    }
  377|  4.01k|    return ossl_cipher_generic_set_ctx_params(ctx, params);
  378|  4.01k|}

ossl_cipher_hw_generic_ctr:
  113|  1.32k|{
  114|  1.32k|    unsigned int num = dat->num;
  115|       |
  116|  1.32k|    if (dat->stream.ctr)
  ------------------
  |  Branch (116:9): [True: 1.32k, False: 0]
  ------------------
  117|  1.32k|        CRYPTO_ctr128_encrypt_ctr32(in, out, len, dat->ks, dat->iv, dat->buf,
  118|  1.32k|                                    &num, dat->stream.ctr);
  119|      0|    else
  120|      0|        CRYPTO_ctr128_encrypt(in, out, len, dat->ks, dat->iv, dat->buf,
  121|      0|                              &num, dat->block);
  122|  1.32k|    dat->num = num;
  123|       |
  124|  1.32k|    return 1;
  125|  1.32k|}

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

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

sha3_prov.c:generic_sha3_absorb:
  151|   160M|{
  152|   160M|    KECCAK1600_CTX *ctx = vctx;
  153|       |
  154|   160M|    if (!(ctx->xof_state == XOF_STATE_INIT ||
  ------------------
  |  |   35|   321M|#define XOF_STATE_INIT    0
  ------------------
  |  Branch (154:11): [True: 160M, False: 285k]
  ------------------
  155|   160M|          ctx->xof_state == XOF_STATE_ABSORB))
  ------------------
  |  |   36|   285k|#define XOF_STATE_ABSORB  1
  ------------------
  |  Branch (155:11): [True: 285k, False: 0]
  ------------------
  156|      0|        return 0;
  157|   160M|    ctx->xof_state = XOF_STATE_ABSORB;
  ------------------
  |  |   36|   160M|#define XOF_STATE_ABSORB  1
  ------------------
  158|   160M|    return SHA3_absorb(ctx->A, inp, len, ctx->block_size);
  159|   160M|}
sha3_prov.c:generic_sha3_final:
  162|   160M|{
  163|   160M|    return ossl_sha3_final((KECCAK1600_CTX *)vctx, out, outlen);
  164|   160M|}
sha3_prov.c:keccak_update:
   75|   494M|{
   76|   494M|    KECCAK1600_CTX *ctx = vctx;
   77|   494M|    const size_t bsz = ctx->block_size;
   78|   494M|    size_t num, rem;
   79|       |
   80|   494M|    if (len == 0)
  ------------------
  |  Branch (80:9): [True: 0, False: 494M]
  ------------------
   81|      0|        return 1;
   82|       |
   83|       |    /* Is there anything in the buffer already ? */
   84|   494M|    if ((num = ctx->bufsz) != 0) {
  ------------------
  |  Branch (84:9): [True: 333M, False: 160M]
  ------------------
   85|       |        /* Calculate how much space is left in the buffer */
   86|   333M|        rem = bsz - num;
   87|       |        /* If the new input does not fill the buffer then just add it */
   88|   333M|        if (len < rem) {
  ------------------
  |  Branch (88:13): [True: 333M, False: 142k]
  ------------------
   89|   333M|            memcpy(ctx->buf + num, inp, len);
   90|   333M|            ctx->bufsz += len;
   91|   333M|            return 1;
   92|   333M|        }
   93|       |        /* otherwise fill up the buffer and absorb the buffer */
   94|   142k|        memcpy(ctx->buf + num, inp, rem);
   95|       |        /* Update the input pointer */
   96|   142k|        inp += rem;
   97|   142k|        len -= rem;
   98|   142k|        ctx->meth.absorb(ctx, ctx->buf, bsz);
   99|   142k|        ctx->bufsz = 0;
  100|   142k|    }
  101|       |    /* Absorb the input - rem = leftover part of the input < blocksize) */
  102|   160M|    rem = ctx->meth.absorb(ctx, inp, len);
  103|       |    /* Copy the leftover bit of the input into the buffer */
  104|   160M|    if (rem) {
  ------------------
  |  Branch (104:9): [True: 160M, False: 17]
  ------------------
  105|   160M|        memcpy(ctx->buf, inp + len - rem, rem);
  106|   160M|        ctx->bufsz = rem;
  107|   160M|    }
  108|   160M|    return 1;
  109|   494M|}
sha3_prov.c:keccak_final:
  113|   160M|{
  114|   160M|    int ret = 1;
  115|   160M|    KECCAK1600_CTX *ctx = vctx;
  116|       |
  117|   160M|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (117:9): [True: 0, False: 160M]
  ------------------
  118|      0|        return 0;
  119|   160M|    if (ctx->md_size == SIZE_MAX) {
  ------------------
  |  Branch (119:9): [True: 0, False: 160M]
  ------------------
  120|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_DIGEST_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)
  |  |  ------------------
  ------------------
  121|      0|        return 0;
  122|      0|    }
  123|   160M|    if (outlen > 0)
  ------------------
  |  Branch (123:9): [True: 160M, False: 0]
  ------------------
  124|   160M|        ret = ctx->meth.final(ctx, out, ctx->md_size);
  125|       |
  126|   160M|    *outl = ctx->md_size;
  127|   160M|    return ret;
  128|   160M|}
sha3_prov.c:keccak_freectx:
  559|    390|{
  560|    390|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  561|       |
  562|    390|    OPENSSL_clear_free(ctx,  sizeof(*ctx));
  ------------------
  |  |  113|    390|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    390|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    390|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  563|    390|}
sha3_prov.c:keccak_init:
   60|   160M|{
   61|   160M|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (61:9): [True: 0, False: 160M]
  ------------------
   62|      0|        return 0;
   63|       |    /* The newctx() handles most of the ctx fixed setup. */
   64|   160M|    ossl_sha3_reset((KECCAK1600_CTX *)vctx);
   65|   160M|    return 1;
   66|   160M|}
sha3_prov.c:keccak_init_params:
   69|   160M|{
   70|   160M|    return keccak_init(vctx, NULL)
  ------------------
  |  Branch (70:12): [True: 160M, False: 0]
  ------------------
   71|   160M|            && shake_set_ctx_params(vctx, params);
  ------------------
  |  Branch (71:16): [True: 160M, False: 0]
  ------------------
   72|   160M|}
sha3_prov.c:shake_set_ctx_params:
  632|   321M|{
  633|   321M|    const OSSL_PARAM *p;
  634|   321M|    KECCAK1600_CTX *ctx = (KECCAK1600_CTX *)vctx;
  635|       |
  636|   321M|    if (ctx == NULL)
  ------------------
  |  Branch (636:9): [True: 0, False: 321M]
  ------------------
  637|      0|        return 0;
  638|   321M|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (638:9): [True: 160M, False: 160M]
  ------------------
  639|   160M|        return 1;
  640|       |
  641|   160M|    p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_XOFLEN);
  ------------------
  |  |  226|   160M|# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
  ------------------
  642|   160M|    if (p == NULL)
  ------------------
  |  Branch (642:9): [True: 0, False: 160M]
  ------------------
  643|      0|        p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_SIZE);
  ------------------
  |  |  223|      0|# define OSSL_DIGEST_PARAM_SIZE "size"
  ------------------
  644|       |
  645|   160M|    if (p != NULL && !OSSL_PARAM_get_size_t(p, &ctx->md_size)) {
  ------------------
  |  Branch (645:9): [True: 160M, False: 0]
  |  Branch (645:22): [True: 0, False: 160M]
  ------------------
  646|      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)
  |  |  ------------------
  ------------------
  647|      0|        return 0;
  648|      0|    }
  649|   160M|    return 1;
  650|   160M|}
sha3_prov.c:shake_256_newctx:
  502|    390|static void *name##_newctx(void *provctx)                                      \
  503|    390|{                                                                              \
  504|    390|    KECCAK1600_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |  104|    390|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    390|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    390|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (504:27): [True: 390, False: 0]
  ------------------
  505|    390|                                                : NULL;                        \
  506|    390|                                                                               \
  507|    390|    if (ctx == NULL)                                                           \
  ------------------
  |  Branch (507:9): [True: 0, False: 390]
  ------------------
  508|    390|        return NULL;                                                           \
  509|    390|    ossl_keccak_init(ctx, pad, bitlen, mdlen);                                 \
  510|    390|    if (mdlen == 0)                                                            \
  ------------------
  |  Branch (510:9): [Folded - Ignored]
  ------------------
  511|    390|        ctx->md_size = SIZE_MAX;                                               \
  512|    390|    SHAKE_SET_MD(uname, typ)                                                   \
  ------------------
  |  |  483|    390|# define SHAKE_SET_MD(uname, typ) ctx->meth = shake_generic_md;
  ------------------
  513|    390|    return ctx;                                                                \
  514|    390|}

cipher_aes.c:aes_256_ecb_newctx:
  204|      6|static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
  205|      6|{                                                                              \
  206|      6|     PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx))\
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  |  Branch (206:32): [True: 6, False: 0]
  ------------------
  207|      6|                                                     : NULL;                   \
  208|      6|     if (ctx != NULL) {                                                        \
  ------------------
  |  Branch (208:10): [True: 6, False: 0]
  ------------------
  209|      6|         ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits,              \
  210|      6|                                     EVP_CIPH_##UCMODE##_MODE, flags,          \
  211|      6|                                     ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\
  212|      6|                                     provctx);                                 \
  213|      6|     }                                                                         \
  214|      6|     return ctx;                                                               \
  215|      6|}                                                                              \
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_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_newctx:
  204|      3|static void * alg##_##kbits##_##lcmode##_newctx(void *provctx)                 \
  205|      3|{                                                                              \
  206|      3|     PROV_##UCALG##_CTX *ctx = ossl_prov_is_running() ? 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__
  |  |  ------------------
  ------------------
  |  Branch (206:32): [True: 3, False: 0]
  ------------------
  207|      3|                                                     : NULL;                   \
  208|      3|     if (ctx != NULL) {                                                        \
  ------------------
  |  Branch (208:10): [True: 3, False: 0]
  ------------------
  209|      3|         ossl_cipher_generic_initkey(ctx, kbits, blkbits, ivbits,              \
  210|      3|                                     EVP_CIPH_##UCMODE##_MODE, flags,          \
  211|      3|                                     ossl_prov_cipher_hw_##alg##_##lcmode(kbits),\
  212|      3|                                     provctx);                                 \
  213|      3|     }                                                                         \
  214|      3|     return ctx;                                                               \
  215|      3|}                                                                              \
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|}                                                                              \

md5_prov.c:md5_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
md5_sha1_prov.c:md5_sha1_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
null_prov.c:nullmd_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
ripemd_prov.c:ripemd160_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha1_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_newctx:
   55|  1.07k|static void *name##_newctx(void *prov_ctx)                                     \
   56|  1.07k|{                                                                              \
   57|  1.07k|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|  1.07k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.07k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.07k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 1.07k, False: 0]
  ------------------
   58|  1.07k|    return ctx;                                                                \
   59|  1.07k|}                                                                              \
sha2_prov.c:sha256_internal_final:
   41|   227M|                                 size_t outsz)                                 \
   42|   227M|{                                                                              \
   43|   227M|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 227M, False: 0]
  |  Branch (43:35): [True: 227M, False: 0]
  |  Branch (43:56): [True: 227M, False: 0]
  ------------------
   44|   227M|        *outl = dgstsize;                                                      \
   45|   227M|        return 1;                                                              \
   46|   227M|    }                                                                          \
   47|   227M|    return 0;                                                                  \
   48|   227M|}
sha2_prov.c:sha256_freectx:
   60|  1.15k|static void name##_freectx(void *vctx)                                         \
   61|  1.15k|{                                                                              \
   62|  1.15k|    CTX *ctx = (CTX *)vctx;                                                    \
   63|  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__
  |  |  ------------------
  ------------------
   64|  1.15k|}                                                                              \
sha2_prov.c:sha256_dupctx:
   65|     84|static void *name##_dupctx(void *ctx)                                          \
   66|     84|{                                                                              \
   67|     84|    CTX *in = (CTX *)ctx;                                                      \
   68|     84|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|     84|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|     84|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|     84|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 84, False: 0]
  ------------------
   69|     84|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 84, False: 0]
  ------------------
   70|     84|        *ret = *in;                                                            \
   71|     84|    return ret;                                                                \
   72|     84|}                                                                              \
sha2_prov.c:sha256_copyctx:
   73|     84|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|     84|{                                                                              \
   75|     84|    CTX *outctx = (CTX *)voutctx;                                              \
   76|     84|    CTX *inctx = (CTX *)vinctx;                                                \
   77|     84|    *outctx = *inctx;                                                          \
   78|     84|}                                                                              \
sha2_prov.c:sha256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha256_internal_init:
   98|   227M|                                ossl_unused const OSSL_PARAM params[])         \
   99|   227M|{                                                                              \
  100|   227M|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 227M, False: 0]
  |  Branch (100:38): [True: 227M, False: 0]
  ------------------
  101|   227M|}                                                                              \
sha2_prov.c:sha256_192_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_newctx:
   55|    914|static void *name##_newctx(void *prov_ctx)                                     \
   56|    914|{                                                                              \
   57|    914|    CTX *ctx = ossl_prov_is_running() ? OPENSSL_zalloc(sizeof(*ctx)) : NULL;   \
  ------------------
  |  |  104|    914|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    914|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    914|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (57:16): [True: 914, False: 0]
  ------------------
   58|    914|    return ctx;                                                                \
   59|    914|}                                                                              \
sha2_prov.c:sha512_internal_final:
   41|  14.9M|                                 size_t outsz)                                 \
   42|  14.9M|{                                                                              \
   43|  14.9M|    if (ossl_prov_is_running() && outsz >= dgstsize && fin(out, ctx)) {        \
  ------------------
  |  Branch (43:9): [True: 14.9M, False: 0]
  |  Branch (43:35): [True: 14.9M, False: 0]
  |  Branch (43:56): [True: 14.9M, False: 0]
  ------------------
   44|  14.9M|        *outl = dgstsize;                                                      \
   45|  14.9M|        return 1;                                                              \
   46|  14.9M|    }                                                                          \
   47|  14.9M|    return 0;                                                                  \
   48|  14.9M|}
sha2_prov.c:sha512_freectx:
   60|  1.03k|static void name##_freectx(void *vctx)                                         \
   61|  1.03k|{                                                                              \
   62|  1.03k|    CTX *ctx = (CTX *)vctx;                                                    \
   63|  1.03k|    OPENSSL_clear_free(ctx,  sizeof(*ctx));                                    \
  ------------------
  |  |  113|  1.03k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|  1.03k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|  1.03k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|  1.03k|}                                                                              \
sha2_prov.c:sha512_dupctx:
   65|    117|static void *name##_dupctx(void *ctx)                                          \
   66|    117|{                                                                              \
   67|    117|    CTX *in = (CTX *)ctx;                                                      \
   68|    117|    CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL;   \
  ------------------
  |  |  102|    117|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    117|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    117|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (68:16): [True: 117, False: 0]
  ------------------
   69|    117|    if (ret != NULL)                                                           \
  ------------------
  |  Branch (69:9): [True: 117, False: 0]
  ------------------
   70|    117|        *ret = *in;                                                            \
   71|    117|    return ret;                                                                \
   72|    117|}                                                                              \
sha2_prov.c:sha512_copyctx:
   73|    117|static void name##_copyctx(void *voutctx, void *vinctx)                        \
   74|    117|{                                                                              \
   75|    117|    CTX *outctx = (CTX *)voutctx;                                              \
   76|    117|    CTX *inctx = (CTX *)vinctx;                                                \
   77|    117|    *outctx = *inctx;                                                          \
   78|    117|}                                                                              \
sha2_prov.c:sha512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_internal_init:
   98|  14.9M|                                ossl_unused const OSSL_PARAM params[])         \
   99|  14.9M|{                                                                              \
  100|  14.9M|    return ossl_prov_is_running() && init(ctx);                                \
  ------------------
  |  Branch (100:12): [True: 14.9M, False: 0]
  |  Branch (100:38): [True: 14.9M, False: 0]
  ------------------
  101|  14.9M|}                                                                              \
sha2_prov.c:sha512_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha2_prov.c:sha512_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:sha3_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_224_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_384_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_512_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:shake_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_128_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sha3_prov.c:keccak_kmac_256_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}
sm3_prov.c:sm3_get_params:
   28|      1|static int name##_get_params(OSSL_PARAM params[])                              \
   29|      1|{                                                                              \
   30|      1|    return ossl_digest_default_get_params(params, blksize, dgstsize, flags);   \
   31|      1|}

slh_dsa_kmgmt.c:slh_dsa_sha2_128s_new_key:
  425|     23|    {                                                                          \
  426|     23|        return slh_dsa_new_key(provctx, alg);                                  \
  427|     23|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_new_key:
   49|    150|{
   50|    150|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (50:9): [True: 0, False: 150]
  ------------------
   51|      0|        return 0;
   52|       |
   53|    150|    return ossl_slh_dsa_key_new(PROV_LIBCTX_OF(provctx), NULL, alg);
  ------------------
  |  |   31|    150|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
   54|    150|}
slh_dsa_kmgmt.c:slh_dsa_free_key:
   57|    639|{
   58|    639|    ossl_slh_dsa_key_free((SLH_DSA_KEY *)keydata);
   59|    639|}
slh_dsa_kmgmt.c:slh_dsa_has:
   69|    378|{
   70|    378|    const SLH_DSA_KEY *key = keydata;
   71|       |
   72|    378|    if (!ossl_prov_is_running() || key == NULL)
  ------------------
  |  Branch (72:9): [True: 0, False: 378]
  |  Branch (72:36): [True: 0, False: 378]
  ------------------
   73|      0|        return 0;
   74|    378|    if ((selection & SLH_DSA_POSSIBLE_SELECTIONS) == 0)
  ------------------
  |  |   38|    378|#define SLH_DSA_POSSIBLE_SELECTIONS (OSSL_KEYMGMT_SELECT_KEYPAIR)
  |  |  ------------------
  |  |  |  |  650|    378|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|    378|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|    378|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (74:9): [True: 0, False: 378]
  ------------------
   75|      0|        return 1; /* the selection is not missing */
   76|       |
   77|    378|    return ossl_slh_dsa_key_has(key, selection);
   78|    378|}
slh_dsa_kmgmt.c:slh_dsa_match:
   81|    163|{
   82|    163|    const SLH_DSA_KEY *key1 = keydata1;
   83|    163|    const SLH_DSA_KEY *key2 = keydata2;
   84|       |
   85|    163|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (85:9): [True: 0, False: 163]
  ------------------
   86|      0|        return 0;
   87|    163|    if (key1 == NULL || key2 == NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 163]
  |  Branch (87:25): [True: 0, False: 163]
  ------------------
   88|      0|        return 0;
   89|    163|    return ossl_slh_dsa_key_equal(key1, key2, selection);
   90|    163|}
slh_dsa_kmgmt.c:slh_dsa_import:
  105|    150|{
  106|    150|    SLH_DSA_KEY *key = keydata;
  107|    150|    int include_priv;
  108|       |
  109|    150|    if (!ossl_prov_is_running() || key == NULL)
  ------------------
  |  Branch (109:9): [True: 0, False: 150]
  |  Branch (109:36): [True: 0, False: 150]
  ------------------
  110|      0|        return 0;
  111|       |
  112|    150|    if ((selection & SLH_DSA_POSSIBLE_SELECTIONS) == 0)
  ------------------
  |  |   38|    150|#define SLH_DSA_POSSIBLE_SELECTIONS (OSSL_KEYMGMT_SELECT_KEYPAIR)
  |  |  ------------------
  |  |  |  |  650|    150|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  640|    150|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  |  |  ------------------
  |  |  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  |  |  ------------------
  |  |  |  |  |  |  641|    150|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (112:9): [True: 0, False: 150]
  ------------------
  113|      0|        return 0;
  114|       |
  115|    150|    include_priv = ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0);
  ------------------
  |  |  640|    150|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  116|    150|    return ossl_slh_dsa_key_fromdata(key, params, include_priv);
  117|    150|}
slh_dsa_kmgmt.c:slh_dsa_export:
  220|    126|{
  221|    126|    SLH_DSA_KEY *key = keydata;
  222|    126|    OSSL_PARAM_BLD *tmpl;
  223|    126|    OSSL_PARAM *params = NULL;
  224|    126|    int ret = 0;
  225|       |
  226|    126|    if (!ossl_prov_is_running() || key == NULL)
  ------------------
  |  Branch (226:9): [True: 0, False: 126]
  |  Branch (226:36): [True: 0, False: 126]
  ------------------
  227|      0|        return 0;
  228|       |
  229|    126|    if ((selection & OSSL_KEYMGMT_SELECT_KEYPAIR) == 0)
  ------------------
  |  |  650|    126|    ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  640|    126|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  |  |  ------------------
  |  |                   ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
  |  |  ------------------
  |  |  |  |  641|    126|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  |  |  ------------------
  ------------------
  |  Branch (229:9): [True: 0, False: 126]
  ------------------
  230|      0|        return 0;
  231|       |
  232|    126|    tmpl = OSSL_PARAM_BLD_new();
  233|    126|    if (tmpl == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 126]
  ------------------
  234|      0|        return 0;
  235|       |
  236|    126|    if (!key_to_params(key, tmpl, selection))
  ------------------
  |  Branch (236:9): [True: 0, False: 126]
  ------------------
  237|      0|        goto err;
  238|       |
  239|    126|    params = OSSL_PARAM_BLD_to_param(tmpl);
  240|    126|    if (params == NULL)
  ------------------
  |  Branch (240:9): [True: 0, False: 126]
  ------------------
  241|      0|        goto err;
  242|       |
  243|    126|    ret = param_cb(params, cbarg);
  244|    126|    OSSL_PARAM_free(params);
  245|    126|err:
  246|    126|    OSSL_PARAM_BLD_free(tmpl);
  247|    126|    return ret;
  248|    126|}
slh_dsa_kmgmt.c:key_to_params:
  150|    126|{
  151|       |    /* Error if there is no key or public key */
  152|    126|    if (key == NULL || ossl_slh_dsa_key_get_pub(key) == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 126]
  |  Branch (152:24): [True: 0, False: 126]
  ------------------
  153|      0|        return 0;
  154|       |
  155|    126|    if (((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
  ------------------
  |  |  640|    126|# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY            0x01
  ------------------
  |  Branch (155:9): [True: 126, False: 0]
  ------------------
  156|    126|        && ossl_slh_dsa_key_get_priv(key) != NULL)
  ------------------
  |  Branch (156:12): [True: 126, False: 0]
  ------------------
  157|    126|        if (ossl_param_build_set_octet_string(tmpl, NULL,
  ------------------
  |  Branch (157:13): [True: 0, False: 126]
  ------------------
  158|    126|                                              OSSL_PKEY_PARAM_PRIV_KEY,
  ------------------
  |  |  431|    126|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  159|    126|                                              ossl_slh_dsa_key_get_priv(key),
  160|    126|                                              ossl_slh_dsa_key_get_priv_len(key)) != 1)
  161|      0|            return 0;
  162|       |
  163|    126|    if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) == 0)
  ------------------
  |  |  641|    126|# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY             0x02
  ------------------
  |  Branch (163:9): [True: 0, False: 126]
  ------------------
  164|      0|        return 1;
  165|       |
  166|    126|    return ossl_param_build_set_octet_string(tmpl, NULL,
  167|    126|                                             OSSL_PKEY_PARAM_PUB_KEY,
  ------------------
  |  |  433|    126|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  168|    126|                                             ossl_slh_dsa_key_get_pub(key),
  169|    126|                                             ossl_slh_dsa_key_get_pub_len(key));
  170|    126|}
slh_dsa_kmgmt.c:slh_dsa_get_params:
  173|    620|{
  174|    620|    SLH_DSA_KEY *key = keydata;
  175|    620|    OSSL_PARAM *p;
  176|    620|    const uint8_t *pub, *priv;
  177|       |
  178|    620|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_BITS)) != NULL
  ------------------
  |  |  360|    620|# define OSSL_PKEY_PARAM_BITS "bits"
  ------------------
  |  Branch (178:9): [True: 620, False: 0]
  ------------------
  179|    620|            && !OSSL_PARAM_set_int(p, 8 * ossl_slh_dsa_key_get_pub_len(key)))
  ------------------
  |  Branch (179:16): [True: 0, False: 620]
  ------------------
  180|      0|        return 0;
  181|    620|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_BITS)) != NULL
  ------------------
  |  |  487|    620|# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
  ------------------
  |  Branch (181:9): [True: 620, False: 0]
  ------------------
  182|    620|            && !OSSL_PARAM_set_int(p, 8 * ossl_slh_dsa_key_get_n(key)))
  ------------------
  |  Branch (182:16): [True: 0, False: 620]
  ------------------
  183|      0|        return 0;
  184|    620|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MAX_SIZE)) != NULL
  ------------------
  |  |  416|    620|# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
  ------------------
  |  Branch (184:9): [True: 620, False: 0]
  ------------------
  185|    620|            && !OSSL_PARAM_set_int(p, ossl_slh_dsa_key_get_sig_len(key)))
  ------------------
  |  Branch (185:16): [True: 0, False: 620]
  ------------------
  186|      0|        return 0;
  187|    620|    if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_SECURITY_CATEGORY)) != NULL
  ------------------
  |  |  488|    620|# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
  |  |  ------------------
  |  |  |  |  127|    620|# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
  |  |  ------------------
  ------------------
  |  Branch (187:9): [True: 620, False: 0]
  ------------------
  188|    620|            && !OSSL_PARAM_set_int(p, ossl_slh_dsa_key_get_security_category(key)))
  ------------------
  |  Branch (188:16): [True: 0, False: 620]
  ------------------
  189|      0|        return 0;
  190|       |
  191|    620|    priv = ossl_slh_dsa_key_get_priv(key);
  192|    620|    if (priv != NULL) {
  ------------------
  |  Branch (192:9): [True: 620, False: 0]
  ------------------
  193|    620|        p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PRIV_KEY);
  ------------------
  |  |  431|    620|# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
  ------------------
  194|       |        /* Note: ossl_slh_dsa_key_get_priv_len() includes the public key */
  195|    620|        if (p != NULL
  ------------------
  |  Branch (195:13): [True: 0, False: 620]
  ------------------
  196|    620|            && !OSSL_PARAM_set_octet_string(p, priv,
  ------------------
  |  Branch (196:16): [True: 0, False: 0]
  ------------------
  197|      0|                                            ossl_slh_dsa_key_get_priv_len(key)))
  198|      0|            return 0;
  199|    620|    }
  200|    620|    pub = ossl_slh_dsa_key_get_pub(key);
  201|    620|    if (pub != NULL) {
  ------------------
  |  Branch (201:9): [True: 620, False: 0]
  ------------------
  202|    620|        p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_PUB_KEY);
  ------------------
  |  |  433|    620|# define OSSL_PKEY_PARAM_PUB_KEY "pub"
  ------------------
  203|    620|        if (p != NULL
  ------------------
  |  Branch (203:13): [True: 0, False: 620]
  ------------------
  204|    620|            && !OSSL_PARAM_set_octet_string(p, pub,
  ------------------
  |  Branch (204:16): [True: 0, False: 0]
  ------------------
  205|      0|                                            ossl_slh_dsa_key_get_pub_len(key)))
  206|      0|            return 0;
  207|    620|    }
  208|       |    /*
  209|       |     * This allows apps to use an empty digest, so that the old API
  210|       |     * for digest signing can be used.
  211|       |     */
  212|    620|    p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_MANDATORY_DIGEST);
  ------------------
  |  |  414|    620|# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
  ------------------
  213|    620|    if (p != NULL && !OSSL_PARAM_set_utf8_string(p, ""))
  ------------------
  |  Branch (213:9): [True: 0, False: 620]
  |  Branch (213:22): [True: 0, False: 0]
  ------------------
  214|      0|        return 0;
  215|    620|    return 1;
  216|    620|}
slh_dsa_kmgmt.c:slh_dsa_gen_init:
  266|    489|{
  267|    489|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|    489|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  268|    489|    struct slh_dsa_gen_ctx *gctx = NULL;
  269|       |
  270|    489|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (270:9): [True: 0, False: 489]
  ------------------
  271|      0|        return NULL;
  272|       |
  273|    489|    if ((gctx = OPENSSL_zalloc(sizeof(*gctx))) != NULL) {
  ------------------
  |  |  104|    489|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    489|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    489|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (273:9): [True: 489, False: 0]
  ------------------
  274|    489|        gctx->libctx = libctx;
  275|    489|        if (!slh_dsa_gen_set_params(gctx, params)) {
  ------------------
  |  Branch (275:13): [True: 0, False: 489]
  ------------------
  276|      0|            OPENSSL_free(gctx);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  277|      0|            gctx = NULL;
  278|      0|        }
  279|    489|    }
  280|    489|    return gctx;
  281|    489|}
slh_dsa_kmgmt.c:slh_dsa_sha2_128s_gen:
  429|     44|    {                                                                          \
  430|     44|        return slh_dsa_gen(genctx, alg);                                       \
  431|     44|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_gen:
  337|    489|{
  338|    489|    struct slh_dsa_gen_ctx *gctx = genctx;
  339|    489|    SLH_DSA_KEY *key = NULL;
  340|    489|    SLH_DSA_HASH_CTX *ctx = NULL;
  341|       |
  342|    489|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (342:9): [True: 0, False: 489]
  ------------------
  343|      0|        return NULL;
  344|    489|    key = ossl_slh_dsa_key_new(gctx->libctx, gctx->propq, alg);
  345|    489|    if (key == NULL)
  ------------------
  |  Branch (345:9): [True: 0, False: 489]
  ------------------
  346|      0|        return NULL;
  347|    489|    ctx = ossl_slh_dsa_hash_ctx_new(key);
  348|    489|    if (ctx == NULL)
  ------------------
  |  Branch (348:9): [True: 0, False: 489]
  ------------------
  349|      0|        return NULL;
  350|    489|    if (!ossl_slh_dsa_generate_key(ctx, key, gctx->libctx,
  ------------------
  |  Branch (350:9): [True: 0, False: 489]
  ------------------
  351|    489|                                   gctx->entropy, gctx->entropy_len))
  352|      0|        goto err;
  353|       |#ifdef FIPS_MODULE
  354|       |    if (!slh_dsa_fips140_pairwise_test(ctx, key, gctx->libctx)) {
  355|       |        ossl_set_error_state(OSSL_SELF_TEST_TYPE_PCT);
  356|       |        goto err;
  357|       |    }
  358|       |#endif /* FIPS_MODULE */
  359|    489|    ossl_slh_dsa_hash_ctx_free(ctx);
  360|    489|    return key;
  361|      0| err:
  362|      0|    ossl_slh_dsa_hash_ctx_free(ctx);
  363|      0|    ossl_slh_dsa_key_free(key);
  364|      0|    return NULL;
  365|    489|}
slh_dsa_kmgmt.c:slh_dsa_gen_cleanup:
  410|    489|{
  411|    489|    struct slh_dsa_gen_ctx *gctx = genctx;
  412|       |
  413|    489|    if (gctx == NULL)
  ------------------
  |  Branch (413:9): [True: 0, False: 489]
  ------------------
  414|      0|        return;
  415|       |
  416|    489|    OPENSSL_cleanse(gctx->entropy, gctx->entropy_len);
  417|    489|    OPENSSL_free(gctx->propq);
  ------------------
  |  |  115|    489|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    489|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    489|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  418|    489|    OPENSSL_free(gctx);
  ------------------
  |  |  115|    489|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    489|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    489|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  419|    489|}
slh_dsa_kmgmt.c:slh_dsa_gen_set_params:
  368|    489|{
  369|    489|    struct slh_dsa_gen_ctx *gctx = genctx;
  370|    489|    const OSSL_PARAM *p;
  371|       |
  372|    489|    if (gctx == NULL)
  ------------------
  |  Branch (372:9): [True: 0, False: 489]
  ------------------
  373|      0|        return 0;
  374|       |
  375|    489|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_SLH_DSA_SEED);
  ------------------
  |  |  489|    489|# define OSSL_PKEY_PARAM_SLH_DSA_SEED "seed"
  ------------------
  376|    489|    if (p != NULL) {
  ------------------
  |  Branch (376:9): [True: 0, False: 489]
  ------------------
  377|      0|        void *vp = gctx->entropy;
  378|      0|        size_t len = sizeof(gctx->entropy);
  379|       |
  380|      0|        if (!OSSL_PARAM_get_octet_string(p, &vp, len, &(gctx->entropy_len))) {
  ------------------
  |  Branch (380:13): [True: 0, False: 0]
  ------------------
  381|      0|            gctx->entropy_len = 0;
  382|      0|            return 0;
  383|      0|        }
  384|      0|    }
  385|       |
  386|    489|    p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
  ------------------
  |  |  432|    489|# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|    489|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  387|    489|    if (p != NULL) {
  ------------------
  |  Branch (387:9): [True: 0, False: 489]
  ------------------
  388|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (388:13): [True: 0, False: 0]
  ------------------
  389|      0|            return 0;
  390|      0|        OPENSSL_free(gctx->propq);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  391|      0|        gctx->propq = OPENSSL_strdup(p->data);
  ------------------
  |  |  119|      0|        CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  392|      0|        if (gctx->propq == NULL)
  ------------------
  |  Branch (392:13): [True: 0, False: 0]
  ------------------
  393|      0|            return 0;
  394|      0|    }
  395|    489|    return 1;
  396|    489|}
slh_dsa_kmgmt.c:slh_dsa_sha2_128f_new_key:
  425|      6|    {                                                                          \
  426|      6|        return slh_dsa_new_key(provctx, alg);                                  \
  427|      6|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_sha2_128f_gen:
  429|     77|    {                                                                          \
  430|     77|        return slh_dsa_gen(genctx, alg);                                       \
  431|     77|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_sha2_192s_new_key:
  425|     11|    {                                                                          \
  426|     11|        return slh_dsa_new_key(provctx, alg);                                  \
  427|     11|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_sha2_192s_gen:
  429|     29|    {                                                                          \
  430|     29|        return slh_dsa_gen(genctx, alg);                                       \
  431|     29|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_sha2_192f_new_key:
  425|     39|    {                                                                          \
  426|     39|        return slh_dsa_new_key(provctx, alg);                                  \
  427|     39|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_sha2_192f_gen:
  429|     83|    {                                                                          \
  430|     83|        return slh_dsa_gen(genctx, alg);                                       \
  431|     83|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_sha2_256s_new_key:
  425|      4|    {                                                                          \
  426|      4|        return slh_dsa_new_key(provctx, alg);                                  \
  427|      4|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_sha2_256s_gen:
  429|     39|    {                                                                          \
  430|     39|        return slh_dsa_gen(genctx, alg);                                       \
  431|     39|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_sha2_256f_new_key:
  425|     13|    {                                                                          \
  426|     13|        return slh_dsa_new_key(provctx, alg);                                  \
  427|     13|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_sha2_256f_gen:
  429|     47|    {                                                                          \
  430|     47|        return slh_dsa_gen(genctx, alg);                                       \
  431|     47|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_128s_new_key:
  425|      6|    {                                                                          \
  426|      6|        return slh_dsa_new_key(provctx, alg);                                  \
  427|      6|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_128s_gen:
  429|     13|    {                                                                          \
  430|     13|        return slh_dsa_gen(genctx, alg);                                       \
  431|     13|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_128f_new_key:
  425|     13|    {                                                                          \
  426|     13|        return slh_dsa_new_key(provctx, alg);                                  \
  427|     13|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_128f_gen:
  429|     25|    {                                                                          \
  430|     25|        return slh_dsa_gen(genctx, alg);                                       \
  431|     25|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_192s_new_key:
  425|      8|    {                                                                          \
  426|      8|        return slh_dsa_new_key(provctx, alg);                                  \
  427|      8|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_192s_gen:
  429|     19|    {                                                                          \
  430|     19|        return slh_dsa_gen(genctx, alg);                                       \
  431|     19|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_192f_new_key:
  425|      4|    {                                                                          \
  426|      4|        return slh_dsa_new_key(provctx, alg);                                  \
  427|      4|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_192f_gen:
  429|     53|    {                                                                          \
  430|     53|        return slh_dsa_gen(genctx, alg);                                       \
  431|     53|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_256s_new_key:
  425|      9|    {                                                                          \
  426|      9|        return slh_dsa_new_key(provctx, alg);                                  \
  427|      9|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_256s_gen:
  429|     36|    {                                                                          \
  430|     36|        return slh_dsa_gen(genctx, alg);                                       \
  431|     36|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_256f_new_key:
  425|     14|    {                                                                          \
  426|     14|        return slh_dsa_new_key(provctx, alg);                                  \
  427|     14|    }                                                                          \
slh_dsa_kmgmt.c:slh_dsa_shake_256f_gen:
  429|     24|    {                                                                          \
  430|     24|        return slh_dsa_gen(genctx, alg);                                       \
  431|     24|    }                                                                          \

hmac_prov.c:hmac_new:
   77|    738|{
   78|    738|    struct hmac_data_st *macctx;
   79|       |
   80|    738|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (80:9): [True: 0, False: 738]
  ------------------
   81|      0|        return NULL;
   82|       |
   83|    738|    if ((macctx = OPENSSL_zalloc(sizeof(*macctx))) == NULL
  ------------------
  |  |  104|    738|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    738|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    738|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (83:9): [True: 0, False: 738]
  ------------------
   84|    738|        || (macctx->ctx = HMAC_CTX_new()) == NULL) {
  ------------------
  |  Branch (84:12): [True: 0, False: 738]
  ------------------
   85|      0|        OPENSSL_free(macctx);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
   86|      0|        return NULL;
   87|      0|    }
   88|    738|    macctx->provctx = provctx;
   89|    738|    OSSL_FIPS_IND_INIT(macctx)
   90|       |
   91|    738|    return macctx;
   92|    738|}
hmac_prov.c:hmac_free:
   95|    738|{
   96|    738|    struct hmac_data_st *macctx = vmacctx;
   97|       |
   98|    738|    if (macctx != NULL) {
  ------------------
  |  Branch (98:9): [True: 738, False: 0]
  ------------------
   99|    738|        HMAC_CTX_free(macctx->ctx);
  100|    738|        ossl_prov_digest_reset(&macctx->digest);
  101|    738|        OPENSSL_secure_clear_free(macctx->key, macctx->keylen);
  ------------------
  |  |  129|    738|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    738|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    738|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  102|    738|        OPENSSL_free(macctx);
  ------------------
  |  |  115|    738|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    738|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    738|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  103|    738|    }
  104|    738|}
hmac_prov.c:hmac_init:
  200|    201|{
  201|    201|    struct hmac_data_st *macctx = vmacctx;
  202|       |
  203|    201|    if (!ossl_prov_is_running() || !hmac_set_ctx_params(macctx, params))
  ------------------
  |  Branch (203:9): [True: 0, False: 201]
  |  Branch (203:36): [True: 0, False: 201]
  ------------------
  204|      0|        return 0;
  205|       |
  206|    201|    if (key != NULL)
  ------------------
  |  Branch (206:9): [True: 201, False: 0]
  ------------------
  207|    201|        return hmac_setkey(macctx, key, keylen);
  208|       |
  209|       |    /* Just reinit the HMAC context */
  210|      0|    return HMAC_Init_ex(macctx->ctx, NULL, 0, NULL, NULL);
  211|    201|}
hmac_prov.c:hmac_setkey:
  157|    201|{
  158|    201|    const EVP_MD *digest;
  159|       |
  160|       |#ifdef FIPS_MODULE
  161|       |    /*
  162|       |     * KDF's pass a salt rather than a key,
  163|       |     * which is why it skips the key check unless "HMAC" is fetched directly.
  164|       |     */
  165|       |    if (!macctx->internal) {
  166|       |        OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(macctx->provctx);
  167|       |        int approved = ossl_mac_check_key_size(keylen);
  168|       |
  169|       |        if (!approved) {
  170|       |            if (!OSSL_FIPS_IND_ON_UNAPPROVED(macctx, OSSL_FIPS_IND_SETTABLE0,
  171|       |                                             libctx, "HMAC", "keysize",
  172|       |                                             ossl_fips_config_hmac_key_check)) {
  173|       |                ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH);
  174|       |                return 0;
  175|       |            }
  176|       |        }
  177|       |    }
  178|       |#endif
  179|       |
  180|    201|    if (macctx->key != NULL)
  ------------------
  |  Branch (180:9): [True: 0, False: 201]
  ------------------
  181|      0|        OPENSSL_secure_clear_free(macctx->key, macctx->keylen);
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  182|       |    /* Keep a copy of the key in case we need it for TLS HMAC */
  183|    201|    macctx->key = OPENSSL_secure_malloc(keylen > 0 ? keylen : 1);
  ------------------
  |  |  123|    402|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    201|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    201|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (123:30): [True: 201, False: 0]
  |  |  ------------------
  ------------------
  184|    201|    if (macctx->key == NULL)
  ------------------
  |  Branch (184:9): [True: 0, False: 201]
  ------------------
  185|      0|        return 0;
  186|       |
  187|    201|    memcpy(macctx->key, key, keylen);
  188|    201|    macctx->keylen = keylen;
  189|       |
  190|    201|    digest = ossl_prov_digest_md(&macctx->digest);
  191|       |    /* HMAC_Init_ex doesn't tolerate all zero params, so we must be careful */
  192|    201|    if (key != NULL || (macctx->tls_data_size == 0 && digest != NULL))
  ------------------
  |  Branch (192:9): [True: 201, False: 0]
  |  Branch (192:25): [True: 0, False: 0]
  |  Branch (192:55): [True: 0, False: 0]
  ------------------
  193|    201|        return HMAC_Init_ex(macctx->ctx, key, keylen, digest,
  194|    201|                            ossl_prov_digest_engine(&macctx->digest));
  195|      0|    return 1;
  196|    201|}
hmac_prov.c:hmac_update:
  215|    402|{
  216|    402|    struct hmac_data_st *macctx = vmacctx;
  217|       |
  218|    402|    if (macctx->tls_data_size > 0) {
  ------------------
  |  Branch (218:9): [True: 0, False: 402]
  ------------------
  219|       |        /* We're doing a TLS HMAC */
  220|      0|        if (!macctx->tls_header_set) {
  ------------------
  |  Branch (220:13): [True: 0, False: 0]
  ------------------
  221|       |            /* We expect the first update call to contain the TLS header */
  222|      0|            if (datalen != sizeof(macctx->tls_header))
  ------------------
  |  Branch (222:17): [True: 0, False: 0]
  ------------------
  223|      0|                return 0;
  224|      0|            memcpy(macctx->tls_header, data, datalen);
  225|      0|            macctx->tls_header_set = 1;
  226|      0|            return 1;
  227|      0|        }
  228|       |        /* macctx->tls_data_size is datalen plus the padding length */
  229|      0|        if (macctx->tls_data_size < datalen)
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|      0|            return 0;
  231|       |
  232|      0|        return ssl3_cbc_digest_record(ossl_prov_digest_md(&macctx->digest),
  233|      0|                                      macctx->tls_mac_out,
  234|      0|                                      &macctx->tls_mac_out_size,
  235|      0|                                      macctx->tls_header,
  236|      0|                                      data,
  237|      0|                                      datalen,
  238|      0|                                      macctx->tls_data_size,
  239|      0|                                      macctx->key,
  240|      0|                                      macctx->keylen,
  241|      0|                                      0);
  242|      0|    }
  243|       |
  244|    402|    return HMAC_Update(macctx->ctx, data, datalen);
  245|    402|}
hmac_prov.c:hmac_final:
  249|    201|{
  250|    201|    unsigned int hlen;
  251|    201|    struct hmac_data_st *macctx = vmacctx;
  252|       |
  253|    201|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (253:9): [True: 0, False: 201]
  ------------------
  254|      0|        return 0;
  255|    201|    if (macctx->tls_data_size > 0) {
  ------------------
  |  Branch (255:9): [True: 0, False: 201]
  ------------------
  256|      0|        if (macctx->tls_mac_out_size == 0)
  ------------------
  |  Branch (256:13): [True: 0, False: 0]
  ------------------
  257|      0|            return 0;
  258|      0|        if (outl != NULL)
  ------------------
  |  Branch (258:13): [True: 0, False: 0]
  ------------------
  259|      0|            *outl = macctx->tls_mac_out_size;
  260|      0|        memcpy(out, macctx->tls_mac_out, macctx->tls_mac_out_size);
  261|      0|        return 1;
  262|      0|    }
  263|    201|    if (!HMAC_Final(macctx->ctx, out, &hlen))
  ------------------
  |  Branch (263:9): [True: 0, False: 201]
  ------------------
  264|      0|        return 0;
  265|    201|    *outl = hlen;
  266|    201|    return 1;
  267|    201|}
hmac_prov.c:hmac_get_ctx_params:
  282|    201|{
  283|    201|    struct hmac_data_st *macctx = vmacctx;
  284|    201|    OSSL_PARAM *p;
  285|       |
  286|    201|    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_SIZE)) != NULL
  ------------------
  |  |  347|    201|# define OSSL_MAC_PARAM_SIZE "size"
  ------------------
  |  Branch (286:9): [True: 201, False: 0]
  ------------------
  287|    201|            && !OSSL_PARAM_set_size_t(p, hmac_size(macctx)))
  ------------------
  |  Branch (287:16): [True: 0, False: 201]
  ------------------
  288|      0|        return 0;
  289|       |
  290|    201|    if ((p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_BLOCK_SIZE)) != NULL
  ------------------
  |  |  332|    201|# define OSSL_MAC_PARAM_BLOCK_SIZE "block-size"
  ------------------
  |  Branch (290:9): [True: 0, False: 201]
  ------------------
  291|    201|            && !OSSL_PARAM_set_int(p, hmac_block_size(macctx)))
  ------------------
  |  Branch (291:16): [True: 0, False: 0]
  ------------------
  292|      0|        return 0;
  293|       |
  294|       |#ifdef FIPS_MODULE
  295|       |    p = OSSL_PARAM_locate(params, OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR);
  296|       |    if (p != NULL) {
  297|       |        int approved = 0;
  298|       |
  299|       |        if (!macctx->internal)
  300|       |            approved = OSSL_FIPS_IND_GET(macctx)->approved;
  301|       |        if (!OSSL_PARAM_set_int(p, approved))
  302|       |            return 0;
  303|       |    }
  304|       |#endif
  305|    201|    return 1;
  306|    201|}
hmac_prov.c:hmac_size:
  142|    201|{
  143|    201|    return HMAC_size(macctx->ctx);
  144|    201|}
hmac_prov.c:hmac_set_ctx_params:
  328|    201|{
  329|    201|    struct hmac_data_st *macctx = vmacctx;
  330|    201|    OSSL_LIB_CTX *ctx = PROV_LIBCTX_OF(macctx->provctx);
  ------------------
  |  |   31|    201|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  331|    201|    const OSSL_PARAM *p;
  332|       |
  333|    201|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (333:9): [True: 0, False: 201]
  ------------------
  334|      0|        return 1;
  335|       |
  336|    201|    if (!OSSL_FIPS_IND_SET_CTX_PARAM(macctx, OSSL_FIPS_IND_SETTABLE0, params,
  ------------------
  |  |  146|    201|# define OSSL_FIPS_IND_SET_CTX_PARAM(ctx, id, params, name) 1
  ------------------
  |  Branch (336:9): [Folded - Ignored]
  ------------------
  337|    201|                                     OSSL_MAC_PARAM_FIPS_KEY_CHECK))
  338|      0|        return 0;
  339|       |
  340|    201|    if (!ossl_prov_digest_load_from_params(&macctx->digest, params, ctx))
  ------------------
  |  Branch (340:9): [True: 0, False: 201]
  ------------------
  341|      0|        return 0;
  342|       |
  343|    201|    if ((p = OSSL_PARAM_locate_const(params, OSSL_MAC_PARAM_KEY)) != NULL) {
  ------------------
  |  |  344|    201|# define OSSL_MAC_PARAM_KEY "key"
  ------------------
  |  Branch (343:9): [True: 0, False: 201]
  ------------------
  344|      0|        if (p->data_type != OSSL_PARAM_OCTET_STRING)
  ------------------
  |  |  123|      0|# define OSSL_PARAM_OCTET_STRING         5
  ------------------
  |  Branch (344:13): [True: 0, False: 0]
  ------------------
  345|      0|            return 0;
  346|       |
  347|      0|        if (!hmac_setkey(macctx, p->data, p->data_size))
  ------------------
  |  Branch (347:13): [True: 0, False: 0]
  ------------------
  348|      0|            return 0;
  349|      0|    }
  350|       |
  351|    201|    if ((p = OSSL_PARAM_locate_const(params,
  ------------------
  |  Branch (351:9): [True: 0, False: 201]
  ------------------
  352|    201|                                     OSSL_MAC_PARAM_TLS_DATA_SIZE)) != NULL) {
  ------------------
  |  |  348|    201|# define OSSL_MAC_PARAM_TLS_DATA_SIZE "tls-data-size"
  ------------------
  353|      0|        if (!OSSL_PARAM_get_size_t(p, &macctx->tls_data_size))
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            return 0;
  355|      0|    }
  356|    201|    return 1;
  357|    201|}

ossl_drbg_lock:
   54|  2.65k|{
   55|  2.65k|    return 1;
   56|  2.65k|}
ossl_drbg_unlock:
   60|  2.65k|{
   61|  2.65k|}
ossl_drbg_get_seed:
  148|      4|{
  149|      4|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  150|      4|    size_t bytes_needed;
  151|      4|    unsigned char *buffer;
  152|       |
  153|       |    /* Figure out how many bytes we need */
  154|      4|    bytes_needed = entropy >= 0 ? (entropy + 7) / 8 : 0;
  ------------------
  |  Branch (154:20): [True: 4, False: 0]
  ------------------
  155|      4|    if (bytes_needed < min_len)
  ------------------
  |  Branch (155:9): [True: 0, False: 4]
  ------------------
  156|      0|        bytes_needed = min_len;
  157|      4|    if (bytes_needed > max_len)
  ------------------
  |  Branch (157:9): [True: 0, False: 4]
  ------------------
  158|      0|        bytes_needed = max_len;
  159|       |
  160|       |    /* Allocate storage */
  161|      4|    buffer = OPENSSL_secure_malloc(bytes_needed);
  ------------------
  |  |  123|      4|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  162|      4|    if (buffer == NULL)
  ------------------
  |  Branch (162:9): [True: 0, False: 4]
  ------------------
  163|      0|        return 0;
  164|       |
  165|       |    /*
  166|       |     * Get random data.  Include our DRBG address as
  167|       |     * additional input, in order to provide a distinction between
  168|       |     * different DRBG child instances.
  169|       |     *
  170|       |     * Note: using the sizeof() operator on a pointer triggers
  171|       |     *       a warning in some static code analyzers, but it's
  172|       |     *       intentional and correct here.
  173|       |     */
  174|      4|    if (!ossl_prov_drbg_generate(drbg, buffer, bytes_needed,
  ------------------
  |  Branch (174:9): [True: 0, False: 4]
  ------------------
  175|      4|                                 drbg->strength, prediction_resistance,
  176|      4|                                 (unsigned char *)&drbg, sizeof(drbg))) {
  177|      0|        OPENSSL_secure_clear_free(buffer, bytes_needed);
  ------------------
  |  |  129|      0|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  178|      0|        ERR_raise(ERR_LIB_PROV, PROV_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)
  |  |  ------------------
  ------------------
  179|      0|        return 0;
  180|      0|    }
  181|      4|    *pout = buffer;
  182|      4|    return bytes_needed;
  183|      4|}
ossl_drbg_clear_seed:
  188|      4|{
  189|      4|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  129|      4|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      4|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      4|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  190|      4|}
ossl_prov_drbg_nonce_ctx_new:
  272|      1|{
  273|      1|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  274|       |
  275|      1|    if (dngbl == NULL)
  ------------------
  |  Branch (275:9): [True: 0, False: 1]
  ------------------
  276|      0|        return NULL;
  277|       |
  278|      1|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  279|      1|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (279:9): [True: 0, False: 1]
  ------------------
  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|      1|    return dngbl;
  285|      1|}
ossl_prov_drbg_nonce_ctx_free:
  288|      1|{
  289|      1|    PROV_DRBG_NONCE_GLOBAL *dngbl = vdngbl;
  290|       |
  291|      1|    if (dngbl == NULL)
  ------------------
  |  Branch (291:9): [True: 0, False: 1]
  ------------------
  292|      0|        return;
  293|       |
  294|      1|    CRYPTO_THREAD_lock_free(dngbl->rand_nonce_lock);
  295|       |
  296|      1|    OPENSSL_free(dngbl);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  297|      1|}
ossl_prov_drbg_instantiate:
  352|      3|{
  353|      3|    unsigned char *nonce = NULL, *entropy = NULL;
  354|      3|    size_t noncelen = 0, entropylen = 0;
  355|      3|    size_t min_entropy, min_entropylen, max_entropylen;
  356|       |
  357|      3|    if (strength > drbg->strength) {
  ------------------
  |  Branch (357:9): [True: 0, False: 3]
  ------------------
  358|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  359|      0|        goto end;
  360|      0|    }
  361|      3|    min_entropy = drbg->strength;
  362|      3|    min_entropylen = drbg->min_entropylen;
  363|      3|    max_entropylen = drbg->max_entropylen;
  364|       |
  365|      3|    if (pers == NULL) {
  ------------------
  |  Branch (365:9): [True: 3, False: 0]
  ------------------
  366|      3|        pers = (const unsigned char *)ossl_pers_string;
  367|      3|        perslen = sizeof(ossl_pers_string);
  368|      3|    }
  369|      3|    if (perslen > drbg->max_perslen) {
  ------------------
  |  Branch (369:9): [True: 0, False: 3]
  ------------------
  370|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PERSONALISATION_STRING_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  371|      0|        goto end;
  372|      0|    }
  373|       |
  374|      3|    if (drbg->state != EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1347|      3|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
  |  Branch (374:9): [True: 0, False: 3]
  ------------------
  375|      0|        if (drbg->state == EVP_RAND_STATE_ERROR)
  ------------------
  |  | 1349|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  |  Branch (375:13): [True: 0, False: 0]
  ------------------
  376|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  377|      0|        else
  378|      0|            ERR_raise(ERR_LIB_PROV, PROV_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)
  |  |  ------------------
  ------------------
  379|      0|        goto end;
  380|      0|    }
  381|       |
  382|      3|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1349|      3|# define EVP_RAND_STATE_ERROR            2
  ------------------
  383|       |
  384|      3|    if (drbg->min_noncelen > 0) {
  ------------------
  |  Branch (384:9): [True: 3, False: 0]
  ------------------
  385|      3|        if (drbg->parent_nonce != NULL) {
  ------------------
  |  Branch (385:13): [True: 0, False: 3]
  ------------------
  386|      0|            noncelen = drbg->parent_nonce(drbg->parent, NULL, drbg->strength,
  387|      0|                                          drbg->min_noncelen,
  388|      0|                                          drbg->max_noncelen);
  389|      0|            if (noncelen == 0) {
  ------------------
  |  Branch (389:17): [True: 0, False: 0]
  ------------------
  390|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  391|      0|                goto end;
  392|      0|            }
  393|      0|            nonce = OPENSSL_malloc(noncelen);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  394|      0|            if (nonce == NULL) {
  ------------------
  |  Branch (394:17): [True: 0, False: 0]
  ------------------
  395|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|                goto end;
  397|      0|            }
  398|      0|            if (noncelen != drbg->parent_nonce(drbg->parent, nonce,
  ------------------
  |  Branch (398:17): [True: 0, False: 0]
  ------------------
  399|      0|                                               drbg->strength,
  400|      0|                                               drbg->min_noncelen,
  401|      0|                                               drbg->max_noncelen)) {
  402|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|                goto end;
  404|      0|            }
  405|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  406|      3|        } else if (drbg->parent != NULL) {
  ------------------
  |  Branch (406:20): [True: 3, False: 0]
  ------------------
  407|      3|#endif
  408|       |            /*
  409|       |             * NIST SP800-90Ar1 section 9.1 says you can combine getting
  410|       |             * the entropy and nonce in 1 call by increasing the entropy
  411|       |             * with 50% and increasing the minimum length to accommodate
  412|       |             * the length of the nonce. We do this in case a nonce is
  413|       |             * required and there is no parental nonce capability.
  414|       |             */
  415|      3|            min_entropy += drbg->strength / 2;
  416|      3|            min_entropylen += drbg->min_noncelen;
  417|      3|            max_entropylen += drbg->max_noncelen;
  418|      3|        }
  419|      0|#ifndef PROV_RAND_GET_RANDOM_NONCE
  420|      0|        else { /* parent == NULL */
  421|      0|            noncelen = prov_drbg_get_nonce(drbg, &nonce, drbg->min_noncelen,
  422|      0|                                           drbg->max_noncelen);
  423|      0|            if (noncelen < drbg->min_noncelen
  ------------------
  |  Branch (423:17): [True: 0, False: 0]
  ------------------
  424|      0|                    || noncelen > drbg->max_noncelen) {
  ------------------
  |  Branch (424:24): [True: 0, False: 0]
  ------------------
  425|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  426|      0|                goto end;
  427|      0|            }
  428|      0|        }
  429|      3|#endif
  430|      3|    }
  431|       |
  432|      3|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|      3|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  433|      3|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (433:9): [True: 3, False: 0]
  ------------------
  434|      3|        drbg->reseed_next_counter++;
  435|      3|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (435:13): [True: 0, False: 3]
  ------------------
  436|      0|            drbg->reseed_next_counter = 1;
  437|      3|    }
  438|       |
  439|      3|    entropylen = get_entropy(drbg, &entropy, min_entropy,
  440|      3|                             min_entropylen, max_entropylen,
  441|      3|                             prediction_resistance);
  442|      3|    if (entropylen < min_entropylen
  ------------------
  |  Branch (442:9): [True: 0, False: 3]
  ------------------
  443|      3|            || entropylen > max_entropylen) {
  ------------------
  |  Branch (443:16): [True: 0, False: 3]
  ------------------
  444|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  445|      0|        goto end;
  446|      0|    }
  447|       |
  448|      3|    if (!drbg->instantiate(drbg, entropy, entropylen, nonce, noncelen,
  ------------------
  |  Branch (448:9): [True: 0, False: 3]
  ------------------
  449|      3|                           pers, perslen)) {
  450|      0|        cleanup_entropy(drbg, entropy, entropylen);
  451|      0|        ERR_raise(ERR_LIB_PROV, PROV_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)
  |  |  ------------------
  ------------------
  452|      0|        goto end;
  453|      0|    }
  454|      3|    cleanup_entropy(drbg, entropy, entropylen);
  455|       |
  456|      3|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1348|      3|# define EVP_RAND_STATE_READY            1
  ------------------
  457|      3|    drbg->generate_counter = 1;
  458|      3|    drbg->reseed_time = time(NULL);
  459|      3|    tsan_store(&drbg->reseed_counter, drbg->reseed_next_counter);
  ------------------
  |  |   62|      3|#   define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  460|       |
  461|      3| end:
  462|      3|    if (nonce != NULL)
  ------------------
  |  Branch (462:9): [True: 0, False: 3]
  ------------------
  463|      0|        ossl_prov_cleanup_nonce(drbg->provctx, nonce, noncelen);
  464|      3|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1348|      3|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (464:9): [True: 3, False: 0]
  ------------------
  465|      3|        return 1;
  466|      0|    return 0;
  467|      3|}
ossl_prov_drbg_generate:
  627|  1.32k|{
  628|  1.32k|    int fork_id;
  629|  1.32k|    int reseed_required = 0;
  630|  1.32k|    int ret = 0;
  631|       |
  632|  1.32k|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (632:9): [True: 0, False: 1.32k]
  ------------------
  633|      0|        return 0;
  634|       |
  635|  1.32k|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (635:9): [True: 4, False: 1.32k]
  |  Branch (635:31): [True: 0, False: 4]
  ------------------
  636|      0|        return 0;
  637|       |
  638|  1.32k|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1348|  1.32k|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (638:9): [True: 0, False: 1.32k]
  ------------------
  639|       |        /* try to recover from previous errors */
  640|      0|        rand_drbg_restart(drbg);
  641|       |
  642|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1349|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  |  Branch (642:13): [True: 0, False: 0]
  ------------------
  643|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  644|      0|            goto err;
  645|      0|        }
  646|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1347|      0|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
  |  Branch (646:13): [True: 0, False: 0]
  ------------------
  647|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_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)
  |  |  ------------------
  ------------------
  648|      0|            goto err;
  649|      0|        }
  650|      0|    }
  651|  1.32k|    if (strength > drbg->strength) {
  ------------------
  |  Branch (651:9): [True: 0, False: 1.32k]
  ------------------
  652|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  653|      0|        goto err;
  654|      0|    }
  655|       |
  656|  1.32k|    if (outlen > drbg->max_request) {
  ------------------
  |  Branch (656:9): [True: 0, False: 1.32k]
  ------------------
  657|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_REQUEST_TOO_LARGE_FOR_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)
  |  |  ------------------
  ------------------
  658|      0|        goto err;
  659|      0|    }
  660|  1.32k|    if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (660:9): [True: 0, False: 1.32k]
  ------------------
  661|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  662|      0|        goto err;
  663|      0|    }
  664|       |
  665|  1.32k|    fork_id = openssl_get_fork_id();
  666|       |
  667|  1.32k|    if (drbg->fork_id != fork_id) {
  ------------------
  |  Branch (667:9): [True: 0, False: 1.32k]
  ------------------
  668|      0|        drbg->fork_id = fork_id;
  669|      0|        reseed_required = 1;
  670|      0|    }
  671|       |
  672|  1.32k|    if (drbg->reseed_interval > 0) {
  ------------------
  |  Branch (672:9): [True: 1.32k, False: 0]
  ------------------
  673|  1.32k|        if (drbg->generate_counter >= drbg->reseed_interval)
  ------------------
  |  Branch (673:13): [True: 0, False: 1.32k]
  ------------------
  674|      0|            reseed_required = 1;
  675|  1.32k|    }
  676|  1.32k|    if (drbg->reseed_time_interval > 0) {
  ------------------
  |  Branch (676:9): [True: 1.32k, False: 0]
  ------------------
  677|  1.32k|        time_t now = time(NULL);
  678|  1.32k|        if (now < drbg->reseed_time
  ------------------
  |  Branch (678:13): [True: 0, False: 1.32k]
  ------------------
  679|  1.32k|            || now - drbg->reseed_time >= drbg->reseed_time_interval)
  ------------------
  |  Branch (679:16): [True: 0, False: 1.32k]
  ------------------
  680|      0|            reseed_required = 1;
  681|  1.32k|    }
  682|  1.32k|    if (drbg->parent != NULL
  ------------------
  |  Branch (682:9): [True: 1.32k, False: 0]
  ------------------
  683|  1.32k|            && get_parent_reseed_count(drbg) != drbg->parent_reseed_counter)
  ------------------
  |  Branch (683:16): [True: 2, False: 1.32k]
  ------------------
  684|      2|        reseed_required = 1;
  685|       |
  686|  1.32k|    if (reseed_required || prediction_resistance) {
  ------------------
  |  Branch (686:9): [True: 2, False: 1.32k]
  |  Branch (686:28): [True: 0, False: 1.32k]
  ------------------
  687|      2|        if (!ossl_prov_drbg_reseed_unlocked(drbg, prediction_resistance, NULL,
  ------------------
  |  Branch (687:13): [True: 0, False: 2]
  ------------------
  688|      2|                                            0, adin, adinlen)) {
  689|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_RESEED_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)
  |  |  ------------------
  ------------------
  690|      0|            goto err;
  691|      0|        }
  692|      2|        adin = NULL;
  693|      2|        adinlen = 0;
  694|      2|    }
  695|       |
  696|  1.32k|    if (!drbg->generate(drbg, out, outlen, adin, adinlen)) {
  ------------------
  |  Branch (696:9): [True: 0, False: 1.32k]
  ------------------
  697|      0|        drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1349|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  698|      0|        ERR_raise(ERR_LIB_PROV, PROV_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)
  |  |  ------------------
  ------------------
  699|      0|        goto err;
  700|      0|    }
  701|       |
  702|  1.32k|    drbg->generate_counter++;
  703|       |
  704|  1.32k|    ret = 1;
  705|  1.32k| err:
  706|  1.32k|    if (drbg->lock != NULL)
  ------------------
  |  Branch (706:9): [True: 4, False: 1.32k]
  ------------------
  707|      4|        CRYPTO_THREAD_unlock(drbg->lock);
  708|       |
  709|  1.32k|    return ret;
  710|  1.32k|}
ossl_drbg_enable_locking:
  757|      1|{
  758|      1|    PROV_DRBG *drbg = vctx;
  759|       |
  760|      1|    if (drbg != NULL && drbg->lock == NULL) {
  ------------------
  |  Branch (760:9): [True: 1, False: 0]
  |  Branch (760:25): [True: 1, False: 0]
  ------------------
  761|      1|        if (drbg->parent_enable_locking != NULL)
  ------------------
  |  Branch (761:13): [True: 1, False: 0]
  ------------------
  762|      1|            if (!drbg->parent_enable_locking(drbg->parent)) {
  ------------------
  |  Branch (762:17): [True: 0, False: 1]
  ------------------
  763|      0|                ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  764|      0|                return 0;
  765|      0|            }
  766|      1|        drbg->lock = CRYPTO_THREAD_lock_new();
  767|      1|        if (drbg->lock == NULL) {
  ------------------
  |  Branch (767:13): [True: 0, False: 1]
  ------------------
  768|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_CREATE_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)
  |  |  ------------------
  ------------------
  769|      0|            return 0;
  770|      0|        }
  771|      1|    }
  772|      1|    return 1;
  773|      1|}
ossl_rand_drbg_new:
  796|      3|{
  797|      3|    PROV_DRBG *drbg;
  798|      3|    unsigned int p_str;
  799|      3|    const OSSL_DISPATCH *pfunc;
  800|       |
  801|      3|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (801:9): [True: 0, False: 3]
  ------------------
  802|      0|        return NULL;
  803|       |
  804|      3|    drbg = OPENSSL_zalloc(sizeof(*drbg));
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  805|      3|    if (drbg == NULL)
  ------------------
  |  Branch (805:9): [True: 0, False: 3]
  ------------------
  806|      0|        return NULL;
  807|       |
  808|      3|    drbg->provctx = provctx;
  809|      3|    drbg->instantiate = instantiate;
  810|      3|    drbg->uninstantiate = uninstantiate;
  811|      3|    drbg->reseed = reseed;
  812|      3|    drbg->generate = generate;
  813|      3|    drbg->fork_id = openssl_get_fork_id();
  814|       |
  815|       |    /* Extract parent's functions */
  816|      3|    drbg->parent = parent;
  817|      3|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_ENABLE_LOCKING)) != NULL)
  ------------------
  |  |  542|      3|# define OSSL_FUNC_RAND_ENABLE_LOCKING                8
  ------------------
  |  Branch (817:9): [True: 3, False: 0]
  ------------------
  818|      3|        drbg->parent_enable_locking = OSSL_FUNC_rand_enable_locking(pfunc);
  819|      3|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_LOCK)) != NULL)
  ------------------
  |  |  543|      3|# define OSSL_FUNC_RAND_LOCK                          9
  ------------------
  |  Branch (819:9): [True: 3, False: 0]
  ------------------
  820|      3|        drbg->parent_lock = OSSL_FUNC_rand_lock(pfunc);
  821|      3|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_UNLOCK)) != NULL)
  ------------------
  |  |  544|      3|# define OSSL_FUNC_RAND_UNLOCK                       10
  ------------------
  |  Branch (821:9): [True: 3, False: 0]
  ------------------
  822|      3|        drbg->parent_unlock = OSSL_FUNC_rand_unlock(pfunc);
  823|      3|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_CTX_PARAMS)) != NULL)
  ------------------
  |  |  549|      3|# define OSSL_FUNC_RAND_GET_CTX_PARAMS               15
  ------------------
  |  Branch (823:9): [True: 3, False: 0]
  ------------------
  824|      3|        drbg->parent_get_ctx_params = OSSL_FUNC_rand_get_ctx_params(pfunc);
  825|      3|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_NONCE)) != NULL)
  ------------------
  |  |  541|      3|# define OSSL_FUNC_RAND_NONCE                         7
  ------------------
  |  Branch (825:9): [True: 0, False: 3]
  ------------------
  826|      0|        drbg->parent_nonce = OSSL_FUNC_rand_nonce(pfunc);
  827|      3|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_GET_SEED)) != NULL)
  ------------------
  |  |  552|      3|# define OSSL_FUNC_RAND_GET_SEED                     18
  ------------------
  |  Branch (827:9): [True: 3, False: 0]
  ------------------
  828|      3|        drbg->parent_get_seed = OSSL_FUNC_rand_get_seed(pfunc);
  829|      3|    if ((pfunc = find_call(p_dispatch, OSSL_FUNC_RAND_CLEAR_SEED)) != NULL)
  ------------------
  |  |  553|      3|# define OSSL_FUNC_RAND_CLEAR_SEED                   19
  ------------------
  |  Branch (829:9): [True: 3, False: 0]
  ------------------
  830|      3|        drbg->parent_clear_seed = OSSL_FUNC_rand_clear_seed(pfunc);
  831|       |
  832|       |    /* Set some default maximums up */
  833|      3|    drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  834|      3|    drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  835|      3|    drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  836|      3|    drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      3|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  837|      3|    drbg->generate_counter = 1;
  838|      3|    drbg->reseed_counter = 1;
  839|      3|    drbg->reseed_interval = RESEED_INTERVAL;
  ------------------
  |  |   31|      3|# define RESEED_INTERVAL                         (1 << 8)
  ------------------
  840|      3|    drbg->reseed_time_interval = TIME_INTERVAL;
  ------------------
  |  |   32|      3|# define TIME_INTERVAL                           (60*60)   /* 1 hour */
  ------------------
  841|       |
  842|      3|    if (!dnew(drbg))
  ------------------
  |  Branch (842:9): [True: 0, False: 3]
  ------------------
  843|      0|        goto err;
  844|       |
  845|      3|    if (parent != NULL) {
  ------------------
  |  Branch (845:9): [True: 3, False: 0]
  ------------------
  846|      3|        if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (846:13): [True: 0, False: 3]
  ------------------
  847|      0|            goto err;
  848|      3|        if (drbg->strength > p_str) {
  ------------------
  |  Branch (848:13): [True: 0, False: 3]
  ------------------
  849|       |            /*
  850|       |             * We currently don't support the algorithm from NIST SP 800-90C
  851|       |             * 10.1.2 to use a weaker DRBG as source
  852|       |             */
  853|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  854|      0|            goto err;
  855|      0|        }
  856|      3|    }
  857|       |#ifdef TSAN_REQUIRES_LOCKING
  858|       |    if (!ossl_drbg_enable_locking(drbg))
  859|       |        goto err;
  860|       |#endif
  861|      3|    return drbg;
  862|       |
  863|      0| err:
  864|      0|    dfree(drbg);
  865|      0|    return NULL;
  866|      3|}
ossl_rand_drbg_free:
  869|      3|{
  870|      3|    if (drbg == NULL)
  ------------------
  |  Branch (870:9): [True: 0, False: 3]
  ------------------
  871|      0|        return;
  872|       |
  873|      3|    CRYPTO_THREAD_lock_free(drbg->lock);
  874|      3|    OPENSSL_free(drbg);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  875|      3|}
ossl_drbg_get_ctx_params:
  882|      6|{
  883|      6|    OSSL_PARAM *p;
  884|       |
  885|      6|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  533|      6|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
  886|      6|    if (p != NULL && !OSSL_PARAM_set_int(p, drbg->state))
  ------------------
  |  Branch (886:9): [True: 0, False: 6]
  |  Branch (886:22): [True: 0, False: 0]
  ------------------
  887|      0|        return 0;
  888|       |
  889|      6|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  534|      6|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
  890|      6|    if (p != NULL && !OSSL_PARAM_set_int(p, drbg->strength))
  ------------------
  |  Branch (890:9): [True: 6, False: 0]
  |  Branch (890:22): [True: 0, False: 6]
  ------------------
  891|      0|        return 0;
  892|       |
  893|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MIN_ENTROPYLEN);
  ------------------
  |  |  238|      6|# define OSSL_DRBG_PARAM_MIN_ENTROPYLEN "min_entropylen"
  ------------------
  894|      6|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->min_entropylen))
  ------------------
  |  Branch (894:9): [True: 0, False: 6]
  |  Branch (894:22): [True: 0, False: 0]
  ------------------
  895|      0|        return 0;
  896|       |
  897|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_ENTROPYLEN);
  ------------------
  |  |  234|      6|# define OSSL_DRBG_PARAM_MAX_ENTROPYLEN "max_entropylen"
  ------------------
  898|      6|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_entropylen))
  ------------------
  |  Branch (898:9): [True: 0, False: 6]
  |  Branch (898:22): [True: 0, False: 0]
  ------------------
  899|      0|        return 0;
  900|       |
  901|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MIN_NONCELEN);
  ------------------
  |  |  240|      6|# define OSSL_DRBG_PARAM_MIN_NONCELEN "min_noncelen"
  ------------------
  902|      6|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->min_noncelen))
  ------------------
  |  Branch (902:9): [True: 0, False: 6]
  |  Branch (902:22): [True: 0, False: 0]
  ------------------
  903|      0|        return 0;
  904|       |
  905|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_NONCELEN);
  ------------------
  |  |  236|      6|# define OSSL_DRBG_PARAM_MAX_NONCELEN "max_noncelen"
  ------------------
  906|      6|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_noncelen))
  ------------------
  |  Branch (906:9): [True: 0, False: 6]
  |  Branch (906:22): [True: 0, False: 0]
  ------------------
  907|      0|        return 0;
  908|       |
  909|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_PERSLEN);
  ------------------
  |  |  237|      6|# define OSSL_DRBG_PARAM_MAX_PERSLEN "max_perslen"
  ------------------
  910|      6|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_perslen))
  ------------------
  |  Branch (910:9): [True: 0, False: 6]
  |  Branch (910:22): [True: 0, False: 0]
  ------------------
  911|      0|        return 0;
  912|       |
  913|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_MAX_ADINLEN);
  ------------------
  |  |  233|      6|# define OSSL_DRBG_PARAM_MAX_ADINLEN "max_adinlen"
  ------------------
  914|      6|    if (p != NULL && !OSSL_PARAM_set_size_t(p, drbg->max_adinlen))
  ------------------
  |  Branch (914:9): [True: 0, False: 6]
  |  Branch (914:22): [True: 0, False: 0]
  ------------------
  915|      0|        return 0;
  916|       |
  917|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_REQUESTS);
  ------------------
  |  |  245|      6|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  918|      6|    if (p != NULL && !OSSL_PARAM_set_uint(p, drbg->reseed_interval))
  ------------------
  |  Branch (918:9): [True: 0, False: 6]
  |  Branch (918:22): [True: 0, False: 0]
  ------------------
  919|      0|        return 0;
  920|       |
  921|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_TIME);
  ------------------
  |  |  246|      6|# define OSSL_DRBG_PARAM_RESEED_TIME "reseed_time"
  ------------------
  922|      6|    if (p != NULL && !OSSL_PARAM_set_time_t(p, drbg->reseed_time))
  ------------------
  |  Branch (922:9): [True: 0, False: 6]
  |  Branch (922:22): [True: 0, False: 0]
  ------------------
  923|      0|        return 0;
  924|       |
  925|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL);
  ------------------
  |  |  247|      6|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  926|      6|    if (p != NULL && !OSSL_PARAM_set_time_t(p, drbg->reseed_time_interval))
  ------------------
  |  Branch (926:9): [True: 0, False: 6]
  |  Branch (926:22): [True: 0, False: 0]
  ------------------
  927|      0|        return 0;
  928|      6|    if (!OSSL_FIPS_IND_GET_CTX_PARAM(drbg, params))
  ------------------
  |  |  148|      6|# define OSSL_FIPS_IND_GET_CTX_PARAM(ctx, params) 1
  ------------------
  |  Branch (928:9): [Folded - Ignored]
  ------------------
  929|      0|        return 0;
  930|      6|    return 1;
  931|      6|}
ossl_drbg_get_ctx_params_no_lock:
  939|  2.64k|{
  940|  2.64k|    size_t cnt = 0;
  941|  2.64k|    OSSL_PARAM *p;
  942|       |
  943|       |    /* This value never changes once set */
  944|  2.64k|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  532|  2.64k|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  945|  2.64k|    if (p != NULL) {
  ------------------
  |  Branch (945:9): [True: 1.32k, False: 1.32k]
  ------------------
  946|  1.32k|        if (!OSSL_PARAM_set_size_t(p, drbg->max_request))
  ------------------
  |  Branch (946:13): [True: 0, False: 1.32k]
  ------------------
  947|      0|            return 0;
  948|  1.32k|        cnt++;
  949|  1.32k|    }
  950|       |
  951|       |    /*
  952|       |     * Can be changed by multiple threads, but we tolerate inaccuracies in this
  953|       |     * value.
  954|       |     */
  955|  2.64k|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_RESEED_COUNTER);
  ------------------
  |  |  244|  2.64k|# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
  ------------------
  956|  2.64k|    if (p != NULL) {
  ------------------
  |  Branch (956:9): [True: 1.32k, False: 1.32k]
  ------------------
  957|  1.32k|        if (!OSSL_PARAM_set_uint(p, tsan_load(&drbg->reseed_counter)))
  ------------------
  |  |   61|  1.32k|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  |  Branch (957:13): [True: 0, False: 1.32k]
  ------------------
  958|      0|            return 0;
  959|  1.32k|        cnt++;
  960|  1.32k|    }
  961|       |
  962|  2.64k|    if (params[cnt].key == NULL)
  ------------------
  |  Branch (962:9): [True: 2.64k, False: 6]
  ------------------
  963|  2.64k|        *complete = 1;
  964|      6|    else
  965|      6|        *complete = 0;
  966|       |
  967|  2.64k|    return 1;
  968|  2.64k|}
ossl_drbg_set_ctx_params:
  971|      3|{
  972|      3|    const OSSL_PARAM *p;
  973|       |
  974|      3|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (974:9): [True: 0, False: 3]
  ------------------
  975|      0|        return 1;
  976|       |
  977|      3|    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_RESEED_REQUESTS);
  ------------------
  |  |  245|      3|# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
  ------------------
  978|      3|    if (p != NULL && !OSSL_PARAM_get_uint(p, &drbg->reseed_interval))
  ------------------
  |  Branch (978:9): [True: 3, False: 0]
  |  Branch (978:22): [True: 0, False: 3]
  ------------------
  979|      0|        return 0;
  980|       |
  981|      3|    p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL);
  ------------------
  |  |  247|      3|# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
  ------------------
  982|      3|    if (p != NULL && !OSSL_PARAM_get_time_t(p, &drbg->reseed_time_interval))
  ------------------
  |  Branch (982:9): [True: 3, False: 0]
  |  Branch (982:22): [True: 0, False: 3]
  ------------------
  983|      0|        return 0;
  984|       |
  985|      3|    return 1;
  986|      3|}
drbg.c:get_entropy:
  195|      5|{
  196|      5|    size_t bytes;
  197|      5|    unsigned int p_str;
  198|       |
  199|      5|    if (drbg->parent == NULL)
  ------------------
  |  Branch (199:9): [True: 0, False: 5]
  ------------------
  200|       |        /*
  201|       |         * In normal use (i.e. OpenSSL's own uses), this is never called.
  202|       |         * This remains purely for legacy reasons.
  203|       |         */
  204|      0|        return ossl_prov_get_entropy(drbg->provctx, pout, entropy, min_len,
  205|      0|                                     max_len);
  206|       |
  207|      5|    if (drbg->parent_get_seed == NULL) {
  ------------------
  |  Branch (207:9): [True: 0, False: 5]
  ------------------
  208|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  209|      0|        return 0;
  210|      0|    }
  211|      5|    if (!get_parent_strength(drbg, &p_str))
  ------------------
  |  Branch (211:9): [True: 0, False: 5]
  ------------------
  212|      0|        return 0;
  213|      5|    if (drbg->strength > p_str) {
  ------------------
  |  Branch (213:9): [True: 0, False: 5]
  ------------------
  214|       |        /*
  215|       |         * We currently don't support the algorithm from NIST SP 800-90C
  216|       |         * 10.1.2 to use a weaker DRBG as source
  217|       |         */
  218|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  219|      0|        return 0;
  220|      0|    }
  221|       |
  222|       |    /*
  223|       |     * Our lock is already held, but we need to lock our parent before
  224|       |     * generating bits from it.  Note: taking the lock will be a no-op
  225|       |     * if locking is not required (while drbg->parent->lock == NULL).
  226|       |     */
  227|      5|    if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (227:9): [True: 0, False: 5]
  ------------------
  228|      0|        return 0;
  229|       |    /*
  230|       |     * Get random data from parent.  Include our DRBG address as
  231|       |     * additional input, in order to provide a distinction between
  232|       |     * different DRBG child instances.
  233|       |     *
  234|       |     * Note: using the sizeof() operator on a pointer triggers
  235|       |     *       a warning in some static code analyzers, but it's
  236|       |     *       intentional and correct here.
  237|       |     */
  238|      5|    bytes = drbg->parent_get_seed(drbg->parent, pout,
  239|      5|                                  entropy > 0 ? entropy : (int) drbg->strength,
  ------------------
  |  Branch (239:35): [True: 5, False: 0]
  ------------------
  240|      5|                                  min_len, max_len, prediction_resistance,
  241|      5|                                  (unsigned char *)&drbg, sizeof(drbg));
  242|      5|    ossl_drbg_unlock_parent(drbg);
  243|      5|    return bytes;
  244|      5|}
drbg.c:ossl_drbg_lock_parent:
   64|  1.34k|{
   65|  1.34k|    void *parent = drbg->parent;
   66|       |
   67|  1.34k|    if (parent != NULL
  ------------------
  |  Branch (67:9): [True: 1.34k, False: 0]
  ------------------
   68|  1.34k|            && drbg->parent_lock != NULL
  ------------------
  |  Branch (68:16): [True: 1.34k, False: 0]
  ------------------
   69|  1.34k|            && !drbg->parent_lock(parent)) {
  ------------------
  |  Branch (69:16): [True: 0, False: 1.34k]
  ------------------
   70|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|  1.34k|    return 1;
   74|  1.34k|}
drbg.c:ossl_drbg_unlock_parent:
   77|  1.34k|{
   78|  1.34k|    void *parent = drbg->parent;
   79|       |
   80|  1.34k|    if (parent != NULL && drbg->parent_unlock != NULL)
  ------------------
  |  Branch (80:9): [True: 1.34k, False: 0]
  |  Branch (80:27): [True: 1.34k, False: 0]
  ------------------
   81|  1.34k|        drbg->parent_unlock(parent);
   82|  1.34k|}
drbg.c:cleanup_entropy:
  247|      5|{
  248|      5|    if (drbg->parent == NULL) {
  ------------------
  |  Branch (248:9): [True: 0, False: 5]
  ------------------
  249|      0|        ossl_prov_cleanup_entropy(drbg->provctx, out, outlen);
  250|      5|    } else if (drbg->parent_clear_seed != NULL) {
  ------------------
  |  Branch (250:16): [True: 5, False: 0]
  ------------------
  251|      5|        if (!ossl_drbg_lock_parent(drbg))
  ------------------
  |  Branch (251:13): [True: 0, False: 5]
  ------------------
  252|      0|            return;
  253|      5|        drbg->parent_clear_seed(drbg->parent, out, outlen);
  254|      5|        ossl_drbg_unlock_parent(drbg);
  255|      5|    }
  256|      5|}
drbg.c:ossl_prov_drbg_reseed_unlocked:
  488|      2|{
  489|      2|    unsigned char *entropy = NULL;
  490|      2|    size_t entropylen = 0;
  491|       |
  492|      2|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (492:9): [True: 0, False: 2]
  ------------------
  493|      0|        return 0;
  494|       |
  495|      2|    if (drbg->state != EVP_RAND_STATE_READY) {
  ------------------
  |  | 1348|      2|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (495:9): [True: 0, False: 2]
  ------------------
  496|       |        /* try to recover from previous errors */
  497|      0|        rand_drbg_restart(drbg);
  498|       |
  499|      0|        if (drbg->state == EVP_RAND_STATE_ERROR) {
  ------------------
  |  | 1349|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  |  Branch (499:13): [True: 0, False: 0]
  ------------------
  500|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_IN_ERROR_STATE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  501|      0|            return 0;
  502|      0|        }
  503|      0|        if (drbg->state == EVP_RAND_STATE_UNINITIALISED) {
  ------------------
  |  | 1347|      0|# define EVP_RAND_STATE_UNINITIALISED    0
  ------------------
  |  Branch (503:13): [True: 0, False: 0]
  ------------------
  504|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_NOT_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)
  |  |  ------------------
  ------------------
  505|      0|            return 0;
  506|      0|        }
  507|      0|    }
  508|       |
  509|      2|    if (ent != NULL) {
  ------------------
  |  Branch (509:9): [True: 0, False: 2]
  ------------------
  510|      0|        if (ent_len < drbg->min_entropylen) {
  ------------------
  |  Branch (510:13): [True: 0, False: 0]
  ------------------
  511|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  512|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1349|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  513|      0|            return 0;
  514|      0|        }
  515|      0|        if (ent_len > drbg->max_entropylen) {
  ------------------
  |  Branch (515:13): [True: 0, False: 0]
  ------------------
  516|      0|            ERR_raise(ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  517|      0|            drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1349|      0|# define EVP_RAND_STATE_ERROR            2
  ------------------
  518|      0|            return 0;
  519|      0|        }
  520|      0|    }
  521|       |
  522|      2|    if (adin == NULL) {
  ------------------
  |  Branch (522:9): [True: 2, False: 0]
  ------------------
  523|      2|        adinlen = 0;
  524|      2|    } else if (adinlen > drbg->max_adinlen) {
  ------------------
  |  Branch (524:16): [True: 0, False: 0]
  ------------------
  525|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_TOO_LONG);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  526|      0|        return 0;
  527|      0|    }
  528|       |
  529|      2|    drbg->state = EVP_RAND_STATE_ERROR;
  ------------------
  |  | 1349|      2|# define EVP_RAND_STATE_ERROR            2
  ------------------
  530|       |
  531|      2|    drbg->reseed_next_counter = tsan_load(&drbg->reseed_counter);
  ------------------
  |  |   61|      2|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  532|      2|    if (drbg->reseed_next_counter) {
  ------------------
  |  Branch (532:9): [True: 2, False: 0]
  ------------------
  533|      2|        drbg->reseed_next_counter++;
  534|      2|        if (!drbg->reseed_next_counter)
  ------------------
  |  Branch (534:13): [True: 0, False: 2]
  ------------------
  535|      0|            drbg->reseed_next_counter = 1;
  536|      2|    }
  537|       |
  538|      2|    if (ent != NULL) {
  ------------------
  |  Branch (538:9): [True: 0, False: 2]
  ------------------
  539|       |#ifdef FIPS_MODULE
  540|       |        /*
  541|       |         * NIST SP-800-90A mandates that entropy *shall not* be provided
  542|       |         * by the consuming application. Instead the data is added as additional
  543|       |         * input.
  544|       |         *
  545|       |         * (NIST SP-800-90Ar1, Sections 9.1 and 9.2)
  546|       |         */
  547|       |        if (!drbg->reseed(drbg, NULL, 0, ent, ent_len)) {
  548|       |            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED);
  549|       |            return 0;
  550|       |        }
  551|       |#else
  552|      0|        if (!drbg->reseed(drbg, ent, ent_len, adin, adinlen)) {
  ------------------
  |  Branch (552:13): [True: 0, False: 0]
  ------------------
  553|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  554|      0|            return 0;
  555|      0|        }
  556|       |        /* There isn't much point adding the same additional input twice */
  557|      0|        adin = NULL;
  558|      0|        adinlen = 0;
  559|      0|#endif
  560|      0|    }
  561|       |
  562|       |    /* Reseed using our sources in addition */
  563|      2|    entropylen = get_entropy(drbg, &entropy, drbg->strength,
  564|      2|                             drbg->min_entropylen, drbg->max_entropylen,
  565|      2|                             prediction_resistance);
  566|      2|    if (entropylen < drbg->min_entropylen
  ------------------
  |  Branch (566:9): [True: 0, False: 2]
  ------------------
  567|      2|            || entropylen > drbg->max_entropylen) {
  ------------------
  |  Branch (567:16): [True: 0, False: 2]
  ------------------
  568|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  569|      0|        goto end;
  570|      0|    }
  571|       |
  572|      2|    if (!drbg->reseed(drbg, entropy, entropylen, adin, adinlen))
  ------------------
  |  Branch (572:9): [True: 0, False: 2]
  ------------------
  573|      0|        goto end;
  574|       |
  575|      2|    drbg->state = EVP_RAND_STATE_READY;
  ------------------
  |  | 1348|      2|# define EVP_RAND_STATE_READY            1
  ------------------
  576|      2|    drbg->generate_counter = 1;
  577|      2|    drbg->reseed_time = time(NULL);
  578|      2|    tsan_store(&drbg->reseed_counter, drbg->reseed_next_counter);
  ------------------
  |  |   62|      2|#   define tsan_store(ptr, val) atomic_store_explicit((ptr), (val), memory_order_relaxed)
  ------------------
  579|      2|    if (drbg->parent != NULL)
  ------------------
  |  Branch (579:9): [True: 2, False: 0]
  ------------------
  580|      2|        drbg->parent_reseed_counter = get_parent_reseed_count(drbg);
  581|       |
  582|      2| end:
  583|      2|    cleanup_entropy(drbg, entropy, entropylen);
  584|      2|    if (drbg->state == EVP_RAND_STATE_READY)
  ------------------
  |  | 1348|      2|# define EVP_RAND_STATE_READY            1
  ------------------
  |  Branch (584:9): [True: 2, False: 0]
  ------------------
  585|      2|        return 1;
  586|      0|    return 0;
  587|      2|}
drbg.c:get_parent_reseed_count:
  110|  1.32k|{
  111|  1.32k|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.32k|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|  1.32k|    { NULL, 0, NULL, 0, 0 }
  ------------------
  112|  1.32k|    void *parent = drbg->parent;
  113|  1.32k|    unsigned int r = 0;
  114|       |
  115|  1.32k|    *params = OSSL_PARAM_construct_uint(OSSL_DRBG_PARAM_RESEED_COUNTER, &r);
  ------------------
  |  |  244|  1.32k|# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
  ------------------
  116|  1.32k|    if (!ossl_drbg_lock_parent(drbg)) {
  ------------------
  |  Branch (116:9): [True: 0, False: 1.32k]
  ------------------
  117|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_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)
  |  |  ------------------
  ------------------
  118|      0|        goto err;
  119|      0|    }
  120|  1.32k|    if (!drbg->parent_get_ctx_params(parent, params))
  ------------------
  |  Branch (120:9): [True: 0, False: 1.32k]
  ------------------
  121|      0|        r = 0;
  122|  1.32k|    ossl_drbg_unlock_parent(drbg);
  123|  1.32k|    return r;
  124|       |
  125|      0| err:
  126|      0|    r = tsan_load(&drbg->reseed_counter) - 2;
  ------------------
  |  |   61|      0|#   define tsan_load(ptr) atomic_load_explicit((ptr), memory_order_relaxed)
  ------------------
  127|      0|    if (r == 0)
  ------------------
  |  Branch (127:9): [True: 0, False: 0]
  ------------------
  128|      0|        r = UINT_MAX;
  129|      0|    return r;
  130|  1.32k|}
drbg.c:find_call:
  746|     21|{
  747|     21|    if (dispatch != NULL)
  ------------------
  |  Branch (747:9): [True: 21, False: 0]
  ------------------
  748|    247|        while (dispatch->function_id != 0) {
  ------------------
  |  Branch (748:16): [True: 244, False: 3]
  ------------------
  749|    244|            if (dispatch->function_id == function)
  ------------------
  |  Branch (749:17): [True: 18, False: 226]
  ------------------
  750|     18|                return dispatch;
  751|    226|            dispatch++;
  752|    226|        }
  753|      3|    return NULL;
  754|     21|}
drbg.c:get_parent_strength:
   85|      8|{
   86|      8|    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      8|    { NULL, 0, NULL, 0, 0 }
  ------------------
                  OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
  ------------------
  |  |   25|      8|    { NULL, 0, NULL, 0, 0 }
  ------------------
   87|      8|    void *parent = drbg->parent;
   88|      8|    int res;
   89|       |
   90|      8|    if (drbg->parent_get_ctx_params == NULL) {
  ------------------
  |  Branch (90:9): [True: 0, False: 8]
  ------------------
   91|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   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|       |
   95|      8|    *params = OSSL_PARAM_construct_uint(OSSL_RAND_PARAM_STRENGTH, str);
  ------------------
  |  |  534|      8|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
   96|      8|    if (!ossl_drbg_lock_parent(drbg)) {
  ------------------
  |  Branch (96:9): [True: 0, False: 8]
  ------------------
   97|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_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)
  |  |  ------------------
  ------------------
   98|      0|        return 0;
   99|      0|    }
  100|      8|    res = drbg->parent_get_ctx_params(parent, params);
  101|      8|    ossl_drbg_unlock_parent(drbg);
  102|      8|    if (!res) {
  ------------------
  |  Branch (102:9): [True: 0, False: 8]
  ------------------
  103|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  104|      0|        return 0;
  105|      0|    }
  106|      8|    return 1;
  107|      8|}

drbg_ctr.c:drbg_ctr_new_wrapper:
  640|      3|{
  641|      3|    return ossl_rand_drbg_new(provctx, parent, parent_dispatch,
  642|      3|                              &drbg_ctr_new, &drbg_ctr_free,
  643|      3|                              &drbg_ctr_instantiate, &drbg_ctr_uninstantiate,
  644|      3|                              &drbg_ctr_reseed, &drbg_ctr_generate);
  645|      3|}
drbg_ctr.c:drbg_ctr_new:
  625|      3|{
  626|      3|    PROV_DRBG_CTR *ctr;
  627|       |
  628|      3|    ctr = OPENSSL_secure_zalloc(sizeof(*ctr));
  ------------------
  |  |  125|      3|        CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  629|      3|    if (ctr == NULL)
  ------------------
  |  Branch (629:9): [True: 0, False: 3]
  ------------------
  630|      0|        return 0;
  631|       |
  632|      3|    ctr->use_df = 1;
  633|      3|    drbg->data = ctr;
  634|      3|    OSSL_FIPS_IND_INIT(drbg)
  635|      3|    return drbg_ctr_init_lengths(drbg);
  636|      3|}
drbg_ctr.c:drbg_ctr_init_lengths:
  531|      6|{
  532|      6|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  533|      6|    int res = 1;
  534|       |
  535|       |    /* Maximum number of bits per request = 2^19  = 2^16 bytes */
  536|      6|    drbg->max_request = 1 << 16;
  537|      6|    if (ctr->use_df) {
  ------------------
  |  Branch (537:9): [True: 6, False: 0]
  ------------------
  538|      6|        drbg->min_entropylen = 0;
  539|      6|        drbg->max_entropylen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      6|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  540|      6|        drbg->min_noncelen = 0;
  541|      6|        drbg->max_noncelen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      6|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  542|      6|        drbg->max_perslen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      6|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  543|      6|        drbg->max_adinlen = DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      6|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  544|       |
  545|      6|        if (ctr->keylen > 0) {
  ------------------
  |  Branch (545:13): [True: 3, False: 3]
  ------------------
  546|      3|            drbg->min_entropylen = ctr->keylen;
  547|      3|            drbg->min_noncelen = drbg->min_entropylen / 2;
  548|      3|        }
  549|      6|    } else {
  550|      0|        const size_t len = ctr->keylen > 0 ? drbg->seedlen : DRBG_MAX_LENGTH;
  ------------------
  |  |   41|      0|# define DRBG_MAX_LENGTH                         INT32_MAX
  ------------------
  |  Branch (550:28): [True: 0, False: 0]
  ------------------
  551|       |
  552|      0|        drbg->min_entropylen = len;
  553|      0|        drbg->max_entropylen = len;
  554|       |        /* Nonce not used */
  555|      0|        drbg->min_noncelen = 0;
  556|      0|        drbg->max_noncelen = 0;
  557|      0|        drbg->max_perslen = len;
  558|      0|        drbg->max_adinlen = len;
  559|      0|    }
  560|      6|    return res;
  561|      6|}
drbg_ctr.c:drbg_ctr_instantiate:
  317|      3|{
  318|      3|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  319|       |
  320|      3|    if (entropy == NULL)
  ------------------
  |  Branch (320:9): [True: 0, False: 3]
  ------------------
  321|      0|        return 0;
  322|       |
  323|      3|    memset(ctr->K, 0, sizeof(ctr->K));
  324|      3|    memset(ctr->V, 0, sizeof(ctr->V));
  325|      3|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (325:9): [True: 0, False: 3]
  ------------------
  326|      0|        return 0;
  327|       |
  328|      3|    inc_128(ctr);
  329|      3|    if (!ctr_update(drbg, entropy, entropylen, pers, perslen, nonce, noncelen))
  ------------------
  |  Branch (329:9): [True: 0, False: 3]
  ------------------
  330|      0|        return 0;
  331|      3|    return 1;
  332|      3|}
drbg_ctr.c:inc_128:
   65|  3.99k|{
   66|  3.99k|    unsigned char *p = &ctr->V[0];
   67|  3.99k|    u32 n = 16, c = 1;
   68|       |
   69|  63.9k|    do {
   70|  63.9k|        --n;
   71|  63.9k|        c += p[n];
   72|  63.9k|        p[n] = (u8)c;
   73|  63.9k|        c >>= 8;
   74|  63.9k|    } while (n);
  ------------------
  |  Branch (74:14): [True: 59.9k, False: 3.99k]
  ------------------
   75|  3.99k|}
drbg_ctr.c:ctr_update:
  271|  1.33k|{
  272|  1.33k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  273|  1.33k|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|  1.33k|# define AES_BLOCK_SIZE 16
  ------------------
  274|  1.33k|    unsigned char V_tmp[48], out[48];
  275|  1.33k|    unsigned char len;
  276|       |
  277|       |    /* correct key is already set up. */
  278|  1.33k|    memcpy(V_tmp, ctr->V, 16);
  279|  1.33k|    inc_128(ctr);
  280|  1.33k|    memcpy(V_tmp + 16, ctr->V, 16);
  281|  1.33k|    if (ctr->keylen == 16) {
  ------------------
  |  Branch (281:9): [True: 0, False: 1.33k]
  ------------------
  282|      0|        len = 32;
  283|  1.33k|    } else {
  284|  1.33k|        inc_128(ctr);
  285|  1.33k|        memcpy(V_tmp + 32, ctr->V, 16);
  286|  1.33k|        len = 48;
  287|  1.33k|    }
  288|  1.33k|    if (!EVP_CipherUpdate(ctr->ctx_ecb, out, &outlen, V_tmp, len)
  ------------------
  |  Branch (288:9): [True: 0, False: 1.33k]
  ------------------
  289|  1.33k|            || outlen != len)
  ------------------
  |  Branch (289:16): [True: 0, False: 1.33k]
  ------------------
  290|      0|        return 0;
  291|  1.33k|    memcpy(ctr->K, out, ctr->keylen);
  292|  1.33k|    memcpy(ctr->V, out + ctr->keylen, 16);
  293|       |
  294|  1.33k|    if (ctr->use_df) {
  ------------------
  |  Branch (294:9): [True: 1.33k, False: 0]
  ------------------
  295|       |        /* If no input reuse existing derived value */
  296|  1.33k|        if (in1 != NULL || nonce != NULL || in2 != NULL)
  ------------------
  |  Branch (296:13): [True: 9, False: 1.32k]
  |  Branch (296:28): [True: 0, False: 1.32k]
  |  Branch (296:45): [True: 0, False: 1.32k]
  ------------------
  297|      9|            if (!ctr_df(ctr, in1, in1len, nonce, noncelen, in2, in2len))
  ------------------
  |  Branch (297:17): [True: 0, False: 9]
  ------------------
  298|      0|                return 0;
  299|       |        /* If this a reuse input in1len != 0 */
  300|  1.33k|        if (in1len)
  ------------------
  |  Branch (300:13): [True: 13, False: 1.32k]
  ------------------
  301|     13|            ctr_XOR(ctr, ctr->KX, drbg->seedlen);
  302|  1.33k|    } else {
  303|      0|        ctr_XOR(ctr, in1, in1len);
  304|      0|        ctr_XOR(ctr, in2, in2len);
  305|      0|    }
  306|       |
  307|  1.33k|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->K, NULL, -1)
  ------------------
  |  Branch (307:9): [True: 0, False: 1.33k]
  ------------------
  308|  1.33k|        || !EVP_CipherInit_ex(ctr->ctx_ctr, NULL, NULL, ctr->K, NULL, -1))
  ------------------
  |  Branch (308:12): [True: 0, False: 1.33k]
  ------------------
  309|      0|        return 0;
  310|  1.33k|    return 1;
  311|  1.33k|}
drbg_ctr.c:ctr_df:
  208|      9|{
  209|      9|    static unsigned char c80 = 0x80;
  210|      9|    size_t inlen;
  211|      9|    unsigned char *p = ctr->bltmp;
  212|      9|    int outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  213|       |
  214|      9|    if (!ctr_BCC_init(ctr))
  ------------------
  |  Branch (214:9): [True: 0, False: 9]
  ------------------
  215|      0|        return 0;
  216|      9|    if (in1 == NULL)
  ------------------
  |  Branch (216:9): [True: 0, False: 9]
  ------------------
  217|      0|        in1len = 0;
  218|      9|    if (in2 == NULL)
  ------------------
  |  Branch (218:9): [True: 9, False: 0]
  ------------------
  219|      9|        in2len = 0;
  220|      9|    if (in3 == NULL)
  ------------------
  |  Branch (220:9): [True: 6, False: 3]
  ------------------
  221|      6|        in3len = 0;
  222|      9|    inlen = in1len + in2len + in3len;
  223|       |    /* Initialise L||N in temporary block */
  224|      9|    *p++ = (inlen >> 24) & 0xff;
  225|      9|    *p++ = (inlen >> 16) & 0xff;
  226|      9|    *p++ = (inlen >> 8) & 0xff;
  227|      9|    *p++ = inlen & 0xff;
  228|       |
  229|       |    /* NB keylen is at most 32 bytes */
  230|      9|    *p++ = 0;
  231|      9|    *p++ = 0;
  232|      9|    *p++ = 0;
  233|      9|    *p = (unsigned char)((ctr->keylen + 16) & 0xff);
  234|      9|    ctr->bltmp_pos = 8;
  235|      9|    if (!ctr_BCC_update(ctr, in1, in1len)
  ------------------
  |  Branch (235:9): [True: 0, False: 9]
  ------------------
  236|      9|        || !ctr_BCC_update(ctr, in2, in2len)
  ------------------
  |  Branch (236:12): [True: 0, False: 9]
  ------------------
  237|      9|        || !ctr_BCC_update(ctr, in3, in3len)
  ------------------
  |  Branch (237:12): [True: 0, False: 9]
  ------------------
  238|      9|        || !ctr_BCC_update(ctr, &c80, 1)
  ------------------
  |  Branch (238:12): [True: 0, False: 9]
  ------------------
  239|      9|        || !ctr_BCC_final(ctr))
  ------------------
  |  Branch (239:12): [True: 0, False: 9]
  ------------------
  240|      0|        return 0;
  241|       |    /* Set up key K */
  242|      9|    if (!EVP_CipherInit_ex(ctr->ctx_ecb, NULL, NULL, ctr->KX, NULL, -1))
  ------------------
  |  Branch (242:9): [True: 0, False: 9]
  ------------------
  243|      0|        return 0;
  244|       |    /* X follows key K */
  245|      9|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX, &outlen, ctr->KX + ctr->keylen,
  ------------------
  |  Branch (245:9): [True: 0, False: 9]
  ------------------
  246|      9|                          AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  247|      9|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (247:12): [True: 0, False: 9]
  ------------------
  248|      0|        return 0;
  249|      9|    if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 16, &outlen, ctr->KX,
  ------------------
  |  Branch (249:9): [True: 0, False: 9]
  ------------------
  250|      9|                          AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  251|      9|        || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (251:12): [True: 0, False: 9]
  ------------------
  252|      0|        return 0;
  253|      9|    if (ctr->keylen != 16)
  ------------------
  |  Branch (253:9): [True: 9, False: 0]
  ------------------
  254|      9|        if (!EVP_CipherUpdate(ctr->ctx_ecb, ctr->KX + 32, &outlen,
  ------------------
  |  Branch (254:13): [True: 0, False: 9]
  ------------------
  255|      9|                              ctr->KX + 16, AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  256|      9|            || outlen != AES_BLOCK_SIZE)
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  |  Branch (256:16): [True: 0, False: 9]
  ------------------
  257|      0|            return 0;
  258|      9|    return 1;
  259|      9|}
drbg_ctr.c:ctr_BCC_init:
  145|      9|{
  146|      9|    unsigned char bltmp[48] = {0};
  147|      9|    unsigned char num_of_blk;
  148|       |
  149|      9|    memset(ctr->KX, 0, 48);
  150|      9|    num_of_blk = ctr->keylen == 16 ? 2 : 3;
  ------------------
  |  Branch (150:18): [True: 0, False: 9]
  ------------------
  151|      9|    bltmp[(AES_BLOCK_SIZE * 1) + 3] = 1;
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  152|      9|    bltmp[(AES_BLOCK_SIZE * 2) + 3] = 2;
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  153|      9|    return ctr_BCC_block(ctr, ctr->KX, bltmp, num_of_blk * AES_BLOCK_SIZE);
  ------------------
  |  |   26|      9|# define AES_BLOCK_SIZE 16
  ------------------
  154|      9|}
drbg_ctr.c:ctr_BCC_block:
  110|     41|{
  111|     41|    int i, outlen = AES_BLOCK_SIZE;
  ------------------
  |  |   26|     41|# define AES_BLOCK_SIZE 16
  ------------------
  112|       |
  113|  2.00k|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (113:17): [True: 1.96k, False: 41]
  ------------------
  114|  1.96k|        out[i] ^= in[i];
  115|       |
  116|     41|    if (!EVP_CipherUpdate(ctr->ctx_df, out, &outlen, out, len)
  ------------------
  |  Branch (116:9): [True: 0, False: 41]
  ------------------
  117|     41|        || outlen != len)
  ------------------
  |  Branch (117:12): [True: 0, False: 41]
  ------------------
  118|      0|        return 0;
  119|     41|    return 1;
  120|     41|}
drbg_ctr.c:ctr_BCC_update:
  161|     36|{
  162|     36|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (162:9): [True: 15, False: 21]
  |  Branch (162:23): [True: 0, False: 21]
  ------------------
  163|     15|        return 1;
  164|       |
  165|       |    /* If we have partial block handle it first */
  166|     21|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (166:9): [True: 17, False: 4]
  ------------------
  167|     17|        size_t left = 16 - ctr->bltmp_pos;
  168|       |
  169|       |        /* If we now have a complete block process it */
  170|     17|        if (inlen >= left) {
  ------------------
  |  Branch (170:13): [True: 12, False: 5]
  ------------------
  171|     12|            memcpy(ctr->bltmp + ctr->bltmp_pos, in, left);
  172|     12|            if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (172:17): [True: 0, False: 12]
  ------------------
  173|      0|                return 0;
  174|     12|            ctr->bltmp_pos = 0;
  175|     12|            inlen -= left;
  176|     12|            in += left;
  177|     12|        }
  178|     17|    }
  179|       |
  180|       |    /* Process zero or more complete blocks */
  181|     32|    for (; inlen >= 16; in += 16, inlen -= 16) {
  ------------------
  |  Branch (181:12): [True: 11, False: 21]
  ------------------
  182|     11|        if (!ctr_BCC_blocks(ctr, in))
  ------------------
  |  Branch (182:13): [True: 0, False: 11]
  ------------------
  183|      0|            return 0;
  184|     11|    }
  185|       |
  186|       |    /* Copy any remaining partial block to the temporary buffer */
  187|     21|    if (inlen > 0) {
  ------------------
  |  Branch (187:9): [True: 17, False: 4]
  ------------------
  188|     17|        memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen);
  189|     17|        ctr->bltmp_pos += inlen;
  190|     17|    }
  191|     21|    return 1;
  192|     21|}
drbg_ctr.c:ctr_BCC_blocks:
  127|     32|{
  128|     32|    unsigned char in_tmp[48];
  129|     32|    unsigned char num_of_blk = 2;
  130|       |
  131|     32|    memcpy(in_tmp, in, 16);
  132|     32|    memcpy(in_tmp + 16, in, 16);
  133|     32|    if (ctr->keylen != 16) {
  ------------------
  |  Branch (133:9): [True: 32, False: 0]
  ------------------
  134|     32|        memcpy(in_tmp + 32, in, 16);
  135|     32|        num_of_blk = 3;
  136|     32|    }
  137|     32|    return ctr_BCC_block(ctr, ctr->KX, in_tmp, AES_BLOCK_SIZE * num_of_blk);
  ------------------
  |  |   26|     32|# define AES_BLOCK_SIZE 16
  ------------------
  138|     32|}
drbg_ctr.c:ctr_BCC_final:
  195|      9|{
  196|      9|    if (ctr->bltmp_pos) {
  ------------------
  |  Branch (196:9): [True: 9, False: 0]
  ------------------
  197|      9|        memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);
  198|      9|        if (!ctr_BCC_blocks(ctr, ctr->bltmp))
  ------------------
  |  Branch (198:13): [True: 0, False: 9]
  ------------------
  199|      0|            return 0;
  200|      9|    }
  201|      9|    return 1;
  202|      9|}
drbg_ctr.c:ctr_XOR:
   78|     13|{
   79|     13|    size_t i, n;
   80|       |
   81|     13|    if (in == NULL || inlen == 0)
  ------------------
  |  Branch (81:9): [True: 0, False: 13]
  |  Branch (81:23): [True: 0, False: 13]
  ------------------
   82|      0|        return;
   83|       |
   84|       |    /*
   85|       |     * Any zero padding will have no effect on the result as we
   86|       |     * are XORing. So just process however much input we have.
   87|       |     */
   88|     13|    n = inlen < ctr->keylen ? inlen : ctr->keylen;
  ------------------
  |  Branch (88:9): [True: 0, False: 13]
  ------------------
   89|     13|    if (!ossl_assert(n <= sizeof(ctr->K)))
  ------------------
  |  |   52|     13|#  define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \
  |  |   53|     13|                                         __FILE__, __LINE__)
  ------------------
  |  Branch (89:9): [True: 0, False: 13]
  ------------------
   90|      0|        return;
   91|    429|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (91:17): [True: 416, False: 13]
  ------------------
   92|    416|        ctr->K[i] ^= in[i];
   93|     13|    if (inlen <= ctr->keylen)
  ------------------
  |  Branch (93:9): [True: 0, False: 13]
  ------------------
   94|      0|        return;
   95|       |
   96|     13|    n = inlen - ctr->keylen;
   97|     13|    if (n > 16) {
  ------------------
  |  Branch (97:9): [True: 0, False: 13]
  ------------------
   98|       |        /* Should never happen */
   99|      0|        n = 16;
  100|      0|    }
  101|    221|    for (i = 0; i < n; i++)
  ------------------
  |  Branch (101:17): [True: 208, False: 13]
  ------------------
  102|    208|        ctr->V[i] ^= in[i + ctr->keylen];
  103|     13|}
drbg_ctr.c:drbg_ctr_reseed:
  360|      2|{
  361|      2|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  362|       |
  363|      2|    if (entropy == NULL)
  ------------------
  |  Branch (363:9): [True: 0, False: 2]
  ------------------
  364|      0|        return 0;
  365|       |
  366|      2|    inc_128(ctr);
  367|      2|    if (!ctr_update(drbg, entropy, entropylen, adin, adinlen, NULL, 0))
  ------------------
  |  Branch (367:9): [True: 0, False: 2]
  ------------------
  368|      0|        return 0;
  369|      2|    return 1;
  370|      2|}
drbg_ctr.c:drbg_ctr_generate:
  397|  1.32k|{
  398|  1.32k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  399|  1.32k|    unsigned int ctr32, blocks;
  400|  1.32k|    int outl, buflen;
  401|       |
  402|  1.32k|    if (adin != NULL && adinlen != 0) {
  ------------------
  |  Branch (402:9): [True: 4, False: 1.32k]
  |  Branch (402:25): [True: 4, False: 0]
  ------------------
  403|      4|        inc_128(ctr);
  404|       |
  405|      4|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (405:13): [True: 0, False: 4]
  ------------------
  406|      0|            return 0;
  407|       |        /* This means we reuse derived value */
  408|      4|        if (ctr->use_df) {
  ------------------
  |  Branch (408:13): [True: 4, False: 0]
  ------------------
  409|      4|            adin = NULL;
  410|      4|            adinlen = 1;
  411|      4|        }
  412|  1.32k|    } else {
  413|  1.32k|        adinlen = 0;
  414|  1.32k|    }
  415|       |
  416|  1.32k|    inc_128(ctr);
  417|       |
  418|  1.32k|    if (outlen == 0) {
  ------------------
  |  Branch (418:9): [True: 0, False: 1.32k]
  ------------------
  419|      0|        inc_128(ctr);
  420|       |
  421|      0|        if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (421:13): [True: 0, False: 0]
  ------------------
  422|      0|            return 0;
  423|      0|        return 1;
  424|      0|    }
  425|       |
  426|  1.32k|    memset(out, 0, outlen);
  427|       |
  428|  1.32k|    do {
  429|  1.32k|        if (!EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (429:13): [True: 0, False: 1.32k]
  ------------------
  430|  1.32k|                               NULL, NULL, NULL, ctr->V, -1))
  431|      0|            return 0;
  432|       |
  433|       |        /*-
  434|       |         * outlen has type size_t while EVP_CipherUpdate takes an
  435|       |         * int argument and thus cannot be guaranteed to process more
  436|       |         * than 2^31-1 bytes at a time. We process such huge generate
  437|       |         * requests in 2^30 byte chunks, which is the greatest multiple
  438|       |         * of AES block size lower than or equal to 2^31-1.
  439|       |         */
  440|  1.32k|        buflen = outlen > (1U << 30) ? (1U << 30) : outlen;
  ------------------
  |  Branch (440:18): [True: 0, False: 1.32k]
  ------------------
  441|  1.32k|        blocks = (buflen + 15) / 16;
  442|       |
  443|  1.32k|        ctr32 = GETU32(ctr->V + 12) + blocks;
  ------------------
  |  |  103|  1.32k|# define GETU32(p)       ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3])
  ------------------
  444|  1.32k|        if (ctr32 < blocks) {
  ------------------
  |  Branch (444:13): [True: 0, False: 1.32k]
  ------------------
  445|       |            /* 32-bit counter overflow into V. */
  446|      0|            if (ctr32 != 0) {
  ------------------
  |  Branch (446:17): [True: 0, False: 0]
  ------------------
  447|      0|                blocks -= ctr32;
  448|      0|                buflen = blocks * 16;
  449|      0|                ctr32 = 0;
  450|      0|            }
  451|      0|            ctr96_inc(ctr->V);
  452|      0|        }
  453|  1.32k|        PUTU32(ctr->V + 12, ctr32);
  ------------------
  |  |  104|  1.32k|# define PUTU32(p,v)     ((p)[0]=(u8)((v)>>24),(p)[1]=(u8)((v)>>16),(p)[2]=(u8)((v)>>8),(p)[3]=(u8)(v))
  ------------------
  454|       |
  455|  1.32k|        if (!EVP_CipherUpdate(ctr->ctx_ctr, out, &outl, out, buflen)
  ------------------
  |  Branch (455:13): [True: 0, False: 1.32k]
  ------------------
  456|  1.32k|            || outl != buflen)
  ------------------
  |  Branch (456:16): [True: 0, False: 1.32k]
  ------------------
  457|      0|            return 0;
  458|       |
  459|  1.32k|        out += buflen;
  460|  1.32k|        outlen -= buflen;
  461|  1.32k|    } while (outlen);
  ------------------
  |  Branch (461:14): [True: 0, False: 1.32k]
  ------------------
  462|       |
  463|  1.32k|    if (!ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0))
  ------------------
  |  Branch (463:9): [True: 0, False: 1.32k]
  ------------------
  464|      0|        return 0;
  465|  1.32k|    return 1;
  466|  1.32k|}
drbg_ctr.c:drbg_ctr_free:
  648|      3|{
  649|      3|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  650|      3|    PROV_DRBG_CTR *ctr;
  651|       |
  652|      3|    if (drbg != NULL && (ctr = (PROV_DRBG_CTR *)drbg->data) != NULL) {
  ------------------
  |  Branch (652:9): [True: 3, False: 0]
  |  Branch (652:25): [True: 3, False: 0]
  ------------------
  653|      3|        EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  654|      3|        EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  655|      3|        EVP_CIPHER_CTX_free(ctr->ctx_df);
  656|      3|        EVP_CIPHER_free(ctr->cipher_ecb);
  657|      3|        EVP_CIPHER_free(ctr->cipher_ctr);
  658|       |
  659|      3|        OPENSSL_secure_clear_free(ctr, sizeof(*ctr));
  ------------------
  |  |  129|      3|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  660|      3|    }
  661|      3|    ossl_rand_drbg_free(drbg);
  662|      3|}
drbg_ctr.c:drbg_ctr_instantiate_wrapper:
  339|      3|{
  340|      3|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  341|      3|    int ret = 0;
  342|       |
  343|      3|    if (drbg->lock != NULL && !CRYPTO_THREAD_write_lock(drbg->lock))
  ------------------
  |  Branch (343:9): [True: 0, False: 3]
  |  Branch (343:31): [True: 0, False: 0]
  ------------------
  344|      0|        return 0;
  345|       |
  346|      3|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (346:9): [True: 0, False: 3]
  ------------------
  347|      3|            || !drbg_ctr_set_ctx_params_locked(drbg, params))
  ------------------
  |  Branch (347:16): [True: 0, False: 3]
  ------------------
  348|      0|        goto err;
  349|      3|    ret = ossl_prov_drbg_instantiate(drbg, strength, prediction_resistance,
  350|      3|                                     pstr, pstr_len);
  351|      3| err:
  352|      3|    if (drbg->lock != NULL)
  ------------------
  |  Branch (352:9): [True: 0, False: 3]
  ------------------
  353|      0|        CRYPTO_THREAD_unlock(drbg->lock);
  354|      3|    return ret;
  355|      3|}
drbg_ctr.c:drbg_ctr_set_ctx_params_locked:
  714|      3|{
  715|      3|    PROV_DRBG *ctx = (PROV_DRBG *)vctx;
  716|      3|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)ctx->data;
  717|      3|    OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(ctx->provctx);
  ------------------
  |  |   31|      3|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
  718|      3|    OSSL_PROVIDER *prov = NULL;
  719|      3|    const OSSL_PARAM *p;
  720|      3|    char *ecb;
  721|      3|    const char *propquery = NULL;
  722|      3|    int i, cipher_init = 0;
  723|       |
  724|      3|    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_USE_DF)) != NULL
  ------------------
  |  |  249|      3|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  |  Branch (724:9): [True: 3, False: 0]
  ------------------
  725|      3|            && OSSL_PARAM_get_int(p, &i)) {
  ------------------
  |  Branch (725:16): [True: 3, False: 0]
  ------------------
  726|       |        /* FIPS errors out in the drbg_ctr_init() call later */
  727|      3|        ctr->use_df = i != 0;
  728|      3|        cipher_init = 1;
  729|      3|    }
  730|       |
  731|      3|    if ((p = OSSL_PARAM_locate_const(params,
  ------------------
  |  Branch (731:9): [True: 0, False: 3]
  ------------------
  732|      3|                                     OSSL_DRBG_PARAM_PROPERTIES)) != NULL) {
  ------------------
  |  |  242|      3|# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
  |  |  ------------------
  |  |  |  |  126|      3|# define OSSL_ALG_PARAM_PROPERTIES "properties"
  |  |  ------------------
  ------------------
  733|      0|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      0|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (733:13): [True: 0, False: 0]
  ------------------
  734|      0|            return 0;
  735|      0|        propquery = (const char *)p->data;
  736|      0|    }
  737|       |
  738|      3|    if ((p = OSSL_PARAM_locate_const(params,
  ------------------
  |  Branch (738:9): [True: 3, False: 0]
  ------------------
  739|      3|                                     OSSL_PROV_PARAM_CORE_PROV_NAME)) != NULL) {
  ------------------
  |  |  494|      3|# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
  ------------------
  740|      3|        if (p->data_type != OSSL_PARAM_UTF8_STRING)
  ------------------
  |  |  117|      3|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (740:13): [True: 0, False: 3]
  ------------------
  741|      0|            return 0;
  742|      3|        if ((prov = ossl_provider_find(libctx,
  ------------------
  |  Branch (742:13): [True: 0, False: 3]
  ------------------
  743|      3|                                       (const char *)p->data, 1)) == NULL)
  744|      0|            return 0;
  745|      3|    }
  746|       |
  747|      3|    if ((p = OSSL_PARAM_locate_const(params, OSSL_DRBG_PARAM_CIPHER)) != NULL) {
  ------------------
  |  |  227|      3|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      3|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  |  Branch (747:9): [True: 3, False: 0]
  ------------------
  748|      3|        const char *base = (const char *)p->data;
  749|      3|        size_t ctr_str_len = sizeof("CTR") - 1;
  750|      3|        size_t ecb_str_len = sizeof("ECB") - 1;
  751|       |
  752|      3|        if (p->data_type != OSSL_PARAM_UTF8_STRING
  ------------------
  |  |  117|      6|# define OSSL_PARAM_UTF8_STRING          4
  ------------------
  |  Branch (752:13): [True: 0, False: 3]
  ------------------
  753|      3|                || p->data_size < ctr_str_len) {
  ------------------
  |  Branch (753:20): [True: 0, False: 3]
  ------------------
  754|      0|            ossl_provider_free(prov);
  755|      0|            return 0;
  756|      0|        }
  757|      3|        if (OPENSSL_strcasecmp("CTR", base + p->data_size - ctr_str_len) != 0) {
  ------------------
  |  Branch (757:13): [True: 0, False: 3]
  ------------------
  758|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_REQUIRE_CTR_MODE_CIPHER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  759|      0|            ossl_provider_free(prov);
  760|      0|            return 0;
  761|      0|        }
  762|      3|        if ((ecb = OPENSSL_strndup(base, p->data_size)) == NULL) {
  ------------------
  |  |  121|      3|        CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      3|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      3|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (762:13): [True: 0, False: 3]
  ------------------
  763|      0|            ossl_provider_free(prov);
  764|      0|            return 0;
  765|      0|        }
  766|      3|        strcpy(ecb + p->data_size - ecb_str_len, "ECB");
  767|      3|        EVP_CIPHER_free(ctr->cipher_ecb);
  768|      3|        EVP_CIPHER_free(ctr->cipher_ctr);
  769|       |        /*
  770|       |         * Try to fetch algorithms from our own provider code, fallback
  771|       |         * to generic fetch only if that fails
  772|       |         */
  773|      3|        (void)ERR_set_mark();
  774|      3|        ctr->cipher_ctr = evp_cipher_fetch_from_prov(prov, base, NULL);
  775|      3|        if (ctr->cipher_ctr == NULL) {
  ------------------
  |  Branch (775:13): [True: 0, False: 3]
  ------------------
  776|      0|            (void)ERR_pop_to_mark();
  777|      0|            ctr->cipher_ctr = EVP_CIPHER_fetch(libctx, base, propquery);
  778|      3|        } else {
  779|      3|            (void)ERR_clear_last_mark();
  780|      3|        }
  781|      3|        (void)ERR_set_mark();
  782|      3|        ctr->cipher_ecb = evp_cipher_fetch_from_prov(prov, ecb, NULL);
  783|      3|        if (ctr->cipher_ecb == NULL) {
  ------------------
  |  Branch (783:13): [True: 0, False: 3]
  ------------------
  784|      0|            (void)ERR_pop_to_mark();
  785|      0|            ctr->cipher_ecb = EVP_CIPHER_fetch(libctx, ecb, propquery);
  786|      3|        } else {
  787|      3|            (void)ERR_clear_last_mark();
  788|      3|        }
  789|      3|        OPENSSL_free(ecb);
  ------------------
  |  |  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__
  |  |  ------------------
  ------------------
  790|      3|        if (ctr->cipher_ctr == NULL || ctr->cipher_ecb == NULL) {
  ------------------
  |  Branch (790:13): [True: 0, False: 3]
  |  Branch (790:40): [True: 0, False: 3]
  ------------------
  791|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_FIND_CIPHERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  792|      0|            ossl_provider_free(prov);
  793|      0|            return 0;
  794|      0|        }
  795|      3|        cipher_init = 1;
  796|      3|    }
  797|      3|    ossl_provider_free(prov);
  798|       |
  799|      3|    if (cipher_init && !drbg_ctr_init(ctx))
  ------------------
  |  Branch (799:9): [True: 3, False: 0]
  |  Branch (799:24): [True: 0, False: 3]
  ------------------
  800|      0|        return 0;
  801|       |
  802|      3|    return ossl_drbg_set_ctx_params(ctx, params);
  803|      3|}
drbg_ctr.c:drbg_ctr_init:
  564|      3|{
  565|      3|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  566|      3|    size_t keylen;
  567|       |
  568|      3|    if (ctr->cipher_ctr == NULL) {
  ------------------
  |  Branch (568:9): [True: 0, False: 3]
  ------------------
  569|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CIPHER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  570|      0|        return 0;
  571|      0|    }
  572|      3|    ctr->keylen = keylen = EVP_CIPHER_get_key_length(ctr->cipher_ctr);
  573|      3|    if (ctr->ctx_ecb == NULL)
  ------------------
  |  Branch (573:9): [True: 3, False: 0]
  ------------------
  574|      3|        ctr->ctx_ecb = EVP_CIPHER_CTX_new();
  575|      3|    if (ctr->ctx_ctr == NULL)
  ------------------
  |  Branch (575:9): [True: 3, False: 0]
  ------------------
  576|      3|        ctr->ctx_ctr = EVP_CIPHER_CTX_new();
  577|      3|    if (ctr->ctx_ecb == NULL || ctr->ctx_ctr == NULL) {
  ------------------
  |  Branch (577:9): [True: 0, False: 3]
  |  Branch (577:33): [True: 0, False: 3]
  ------------------
  578|      0|        ERR_raise(ERR_LIB_PROV, 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)
  |  |  ------------------
  ------------------
  579|      0|        goto err;
  580|      0|    }
  581|       |
  582|      3|    if (!EVP_CipherInit_ex(ctr->ctx_ecb,
  ------------------
  |  Branch (582:9): [True: 0, False: 3]
  ------------------
  583|      3|                           ctr->cipher_ecb, NULL, NULL, NULL, 1)
  584|      3|        || !EVP_CipherInit_ex(ctr->ctx_ctr,
  ------------------
  |  Branch (584:12): [True: 0, False: 3]
  ------------------
  585|      3|                              ctr->cipher_ctr, NULL, NULL, NULL, 1)) {
  586|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_UNABLE_TO_INITIALISE_CIPHERS);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  587|      0|        goto err;
  588|      0|    }
  589|       |
  590|      3|    drbg->strength = keylen * 8;
  591|      3|    drbg->seedlen = keylen + 16;
  592|       |
  593|      3|    if (ctr->use_df) {
  ------------------
  |  Branch (593:9): [True: 3, False: 0]
  ------------------
  594|       |        /* df initialisation */
  595|      3|        static const unsigned char df_key[32] = {
  596|      3|            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
  597|      3|            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
  598|      3|            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
  599|      3|            0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
  600|      3|        };
  601|       |
  602|      3|        if (ctr->ctx_df == NULL)
  ------------------
  |  Branch (602:13): [True: 3, False: 0]
  ------------------
  603|      3|            ctr->ctx_df = EVP_CIPHER_CTX_new();
  604|      3|        if (ctr->ctx_df == NULL) {
  ------------------
  |  Branch (604:13): [True: 0, False: 3]
  ------------------
  605|      0|            ERR_raise(ERR_LIB_PROV, 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)
  |  |  ------------------
  ------------------
  606|      0|            goto err;
  607|      0|        }
  608|       |        /* Set key schedule for df_key */
  609|      3|        if (!EVP_CipherInit_ex(ctr->ctx_df,
  ------------------
  |  Branch (609:13): [True: 0, False: 3]
  ------------------
  610|      3|                               ctr->cipher_ecb, NULL, df_key, NULL, 1)) {
  611|      0|            ERR_raise(ERR_LIB_PROV, PROV_R_DERIVATION_FUNCTION_INIT_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)
  |  |  ------------------
  ------------------
  612|      0|            goto err;
  613|      0|        }
  614|      3|    }
  615|      3|    return drbg_ctr_init_lengths(drbg);
  616|       |
  617|      0|err:
  618|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ecb);
  619|      0|    EVP_CIPHER_CTX_free(ctr->ctx_ctr);
  620|      0|    ctr->ctx_ecb = ctr->ctx_ctr = NULL;
  621|      0|    return 0;
  622|      3|}
drbg_ctr.c:drbg_ctr_generate_wrapper:
  472|  1.32k|{
  473|  1.32k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  474|       |
  475|  1.32k|    return ossl_prov_drbg_generate(drbg, out, outlen, strength,
  476|  1.32k|                                   prediction_resistance, adin, adin_len);
  477|  1.32k|}
drbg_ctr.c:drbg_ctr_settable_ctx_params:
  823|      3|{
  824|      3|    static const OSSL_PARAM known_settable_ctx_params[] = {
  825|      3|        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_PROPERTIES, NULL, 0),
  ------------------
  |  |   61|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
  |  |  ------------------
  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  826|      3|        OSSL_PARAM_utf8_string(OSSL_DRBG_PARAM_CIPHER, NULL, 0),
  ------------------
  |  |   61|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_STRING, (addr), sz)
  |  |  ------------------
  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  827|      3|        OSSL_PARAM_int(OSSL_DRBG_PARAM_USE_DF, NULL),
  ------------------
  |  |   32|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(int))
  |  |  ------------------
  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  828|      3|        OSSL_PARAM_DRBG_SETTABLE_CTX_COMMON,
  ------------------
  |  |  222|      3|    OSSL_PARAM_uint(OSSL_DRBG_PARAM_RESEED_REQUESTS, NULL),             \
  |  |  ------------------
  |  |  |  |   34|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   35|      3|                    sizeof(unsigned int))
  |  |  ------------------
  |  |  223|      3|    OSSL_PARAM_uint64(OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL, NULL)
  |  |  ------------------
  |  |  |  |   49|      3|    OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), \
  |  |  |  |  ------------------
  |  |  |  |  |  |   28|      3|    { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   22|      3|# define OSSL_PARAM_UNMODIFIED ((size_t)-1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   50|      3|                    sizeof(uint64_t))
  |  |  ------------------
  ------------------
  829|      3|        OSSL_PARAM_END
  ------------------
  |  |   25|      3|    { NULL, 0, NULL, 0, 0 }
  ------------------
  830|      3|    };
  831|      3|    return known_settable_ctx_params;
  832|      3|}
drbg_ctr.c:drbg_ctr_get_ctx_params:
  665|  2.64k|{
  666|  2.64k|    PROV_DRBG *drbg = (PROV_DRBG *)vdrbg;
  667|  2.64k|    PROV_DRBG_CTR *ctr = (PROV_DRBG_CTR *)drbg->data;
  668|  2.64k|    OSSL_PARAM *p;
  669|  2.64k|    int ret = 0, complete = 0;
  670|       |
  671|  2.64k|    if (!ossl_drbg_get_ctx_params_no_lock(drbg, params, &complete))
  ------------------
  |  Branch (671:9): [True: 0, False: 2.64k]
  ------------------
  672|      0|        return 0;
  673|       |
  674|  2.64k|    if (complete)
  ------------------
  |  Branch (674:9): [True: 2.64k, False: 6]
  ------------------
  675|  2.64k|        return 1;
  676|       |
  677|      6|    if (drbg->lock != NULL && !CRYPTO_THREAD_read_lock(drbg->lock))
  ------------------
  |  Branch (677:9): [True: 6, False: 0]
  |  Branch (677:31): [True: 0, False: 6]
  ------------------
  678|      0|        return 0;
  679|       |
  680|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_USE_DF);
  ------------------
  |  |  249|      6|# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
  ------------------
  681|      6|    if (p != NULL && !OSSL_PARAM_set_int(p, ctr->use_df))
  ------------------
  |  Branch (681:9): [True: 0, False: 6]
  |  Branch (681:22): [True: 0, False: 0]
  ------------------
  682|      0|        goto err;
  683|       |
  684|      6|    p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_CIPHER);
  ------------------
  |  |  227|      6|# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
  |  |  ------------------
  |  |  |  |  121|      6|# define OSSL_ALG_PARAM_CIPHER "cipher"
  |  |  ------------------
  ------------------
  685|      6|    if (p != NULL) {
  ------------------
  |  Branch (685:9): [True: 0, False: 6]
  ------------------
  686|      0|        if (ctr->cipher_ctr == NULL
  ------------------
  |  Branch (686:13): [True: 0, False: 0]
  ------------------
  687|      0|            || !OSSL_PARAM_set_utf8_string(p,
  ------------------
  |  Branch (687:16): [True: 0, False: 0]
  ------------------
  688|      0|                                           EVP_CIPHER_get0_name(ctr->cipher_ctr)))
  689|      0|            goto err;
  690|      0|    }
  691|       |
  692|      6|    ret = ossl_drbg_get_ctx_params(drbg, params);
  693|      6| err:
  694|      6|    if (drbg->lock != NULL)
  ------------------
  |  Branch (694:9): [True: 6, False: 0]
  ------------------
  695|      6|        CRYPTO_THREAD_unlock(drbg->lock);
  696|       |
  697|      6|    return ret;
  698|      6|}

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_enable_locking:
  216|      1|{
  217|      1|    return 1;
  218|      1|}
seed_src.c:seed_src_lock:
  221|      9|{
  222|      9|    return 1;
  223|      9|}
seed_src.c:seed_src_unlock:
  226|      9|{
  227|      9|}
seed_src.c:seed_src_get_ctx_params:
  145|      6|{
  146|      6|    PROV_SEED_SRC *s = (PROV_SEED_SRC *)vseed;
  147|      6|    OSSL_PARAM *p;
  148|       |
  149|      6|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STATE);
  ------------------
  |  |  533|      6|# define OSSL_RAND_PARAM_STATE "state"
  ------------------
  150|      6|    if (p != NULL && !OSSL_PARAM_set_int(p, s->state))
  ------------------
  |  Branch (150:9): [True: 0, False: 6]
  |  Branch (150:22): [True: 0, False: 0]
  ------------------
  151|      0|        return 0;
  152|       |
  153|      6|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_STRENGTH);
  ------------------
  |  |  534|      6|# define OSSL_RAND_PARAM_STRENGTH "strength"
  ------------------
  154|      6|    if (p != NULL && !OSSL_PARAM_set_int(p, 1024))
  ------------------
  |  Branch (154:9): [True: 2, False: 4]
  |  Branch (154:22): [True: 0, False: 2]
  ------------------
  155|      0|        return 0;
  156|       |
  157|      6|    p = OSSL_PARAM_locate(params, OSSL_RAND_PARAM_MAX_REQUEST);
  ------------------
  |  |  532|      6|# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
  ------------------
  158|      6|    if (p != NULL && !OSSL_PARAM_set_size_t(p, 128))
  ------------------
  |  Branch (158:9): [True: 0, False: 6]
  |  Branch (158:22): [True: 0, False: 0]
  ------------------
  159|      0|        return 0;
  160|      6|    return 1;
  161|      6|}
seed_src.c:seed_get_seed:
  184|      1|{
  185|      1|    size_t ret = 0;
  186|      1|    size_t entropy_available = 0;
  187|      1|    RAND_POOL *pool;
  188|       |
  189|      1|    pool = ossl_rand_pool_new(entropy, 1, min_len, max_len);
  190|      1|    if (pool == NULL) {
  ------------------
  |  Branch (190:9): [True: 0, False: 1]
  ------------------
  191|      0|        ERR_raise(ERR_LIB_PROV, ERR_R_RAND_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  192|      0|        return 0;
  193|      0|    }
  194|       |
  195|       |    /* Get entropy by polling system entropy sources. */
  196|      1|    entropy_available = ossl_pool_acquire_entropy(pool);
  197|       |
  198|      1|    if (entropy_available > 0
  ------------------
  |  Branch (198:9): [True: 1, False: 0]
  ------------------
  199|      1|        && ossl_rand_pool_adin_mix_in(pool, adin, adin_len)) {
  ------------------
  |  Branch (199:12): [True: 1, False: 0]
  ------------------
  200|      1|        ret = ossl_rand_pool_length(pool);
  201|      1|        *pout = ossl_rand_pool_detach(pool);
  202|      1|    } else {
  203|      0|        ERR_raise(ERR_LIB_PROV, PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  302|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  303|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  204|      0|    }
  205|      1|    ossl_rand_pool_free(pool);
  206|      1|    return ret;
  207|      1|}
seed_src.c:seed_clear_seed:
  211|      1|{
  212|      1|    OPENSSL_secure_clear_free(out, outlen);
  ------------------
  |  |  129|      1|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|      1|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|      1|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  213|      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|}
ossl_pool_acquire_entropy:
  630|      1|{
  631|       |#  if defined(OPENSSL_RAND_SEED_NONE)
  632|       |    return ossl_rand_pool_entropy_available(pool);
  633|       |#  else
  634|      1|    size_t entropy_available = 0;
  635|       |
  636|      1|    (void)entropy_available;    /* avoid compiler warning */
  637|       |
  638|      1|#   if defined(OPENSSL_RAND_SEED_GETRANDOM)
  639|      1|    {
  640|      1|        size_t bytes_needed;
  641|      1|        unsigned char *buffer;
  642|      1|        ssize_t bytes;
  643|       |        /* Maximum allowed number of consecutive unsuccessful attempts */
  644|      1|        int attempts = 3;
  645|       |
  646|      1|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  647|      2|        while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (647:16): [True: 1, False: 1]
  |  Branch (647:37): [True: 1, False: 0]
  ------------------
  648|      1|            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  649|      1|            bytes = syscall_random(buffer, bytes_needed);
  650|      1|            if (bytes > 0) {
  ------------------
  |  Branch (650:17): [True: 1, False: 0]
  ------------------
  651|      1|                ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  652|      1|                bytes_needed -= bytes;
  653|      1|                attempts = 3; /* reset counter after successful attempt */
  654|      1|            } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (654:24): [True: 0, False: 0]
  |  Branch (654:37): [True: 0, False: 0]
  ------------------
  655|      0|                break;
  656|      0|            }
  657|      1|        }
  658|      1|    }
  659|      1|    entropy_available = ossl_rand_pool_entropy_available(pool);
  660|      1|    if (entropy_available > 0)
  ------------------
  |  Branch (660:9): [True: 1, False: 0]
  ------------------
  661|      1|        return entropy_available;
  662|      0|#   endif
  663|       |
  664|      0|#   if defined(OPENSSL_RAND_SEED_DEVRANDOM)
  665|      0|    if (wait_random_seeded()) {
  ------------------
  |  Branch (665:9): [True: 0, False: 0]
  ------------------
  666|      0|        size_t bytes_needed;
  667|      0|        unsigned char *buffer;
  668|      0|        size_t i;
  669|       |
  670|      0|        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  671|      0|        for (i = 0; bytes_needed > 0 && i < OSSL_NELEM(random_device_paths);
  ------------------
  |  |   14|      0|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (671:21): [True: 0, False: 0]
  |  Branch (671:41): [True: 0, False: 0]
  ------------------
  672|      0|             i++) {
  673|      0|            ssize_t bytes = 0;
  674|       |            /* Maximum number of consecutive unsuccessful attempts */
  675|      0|            int attempts = 3;
  676|      0|            const int fd = get_random_device(i);
  677|       |
  678|      0|            if (fd == -1)
  ------------------
  |  Branch (678:17): [True: 0, False: 0]
  ------------------
  679|      0|                continue;
  680|       |
  681|      0|            while (bytes_needed != 0 && attempts-- > 0) {
  ------------------
  |  Branch (681:20): [True: 0, False: 0]
  |  Branch (681:41): [True: 0, False: 0]
  ------------------
  682|      0|                buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  683|      0|                bytes = read(fd, buffer, bytes_needed);
  684|       |
  685|      0|                if (bytes > 0) {
  ------------------
  |  Branch (685:21): [True: 0, False: 0]
  ------------------
  686|      0|                    ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  687|      0|                    bytes_needed -= bytes;
  688|      0|                    attempts = 3; /* reset counter on successful attempt */
  689|      0|                } else if (bytes < 0 && errno != EINTR) {
  ------------------
  |  Branch (689:28): [True: 0, False: 0]
  |  Branch (689:41): [True: 0, False: 0]
  ------------------
  690|      0|                    break;
  691|      0|                }
  692|      0|            }
  693|      0|            if (bytes < 0 || !keep_random_devices_open)
  ------------------
  |  Branch (693:17): [True: 0, False: 0]
  |  Branch (693:30): [True: 0, False: 0]
  ------------------
  694|      0|                close_random_device(i);
  695|       |
  696|      0|            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  697|      0|        }
  698|      0|        entropy_available = ossl_rand_pool_entropy_available(pool);
  699|      0|        if (entropy_available > 0)
  ------------------
  |  Branch (699:13): [True: 0, False: 0]
  ------------------
  700|      0|            return entropy_available;
  701|      0|    }
  702|      0|#   endif
  703|       |
  704|       |#   if defined(OPENSSL_RAND_SEED_RDTSC)
  705|       |    entropy_available = ossl_prov_acquire_entropy_from_tsc(pool);
  706|       |    if (entropy_available > 0)
  707|       |        return entropy_available;
  708|       |#   endif
  709|       |
  710|       |#   if defined(OPENSSL_RAND_SEED_RDCPU)
  711|       |    entropy_available = ossl_prov_acquire_entropy_from_cpu(pool);
  712|       |    if (entropy_available > 0)
  713|       |        return entropy_available;
  714|       |#   endif
  715|       |
  716|       |#   if defined(OPENSSL_RAND_SEED_EGD)
  717|       |    {
  718|       |        static const char *paths[] = { DEVRANDOM_EGD, NULL };
  719|       |        size_t bytes_needed;
  720|       |        unsigned char *buffer;
  721|       |        int i;
  722|       |
  723|       |        bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
  724|       |        for (i = 0; bytes_needed > 0 && paths[i] != NULL; i++) {
  725|       |            size_t bytes = 0;
  726|       |            int num;
  727|       |
  728|       |            buffer = ossl_rand_pool_add_begin(pool, bytes_needed);
  729|       |            num = RAND_query_egd_bytes(paths[i],
  730|       |                                       buffer, (int)bytes_needed);
  731|       |            if (num == (int)bytes_needed)
  732|       |                bytes = bytes_needed;
  733|       |
  734|       |            ossl_rand_pool_add_end(pool, bytes, 8 * bytes);
  735|       |            bytes_needed = ossl_rand_pool_bytes_needed(pool, 1);
  736|       |        }
  737|       |        entropy_available = ossl_rand_pool_entropy_available(pool);
  738|       |        if (entropy_available > 0)
  739|       |            return entropy_available;
  740|       |    }
  741|       |#   endif
  742|       |
  743|      0|    return ossl_rand_pool_entropy_available(pool);
  744|      0|#  endif
  745|      0|}
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|}
rand_unix.c:syscall_random:
  334|      1|{
  335|       |    /*
  336|       |     * Note: 'buflen' equals the size of the buffer which is used by the
  337|       |     * get_entropy() callback of the RAND_DRBG. It is roughly bounded by
  338|       |     *
  339|       |     *   2 * RAND_POOL_FACTOR * (RAND_DRBG_STRENGTH / 8) = 2^14
  340|       |     *
  341|       |     * which is way below the OSSL_SSIZE_MAX limit. Therefore sign conversion
  342|       |     * between size_t and ssize_t is safe even without a range check.
  343|       |     */
  344|       |
  345|       |    /*
  346|       |     * Do runtime detection to find getentropy().
  347|       |     *
  348|       |     * Known OSs that should support this:
  349|       |     * - Darwin since 16 (OSX 10.12, IOS 10.0).
  350|       |     * - Solaris since 11.3
  351|       |     * - OpenBSD since 5.6
  352|       |     * - Linux since 3.17 with glibc 2.25
  353|       |     *
  354|       |     * Note: Sometimes getentropy() can be provided but not implemented
  355|       |     * internally. So we need to check errno for ENOSYS
  356|       |     */
  357|      1|#  if !defined(__DragonFly__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
  358|      1|#    if defined(__GNUC__) && __GNUC__>=2 && defined(__ELF__) && !defined(__hpux)
  359|      1|    extern int getentropy(void *buffer, size_t length) __attribute__((weak));
  360|       |
  361|      1|    if (getentropy != NULL) {
  ------------------
  |  Branch (361:9): [True: 1, False: 0]
  ------------------
  362|      1|        if (getentropy(buf, buflen) == 0)
  ------------------
  |  Branch (362:13): [True: 1, False: 0]
  ------------------
  363|      1|            return (ssize_t)buflen;
  364|      0|        if (errno != ENOSYS)
  ------------------
  |  Branch (364:13): [True: 0, False: 0]
  ------------------
  365|      0|            return -1;
  366|      0|    }
  367|       |#    elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
  368|       |
  369|       |    if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
  370|       |	    return (ssize_t)buflen;
  371|       |
  372|       |    return -1;
  373|       |#    else
  374|       |    union {
  375|       |        void *p;
  376|       |        int (*f)(void *buffer, size_t length);
  377|       |    } p_getentropy;
  378|       |
  379|       |    /*
  380|       |     * We could cache the result of the lookup, but we normally don't
  381|       |     * call this function often.
  382|       |     */
  383|       |    ERR_set_mark();
  384|       |    p_getentropy.p = DSO_global_lookup("getentropy");
  385|       |    ERR_pop_to_mark();
  386|       |    if (p_getentropy.p != NULL)
  387|       |        return p_getentropy.f(buf, buflen) == 0 ? (ssize_t)buflen : -1;
  388|       |#    endif
  389|      0|#  endif /* !__DragonFly__ && !__NetBSD__ && !__FreeBSD__ */
  390|       |
  391|       |    /* Linux supports this since version 3.17 */
  392|      0|#  if defined(__linux) && defined(__NR_getrandom)
  393|      0|    return syscall(__NR_getrandom, buf, buflen, 0);
  394|       |#  elif (defined(__DragonFly__)  && __DragonFly_version >= 500700) \
  395|       |     || (defined(__NetBSD__) && __NetBSD_Version >= 1000000000) \
  396|       |     || (defined(__FreeBSD__) && __FreeBSD_version >= 1200061)
  397|       |    return getrandom(buf, buflen, 0);
  398|       |#  elif (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND)
  399|       |    return sysctl_random(buf, buflen);
  400|       |#  elif defined(__wasi__)
  401|       |    if (getentropy(buf, buflen) == 0)
  402|       |      return (ssize_t)buflen;
  403|       |    return -1;
  404|       |#  else
  405|       |    errno = ENOSYS;
  406|       |    return -1;
  407|       |#  endif
  408|      1|}

slh_dsa_sig.c:slh_dsa_sha2_128s_newctx:
  346|     35|    {                                                                          \
  347|     35|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     35|    }                                                                          \
slh_dsa_sig.c:slh_dsa_newctx:
   69|    639|{
   70|    639|    PROV_SLH_DSA_CTX *ctx;
   71|       |
   72|    639|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (72:9): [True: 0, False: 639]
  ------------------
   73|      0|        return NULL;
   74|       |
   75|    639|    ctx = OPENSSL_zalloc(sizeof(PROV_SLH_DSA_CTX));
  ------------------
  |  |  104|    639|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   76|    639|    if (ctx == NULL)
  ------------------
  |  Branch (76:9): [True: 0, False: 639]
  ------------------
   77|      0|        return NULL;
   78|       |
   79|    639|    ctx->libctx = PROV_LIBCTX_OF(provctx);
  ------------------
  |  |   31|    639|    ossl_prov_ctx_get0_libctx((provctx))
  ------------------
   80|    639|    if (propq != NULL && (ctx->propq = OPENSSL_strdup(propq)) == 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 (80:9): [True: 0, False: 639]
  |  Branch (80:26): [True: 0, False: 0]
  ------------------
   81|      0|        goto err;
   82|    639|    ctx->alg = alg;
   83|    639|    ctx->msg_encode = SLH_DSA_MESSAGE_ENCODE_PURE;
  ------------------
  |  |   24|    639|#define SLH_DSA_MESSAGE_ENCODE_PURE 1
  ------------------
   84|    639|    return ctx;
   85|      0| err:
   86|      0|    slh_dsa_freectx(ctx);
   87|      0|    return NULL;
   88|    639|}
slh_dsa_sig.c:slh_dsa_sign_msg_init:
  177|    333|{
  178|    333|    return slh_dsa_signverify_msg_init(vctx, vkey, params,
  179|    333|                                       EVP_PKEY_OP_SIGN, "SLH_DSA Sign Init");
  ------------------
  |  | 1748|    333|# define EVP_PKEY_OP_SIGN                (1 << 4)
  ------------------
  180|    333|}
slh_dsa_sig.c:slh_dsa_signverify_msg_init:
  148|    639|{
  149|    639|    PROV_SLH_DSA_CTX *ctx = (PROV_SLH_DSA_CTX *)vctx;
  150|    639|    SLH_DSA_KEY *key = vkey;
  151|       |
  152|    639|    if (!ossl_prov_is_running()
  ------------------
  |  Branch (152:9): [True: 0, False: 639]
  ------------------
  153|    639|            || ctx == NULL)
  ------------------
  |  Branch (153:16): [True: 0, False: 639]
  ------------------
  154|      0|        return 0;
  155|       |
  156|    639|    if (vkey == NULL && ctx->key == NULL) {
  ------------------
  |  Branch (156:9): [True: 0, False: 639]
  |  Branch (156:25): [True: 0, False: 0]
  ------------------
  157|      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)
  |  |  ------------------
  ------------------
  158|      0|        return 0;
  159|      0|    }
  160|       |
  161|    639|    if (key != NULL) {
  ------------------
  |  Branch (161:9): [True: 639, False: 0]
  ------------------
  162|    639|        if (!ossl_slh_dsa_key_type_matches(key, ctx->alg))
  ------------------
  |  Branch (162:13): [True: 0, False: 639]
  ------------------
  163|      0|            return 0;
  164|    639|        ctx->hash_ctx = ossl_slh_dsa_hash_ctx_new(key);
  165|    639|        if (ctx->hash_ctx == NULL)
  ------------------
  |  Branch (165:13): [True: 0, False: 639]
  ------------------
  166|      0|            return 0;
  167|    639|        ctx->key = vkey;
  168|    639|    }
  169|       |
  170|    639|    slh_dsa_set_alg_id_buffer(ctx);
  171|    639|    if (!slh_dsa_set_ctx_params(ctx, params))
  ------------------
  |  Branch (171:9): [True: 27, False: 612]
  ------------------
  172|     27|        return 0;
  173|    612|    return 1;
  174|    639|}
slh_dsa_sig.c:slh_dsa_set_alg_id_buffer:
  120|    639|{
  121|    639|    int ret;
  122|    639|    WPACKET pkt;
  123|    639|    uint8_t *aid = NULL;
  124|       |
  125|       |    /*
  126|       |     * We do not care about DER writing errors.
  127|       |     * All it really means is that for some reason, there's no
  128|       |     * AlgorithmIdentifier to be had, but the operation itself is
  129|       |     * still valid, just as long as it's not used to construct
  130|       |     * anything that needs an AlgorithmIdentifier.
  131|       |     */
  132|    639|    ctx->aid_len = 0;
  133|    639|    ret = WPACKET_init_der(&pkt, ctx->aid_buf, sizeof(ctx->aid_buf));
  134|    639|    ret = ret && ossl_DER_w_algorithmIdentifier_SLH_DSA(&pkt, -1, ctx->key);
  ------------------
  |  Branch (134:11): [True: 639, False: 0]
  |  Branch (134:18): [True: 639, False: 0]
  ------------------
  135|    639|    if (ret && WPACKET_finish(&pkt)) {
  ------------------
  |  Branch (135:9): [True: 639, False: 0]
  |  Branch (135:16): [True: 639, False: 0]
  ------------------
  136|    639|        WPACKET_get_total_written(&pkt, &ctx->aid_len);
  137|    639|        aid = WPACKET_get_curr(&pkt);
  138|    639|    }
  139|    639|    WPACKET_cleanup(&pkt);
  140|    639|    if (aid != NULL && ctx->aid_len != 0)
  ------------------
  |  Branch (140:9): [True: 639, False: 0]
  |  Branch (140:24): [True: 639, False: 0]
  ------------------
  141|    639|        memmove(ctx->aid_buf, aid, ctx->aid_len);
  142|    639|    return 1;
  143|    639|}
slh_dsa_sig.c:slh_dsa_sign:
  202|    612|{
  203|    612|    int ret = 0;
  204|    612|    PROV_SLH_DSA_CTX *ctx = (PROV_SLH_DSA_CTX *)vctx;
  205|    612|    uint8_t add_rand[SLH_DSA_MAX_ADD_RANDOM_LEN], *opt_rand = NULL;
  206|    612|    size_t n = 0;
  207|       |
  208|    612|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (208:9): [True: 0, False: 612]
  ------------------
  209|      0|        return 0;
  210|       |
  211|    612|    if (sig != NULL) {
  ------------------
  |  Branch (211:9): [True: 306, False: 306]
  ------------------
  212|    306|        if (ctx->add_random_len != 0) {
  ------------------
  |  Branch (212:13): [True: 0, False: 306]
  ------------------
  213|      0|            opt_rand = ctx->add_random;
  214|    306|        } else if (ctx->deterministic == 0) {
  ------------------
  |  Branch (214:20): [True: 270, False: 36]
  ------------------
  215|    270|            n = ossl_slh_dsa_key_get_n(ctx->key);
  216|    270|            if (RAND_priv_bytes_ex(ctx->libctx, add_rand, n, 0) <= 0)
  ------------------
  |  Branch (216:17): [True: 0, False: 270]
  ------------------
  217|      0|                return 0;
  218|    270|            opt_rand = add_rand;
  219|    270|        }
  220|    306|    }
  221|    612|    ret = ossl_slh_dsa_sign(ctx->hash_ctx, msg, msg_len,
  222|    612|                            ctx->context_string, ctx->context_string_len,
  223|    612|                            opt_rand, ctx->msg_encode,
  224|    612|                            sig, siglen, sigsize);
  225|    612|    if (opt_rand != add_rand)
  ------------------
  |  Branch (225:9): [True: 342, False: 270]
  ------------------
  226|    342|        OPENSSL_cleanse(opt_rand, n);
  227|    612|    return ret;
  228|    612|}
slh_dsa_sig.c:slh_dsa_verify_msg_init:
  237|    306|{
  238|    306|    return slh_dsa_signverify_msg_init(vctx, vkey, params, EVP_PKEY_OP_VERIFY,
  ------------------
  |  | 1749|    306|# define EVP_PKEY_OP_VERIFY              (1 << 5)
  ------------------
  239|    306|                                       "SLH_DSA Verify Init");
  240|    306|}
slh_dsa_sig.c:slh_dsa_verify:
  244|    306|{
  245|    306|    PROV_SLH_DSA_CTX *ctx = (PROV_SLH_DSA_CTX *)vctx;
  246|       |
  247|    306|    if (!ossl_prov_is_running())
  ------------------
  |  Branch (247:9): [True: 0, False: 306]
  ------------------
  248|      0|        return 0;
  249|    306|    return ossl_slh_dsa_verify(ctx->hash_ctx, msg, msg_len,
  250|    306|                               ctx->context_string, ctx->context_string_len,
  251|    306|                               ctx->msg_encode, sig, siglen);
  252|    306|}
slh_dsa_sig.c:slh_dsa_freectx:
   59|    639|{
   60|    639|    PROV_SLH_DSA_CTX *ctx = (PROV_SLH_DSA_CTX *)vctx;
   61|       |
   62|    639|    ossl_slh_dsa_hash_ctx_free(ctx->hash_ctx);
   63|    639|    OPENSSL_free(ctx->propq);
  ------------------
  |  |  115|    639|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   64|    639|    OPENSSL_cleanse(ctx->add_random, ctx->add_random_len);
   65|    639|    OPENSSL_free(ctx);
  ------------------
  |  |  115|    639|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  302|    639|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  303|    639|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   66|    639|}
slh_dsa_sig.c:slh_dsa_set_ctx_params:
  260|    639|{
  261|    639|    PROV_SLH_DSA_CTX *pctx = (PROV_SLH_DSA_CTX *)vctx;
  262|    639|    const OSSL_PARAM *p;
  263|       |
  264|    639|    if (pctx == NULL)
  ------------------
  |  Branch (264:9): [True: 0, False: 639]
  ------------------
  265|      0|        return 0;
  266|    639|    if (ossl_param_is_empty(params))
  ------------------
  |  Branch (266:9): [True: 166, False: 473]
  ------------------
  267|    166|        return 1;
  268|       |
  269|    473|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_CONTEXT_STRING);
  ------------------
  |  |  540|    473|# define OSSL_SIGNATURE_PARAM_CONTEXT_STRING "context-string"
  ------------------
  270|    473|    if (p != NULL) {
  ------------------
  |  Branch (270:9): [True: 169, False: 304]
  ------------------
  271|    169|        void *vp = pctx->context_string;
  272|       |
  273|    169|        if (!OSSL_PARAM_get_octet_string(p, &vp, sizeof(pctx->context_string),
  ------------------
  |  Branch (273:13): [True: 27, False: 142]
  ------------------
  274|    169|                                         &(pctx->context_string_len))) {
  275|     27|            pctx->context_string_len = 0;
  276|     27|            return 0;
  277|     27|        }
  278|    169|    }
  279|    446|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_TEST_ENTROPY);
  ------------------
  |  |  562|    446|# define OSSL_SIGNATURE_PARAM_TEST_ENTROPY "test-entropy"
  ------------------
  280|    446|    if (p != NULL) {
  ------------------
  |  Branch (280:9): [True: 0, False: 446]
  ------------------
  281|      0|        void *vp = pctx->add_random;
  282|      0|        size_t n = ossl_slh_dsa_key_get_n(pctx->key);
  283|       |
  284|      0|        if (!OSSL_PARAM_get_octet_string(p, &vp, n, &(pctx->add_random_len))
  ------------------
  |  Branch (284:13): [True: 0, False: 0]
  ------------------
  285|      0|                || pctx->add_random_len != n) {
  ------------------
  |  Branch (285:20): [True: 0, False: 0]
  ------------------
  286|      0|            pctx->add_random_len = 0;
  287|      0|            return 0;
  288|      0|        }
  289|      0|    }
  290|    446|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_DETERMINISTIC);
  ------------------
  |  |  541|    446|# define OSSL_SIGNATURE_PARAM_DETERMINISTIC "deterministic"
  ------------------
  291|    446|    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->deterministic))
  ------------------
  |  Branch (291:9): [True: 320, False: 126]
  |  Branch (291:22): [True: 0, False: 320]
  ------------------
  292|      0|        return 0;
  293|       |
  294|    446|    p = OSSL_PARAM_locate_const(params, OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING);
  ------------------
  |  |  553|    446|# define OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING "message-encoding"
  ------------------
  295|    446|    if (p != NULL && !OSSL_PARAM_get_int(p, &pctx->msg_encode))
  ------------------
  |  Branch (295:9): [True: 180, False: 266]
  |  Branch (295:22): [True: 0, False: 180]
  ------------------
  296|      0|        return 0;
  297|    446|    return 1;
  298|    446|}
slh_dsa_sig.c:slh_dsa_sha2_128f_newctx:
  346|    136|    {                                                                          \
  347|    136|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|    136|    }                                                                          \
slh_dsa_sig.c:slh_dsa_sha2_192s_newctx:
  346|     30|    {                                                                          \
  347|     30|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     30|    }                                                                          \
slh_dsa_sig.c:slh_dsa_sha2_192f_newctx:
  346|     89|    {                                                                          \
  347|     89|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     89|    }                                                                          \
slh_dsa_sig.c:slh_dsa_sha2_256s_newctx:
  346|     60|    {                                                                          \
  347|     60|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     60|    }                                                                          \
slh_dsa_sig.c:slh_dsa_sha2_256f_newctx:
  346|     69|    {                                                                          \
  347|     69|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     69|    }                                                                          \
slh_dsa_sig.c:slh_dsa_shake_128s_newctx:
  346|     13|    {                                                                          \
  347|     13|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     13|    }                                                                          \
slh_dsa_sig.c:slh_dsa_shake_128f_newctx:
  346|     25|    {                                                                          \
  347|     25|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     25|    }                                                                          \
slh_dsa_sig.c:slh_dsa_shake_192s_newctx:
  346|     18|    {                                                                          \
  347|     18|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     18|    }                                                                          \
slh_dsa_sig.c:slh_dsa_shake_192f_newctx:
  346|     92|    {                                                                          \
  347|     92|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     92|    }                                                                          \
slh_dsa_sig.c:slh_dsa_shake_256s_newctx:
  346|     51|    {                                                                          \
  347|     51|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     51|    }                                                                          \
slh_dsa_sig.c:slh_dsa_shake_256f_newctx:
  346|     21|    {                                                                          \
  347|     21|        return slh_dsa_newctx(provctx, alg, propq);                            \
  348|     21|    }                                                                          \

ossl_prov_is_running:
   20|   807M|{
   21|   807M|    return 1;
   22|   807M|}

