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

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

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

BIO_new_ex:
   82|  3.71k|{
   83|  3.71k|    BIO *bio = OPENSSL_zalloc(sizeof(*bio));
  ------------------
  |  |   99|  3.71k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   84|       |
   85|  3.71k|    if (bio == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 3.71k]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|  3.71k|    bio->libctx = libctx;
   89|  3.71k|    bio->method = method;
   90|  3.71k|    bio->shutdown = 1;
   91|       |
   92|  3.71k|    if (!CRYPTO_NEW_REF(&bio->references, 1))
  ------------------
  |  Branch (92:9): [True: 0, False: 3.71k]
  ------------------
   93|      0|        goto err;
   94|       |
   95|  3.71k|    if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data))
  ------------------
  |  |  230|  3.71k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  |  Branch (95:9): [True: 0, False: 3.71k]
  ------------------
   96|      0|        goto err;
   97|       |
   98|  3.71k|    if (method->create != NULL && !method->create(bio)) {
  ------------------
  |  Branch (98:9): [True: 3.71k, False: 0]
  |  Branch (98:35): [True: 0, False: 3.71k]
  ------------------
   99|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_INIT_FAIL);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  100|      0|        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, bio, &bio->ex_data);
  ------------------
  |  |  230|      0|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  101|      0|        goto err;
  102|      0|    }
  103|  3.71k|    if (method->create == NULL)
  ------------------
  |  Branch (103:9): [True: 0, False: 3.71k]
  ------------------
  104|      0|        bio->init = 1;
  105|       |
  106|  3.71k|    return bio;
  107|       |
  108|      0|err:
  109|      0|    CRYPTO_FREE_REF(&bio->references);
  110|      0|    OPENSSL_free(bio);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  111|      0|    return NULL;
  112|  3.71k|}
BIO_new:
  115|  3.71k|{
  116|  3.71k|    return BIO_new_ex(NULL, method);
  117|  3.71k|}
BIO_free:
  120|  3.72k|{
  121|  3.72k|    int ret;
  122|       |
  123|  3.72k|    if (a == NULL)
  ------------------
  |  Branch (123:9): [True: 6, False: 3.71k]
  ------------------
  124|      6|        return 0;
  125|       |
  126|  3.71k|    if (CRYPTO_DOWN_REF(&a->references, &ret) <= 0)
  ------------------
  |  Branch (126:9): [True: 0, False: 3.71k]
  ------------------
  127|      0|        return 0;
  128|       |
  129|  3.71k|    REF_PRINT_COUNT("BIO", a);
  ------------------
  |  |  289|  3.71k|    REF_PRINT_EX(text, object->references.val, (void *)object)
  |  |  ------------------
  |  |  |  |  287|  3.71k|    OSSL_TRACE3(REF_COUNT, "%p:%4d:%s\n", (object), (count), (text));
  |  |  |  |  ------------------
  |  |  |  |  |  |  294|  3.71k|    OSSL_TRACEV(category, (trc_out, format, arg1, arg2, arg3))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  282|  3.71k|#  define OSSL_TRACEV(category, args) ((void)0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  130|  3.71k|    if (ret > 0)
  ------------------
  |  Branch (130:9): [True: 0, False: 3.71k]
  ------------------
  131|      0|        return 1;
  132|  3.71k|    REF_ASSERT_ISNT(ret < 0);
  ------------------
  |  |  281|  3.71k|    (void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
  |  |  ------------------
  |  |  |  Branch (281:12): [True: 0, False: 3.71k]
  |  |  ------------------
  ------------------
  133|       |
  134|  3.71k|    if (HAS_CALLBACK(a)) {
  ------------------
  |  |   26|  3.71k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 3.71k]
  |  |  |  Branch (26:52): [True: 0, False: 3.71k]
  |  |  ------------------
  ------------------
  135|      0|        ret = (int)bio_call_callback(a, BIO_CB_FREE, NULL, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  285|      0|# define BIO_CB_FREE        0x01
  ------------------
  136|      0|        if (ret <= 0)
  ------------------
  |  Branch (136:13): [True: 0, False: 0]
  ------------------
  137|      0|            return 0;
  138|      0|    }
  139|       |
  140|  3.71k|    if ((a->method != NULL) && (a->method->destroy != NULL))
  ------------------
  |  Branch (140:9): [True: 3.71k, False: 0]
  |  Branch (140:32): [True: 3.71k, False: 0]
  ------------------
  141|  3.71k|        a->method->destroy(a);
  142|       |
  143|  3.71k|    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
  ------------------
  |  |  230|  3.71k|# define CRYPTO_EX_INDEX_BIO             12
  ------------------
  144|       |
  145|  3.71k|    CRYPTO_FREE_REF(&a->references);
  146|       |
  147|  3.71k|    OPENSSL_free(a);
  ------------------
  |  |  107|  3.71k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  148|       |
  149|  3.71k|    return 1;
  150|  3.71k|}
BIO_clear_flags:
  200|  1.40M|{
  201|  1.40M|    b->flags &= ~flags;
  202|  1.40M|}
BIO_read:
  304|    207|{
  305|    207|    size_t readbytes;
  306|    207|    int ret;
  307|       |
  308|    207|    if (dlen < 0)
  ------------------
  |  Branch (308:9): [True: 0, False: 207]
  ------------------
  309|      0|        return 0;
  310|       |
  311|    207|    ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);
  312|       |
  313|    207|    if (ret > 0) {
  ------------------
  |  Branch (313:9): [True: 207, False: 0]
  ------------------
  314|       |        /* *readbytes should always be <= dlen */
  315|    207|        ret = (int)readbytes;
  316|    207|    }
  317|       |
  318|    207|    return ret;
  319|    207|}
BIO_write:
  371|  1.71k|{
  372|  1.71k|    size_t written;
  373|  1.71k|    int ret;
  374|       |
  375|  1.71k|    if (dlen <= 0)
  ------------------
  |  Branch (375:9): [True: 267, False: 1.45k]
  ------------------
  376|    267|        return 0;
  377|       |
  378|  1.45k|    ret = bio_write_intern(b, data, (size_t)dlen, &written);
  379|       |
  380|  1.45k|    if (ret > 0) {
  ------------------
  |  Branch (380:9): [True: 1.45k, False: 0]
  ------------------
  381|       |        /* written should always be <= dlen */
  382|  1.45k|        ret = (int)written;
  383|  1.45k|    }
  384|       |
  385|  1.45k|    return ret;
  386|  1.71k|}
BIO_puts:
  499|   367k|{
  500|   367k|    int ret;
  501|   367k|    size_t written = 0;
  502|       |
  503|   367k|    if (b == NULL) {
  ------------------
  |  Branch (503:9): [True: 0, False: 367k]
  ------------------
  504|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  505|      0|        return -1;
  506|      0|    }
  507|   367k|    if (b->method == NULL || b->method->bputs == NULL) {
  ------------------
  |  Branch (507:9): [True: 0, False: 367k]
  |  Branch (507:30): [True: 0, False: 367k]
  ------------------
  508|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  509|      0|        return -2;
  510|      0|    }
  511|       |
  512|   367k|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|   367k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 367k]
  |  |  |  Branch (26:52): [True: 0, False: 367k]
  |  |  ------------------
  ------------------
  513|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  ------------------
  |  |  288|      0|# define BIO_CB_PUTS        0x04
  ------------------
  514|      0|        if (ret <= 0)
  ------------------
  |  Branch (514:13): [True: 0, False: 0]
  ------------------
  515|      0|            return ret;
  516|      0|    }
  517|       |
  518|   367k|    if (!b->init) {
  ------------------
  |  Branch (518:9): [True: 0, False: 367k]
  ------------------
  519|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  520|      0|        return -1;
  521|      0|    }
  522|       |
  523|   367k|    ret = b->method->bputs(b, buf);
  524|       |
  525|   367k|    if (ret > 0) {
  ------------------
  |  Branch (525:9): [True: 367k, False: 366]
  ------------------
  526|   367k|        b->num_write += (uint64_t)ret;
  527|   367k|        written = ret;
  528|   367k|        ret = 1;
  529|   367k|    }
  530|       |
  531|   367k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   367k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 367k]
  |  |  |  Branch (26:52): [True: 0, False: 367k]
  |  |  ------------------
  ------------------
  532|      0|        ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  288|      0|# define BIO_CB_PUTS        0x04
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  ------------------
  |  |  298|      0|# define BIO_CB_RETURN   0x80
  ------------------
  533|      0|                                     0L, ret, &written);
  534|       |
  535|   367k|    if (ret > 0) {
  ------------------
  |  Branch (535:9): [True: 367k, False: 366]
  ------------------
  536|   367k|        if (written > INT_MAX) {
  ------------------
  |  Branch (536:13): [True: 0, False: 367k]
  ------------------
  537|      0|            ERR_raise(ERR_LIB_BIO, BIO_R_LENGTH_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  538|      0|            ret = -1;
  539|   367k|        } else {
  540|   367k|            ret = (int)written;
  541|   367k|        }
  542|   367k|    }
  543|       |
  544|   367k|    return ret;
  545|   367k|}
BIO_gets:
  548|   515k|{
  549|   515k|    int ret;
  550|   515k|    size_t readbytes = 0;
  551|       |
  552|   515k|    if (b == NULL) {
  ------------------
  |  Branch (552:9): [True: 0, False: 515k]
  ------------------
  553|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  554|      0|        return -1;
  555|      0|    }
  556|   515k|    if (b->method == NULL || b->method->bgets == NULL) {
  ------------------
  |  Branch (556:9): [True: 0, False: 515k]
  |  Branch (556:30): [True: 0, False: 515k]
  ------------------
  557|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  558|      0|        return -2;
  559|      0|    }
  560|       |
  561|   515k|    if (size < 0) {
  ------------------
  |  Branch (561:9): [True: 0, False: 515k]
  ------------------
  562|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  563|      0|        return -1;
  564|      0|    }
  565|       |
  566|   515k|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|   515k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 515k]
  |  |  |  Branch (26:52): [True: 0, False: 515k]
  |  |  ------------------
  ------------------
  567|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS, buf, size, 0, 0L, 1, NULL);
  ------------------
  |  |  289|      0|# define BIO_CB_GETS        0x05
  ------------------
  568|      0|        if (ret <= 0)
  ------------------
  |  Branch (568:13): [True: 0, False: 0]
  ------------------
  569|      0|            return ret;
  570|      0|    }
  571|       |
  572|   515k|    if (!b->init) {
  ------------------
  |  Branch (572:9): [True: 0, False: 515k]
  ------------------
  573|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  574|      0|        return -1;
  575|      0|    }
  576|       |
  577|   515k|    ret = b->method->bgets(b, buf, size);
  578|       |
  579|   515k|    if (ret > 0) {
  ------------------
  |  Branch (579:9): [True: 515k, False: 733]
  ------------------
  580|   515k|        readbytes = ret;
  581|   515k|        ret = 1;
  582|   515k|    }
  583|       |
  584|   515k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|   515k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 515k]
  |  |  |  Branch (26:52): [True: 0, False: 515k]
  |  |  ------------------
  ------------------
  585|      0|        ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  289|      0|# define BIO_CB_GETS        0x05
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
  ------------------
  |  |  298|      0|# define BIO_CB_RETURN   0x80
  ------------------
  586|      0|                                     0, 0L, ret, &readbytes);
  587|       |
  588|   515k|    if (ret > 0) {
  ------------------
  |  Branch (588:9): [True: 515k, False: 733]
  ------------------
  589|       |        /* Shouldn't happen */
  590|   515k|        if (readbytes > (size_t)size)
  ------------------
  |  Branch (590:13): [True: 0, False: 515k]
  ------------------
  591|      0|            ret = -1;
  592|   515k|        else
  593|   515k|            ret = (int)readbytes;
  594|   515k|    }
  595|       |
  596|   515k|    return ret;
  597|   515k|}
BIO_ctrl:
  661|    435|{
  662|    435|    long ret;
  663|       |
  664|    435|    if (b == NULL)
  ------------------
  |  Branch (664:9): [True: 0, False: 435]
  ------------------
  665|      0|        return -1;
  666|    435|    if (b->method == NULL || b->method->ctrl == NULL) {
  ------------------
  |  Branch (666:9): [True: 0, False: 435]
  |  Branch (666:30): [True: 0, False: 435]
  ------------------
  667|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  668|      0|        return -2;
  669|      0|    }
  670|       |
  671|    435|    if (HAS_CALLBACK(b)) {
  ------------------
  |  |   26|    435|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 435]
  |  |  |  Branch (26:52): [True: 0, False: 435]
  |  |  ------------------
  ------------------
  672|      0|        ret = bio_call_callback(b, BIO_CB_CTRL, parg, 0, cmd, larg, 1L, NULL);
  ------------------
  |  |  290|      0|# define BIO_CB_CTRL        0x06
  ------------------
  673|      0|        if (ret <= 0)
  ------------------
  |  Branch (673:13): [True: 0, False: 0]
  ------------------
  674|      0|            return ret;
  675|      0|    }
  676|       |
  677|    435|    ret = b->method->ctrl(b, cmd, larg, parg);
  678|       |
  679|    435|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|    435|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 435]
  |  |  |  Branch (26:52): [True: 0, False: 435]
  |  |  ------------------
  ------------------
  680|      0|        ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  290|      0|# define BIO_CB_CTRL        0x06
  ------------------
                      ret = bio_call_callback(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, 0, cmd,
  ------------------
  |  |  298|      0|# define BIO_CB_RETURN   0x80
  ------------------
  681|      0|                                larg, ret, NULL);
  682|       |
  683|    435|    return ret;
  684|    435|}
bio_cleanup:
  947|      2|{
  948|      2|#ifndef OPENSSL_NO_SOCK
  949|      2|    bio_sock_cleanup_int();
  950|      2|    CRYPTO_THREAD_lock_free(bio_lookup_lock);
  951|      2|    bio_lookup_lock = NULL;
  952|      2|#endif
  953|      2|    CRYPTO_FREE_REF(&bio_type_count);
  954|      2|}
bio_lib.c:bio_read_intern:
  263|    207|{
  264|    207|    int ret;
  265|       |
  266|    207|    if (b == NULL) {
  ------------------
  |  Branch (266:9): [True: 0, False: 207]
  ------------------
  267|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  268|      0|        return -1;
  269|      0|    }
  270|    207|    if (b->method == NULL || b->method->bread == NULL) {
  ------------------
  |  Branch (270:9): [True: 0, False: 207]
  |  Branch (270:30): [True: 0, False: 207]
  ------------------
  271|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  272|      0|        return -2;
  273|      0|    }
  274|       |
  275|    207|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|    414|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 207]
  |  |  |  Branch (26:52): [True: 0, False: 207]
  |  |  ------------------
  ------------------
  276|    207|        ((ret = (int)bio_call_callback(b, BIO_CB_READ, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  286|      0|# define BIO_CB_READ        0x02
  ------------------
  |  Branch (276:9): [True: 0, False: 0]
  ------------------
  277|      0|                                       NULL)) <= 0))
  278|      0|        return ret;
  279|       |
  280|    207|    if (!b->init) {
  ------------------
  |  Branch (280:9): [True: 0, False: 207]
  ------------------
  281|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  282|      0|        return -1;
  283|      0|    }
  284|       |
  285|    207|    ret = b->method->bread(b, data, dlen, readbytes);
  286|       |
  287|    207|    if (ret > 0)
  ------------------
  |  Branch (287:9): [True: 207, False: 0]
  ------------------
  288|    207|        b->num_read += (uint64_t)*readbytes;
  289|       |
  290|    207|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|    207|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 207]
  |  |  |  Branch (26:52): [True: 0, False: 207]
  |  |  ------------------
  ------------------
  291|      0|        ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  286|      0|# define BIO_CB_READ        0x02
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_READ | BIO_CB_RETURN, data,
  ------------------
  |  |  298|      0|# define BIO_CB_RETURN   0x80
  ------------------
  292|      0|                                     dlen, 0, 0L, ret, readbytes);
  293|       |
  294|       |    /* Shouldn't happen */
  295|    207|    if (ret > 0 && *readbytes > dlen) {
  ------------------
  |  Branch (295:9): [True: 207, False: 0]
  |  Branch (295:20): [True: 0, False: 207]
  ------------------
  296|      0|        ERR_raise(ERR_LIB_BIO, 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  297|      0|        return -1;
  298|      0|    }
  299|       |
  300|    207|    return ret;
  301|    207|}
bio_lib.c:bio_write_intern:
  328|  1.45k|{
  329|  1.45k|    size_t local_written;
  330|  1.45k|    int ret;
  331|       |
  332|  1.45k|    if (written != NULL)
  ------------------
  |  Branch (332:9): [True: 1.45k, False: 0]
  ------------------
  333|  1.45k|        *written = 0;
  334|       |    /*
  335|       |     * b == NULL is not an error but just means that zero bytes are written.
  336|       |     * Do not raise an error here.
  337|       |     */
  338|  1.45k|    if (b == NULL)
  ------------------
  |  Branch (338:9): [True: 0, False: 1.45k]
  ------------------
  339|      0|        return 0;
  340|       |
  341|  1.45k|    if (b->method == NULL || b->method->bwrite == NULL) {
  ------------------
  |  Branch (341:9): [True: 0, False: 1.45k]
  |  Branch (341:30): [True: 0, False: 1.45k]
  ------------------
  342|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  343|      0|        return -2;
  344|      0|    }
  345|       |
  346|  1.45k|    if (HAS_CALLBACK(b) &&
  ------------------
  |  |   26|  2.90k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 1.45k]
  |  |  |  Branch (26:52): [True: 0, False: 1.45k]
  |  |  ------------------
  ------------------
  347|  1.45k|        ((ret = (int)bio_call_callback(b, BIO_CB_WRITE, data, dlen, 0, 0L, 1L,
  ------------------
  |  |  287|      0|# define BIO_CB_WRITE       0x03
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|                                       NULL)) <= 0))
  349|      0|        return ret;
  350|       |
  351|  1.45k|    if (!b->init) {
  ------------------
  |  Branch (351:9): [True: 0, False: 1.45k]
  ------------------
  352|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_UNINITIALIZED);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  353|      0|        return -1;
  354|      0|    }
  355|       |
  356|  1.45k|    ret = b->method->bwrite(b, data, dlen, &local_written);
  357|       |
  358|  1.45k|    if (ret > 0)
  ------------------
  |  Branch (358:9): [True: 1.45k, False: 0]
  ------------------
  359|  1.45k|        b->num_write += (uint64_t)local_written;
  360|       |
  361|  1.45k|    if (HAS_CALLBACK(b))
  ------------------
  |  |   26|  1.45k|# define HAS_CALLBACK(b) ((b)->callback != NULL || (b)->callback_ex != NULL)
  |  |  ------------------
  |  |  |  Branch (26:27): [True: 0, False: 1.45k]
  |  |  |  Branch (26:52): [True: 0, False: 1.45k]
  |  |  ------------------
  ------------------
  362|      0|        ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  287|      0|# define BIO_CB_WRITE       0x03
  ------------------
                      ret = (int)bio_call_callback(b, BIO_CB_WRITE | BIO_CB_RETURN, data,
  ------------------
  |  |  298|      0|# define BIO_CB_RETURN   0x80
  ------------------
  363|      0|                                     dlen, 0, 0L, ret, &local_written);
  364|       |
  365|  1.45k|    if (written != NULL)
  ------------------
  |  Branch (365:9): [True: 1.45k, False: 0]
  ------------------
  366|  1.45k|        *written = local_written;
  367|  1.45k|    return ret;
  368|  1.45k|}

bwrite_conv:
   69|  1.45k|{
   70|  1.45k|    int ret;
   71|       |
   72|  1.45k|    if (datal > INT_MAX)
  ------------------
  |  Branch (72:9): [True: 0, False: 1.45k]
  ------------------
   73|      0|        datal = INT_MAX;
   74|       |
   75|  1.45k|    ret = bio->method->bwrite_old(bio, data, (int)datal);
   76|       |
   77|  1.45k|    if (ret <= 0) {
  ------------------
  |  Branch (77:9): [True: 0, False: 1.45k]
  ------------------
   78|      0|        *written = 0;
   79|      0|        return ret;
   80|      0|    }
   81|       |
   82|  1.45k|    *written = (size_t)ret;
   83|       |
   84|  1.45k|    return 1;
   85|  1.45k|}
bread_conv:
  115|    207|{
  116|    207|    int ret;
  117|       |
  118|    207|    if (datal > INT_MAX)
  ------------------
  |  Branch (118:9): [True: 0, False: 207]
  ------------------
  119|      0|        datal = INT_MAX;
  120|       |
  121|    207|    ret = bio->method->bread_old(bio, data, (int)datal);
  122|       |
  123|    207|    if (ret <= 0) {
  ------------------
  |  Branch (123:9): [True: 0, False: 207]
  ------------------
  124|      0|        *readbytes = 0;
  125|      0|        return ret;
  126|      0|    }
  127|       |
  128|    207|    *readbytes = (size_t)ret;
  129|       |
  130|    207|    return 1;
  131|    207|}

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

ossl_bio_core_globals_free:
   26|      2|{
   27|      2|    OPENSSL_free(vbcg);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   28|      2|}
ossl_bio_core_globals_new:
   31|      2|{
   32|      2|    return OPENSSL_zalloc(sizeof(BIO_CORE_GLOBALS));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   33|      2|}

BIO_s_mem:
   73|  1.99k|{
   74|  1.99k|    return &mem_method;
   75|  1.99k|}
BIO_s_secmem:
   78|    486|{
   79|    486|    return(&secmem_method);
   80|    486|}
bss_mem.c:mem_write:
  215|   368k|{
  216|   368k|    int ret = -1;
  217|   368k|    int blen;
  218|   368k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  219|       |
  220|   368k|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  233|   368k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (220:9): [True: 0, False: 368k]
  ------------------
  221|      0|        ERR_raise(ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  222|      0|        goto end;
  223|      0|    }
  224|   368k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  257|   368k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  219|   368k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|   368k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  217|   368k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  218|   368k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  220|   368k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  225|   368k|    if (inl == 0)
  ------------------
  |  Branch (225:9): [True: 366, False: 368k]
  ------------------
  226|    366|        return 0;
  227|   368k|    if (in == NULL) {
  ------------------
  |  Branch (227:9): [True: 0, False: 368k]
  ------------------
  228|      0|        ERR_raise(ERR_LIB_BIO, ERR_R_PASSED_NULL_PARAMETER);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  229|      0|        goto end;
  230|      0|    }
  231|   368k|    blen = bbm->readp->length;
  232|   368k|    mem_buf_sync(b);
  233|   368k|    if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0)
  ------------------
  |  Branch (233:9): [True: 0, False: 368k]
  ------------------
  234|      0|        goto end;
  235|   368k|    memcpy(bbm->buf->data + blen, in, inl);
  236|   368k|    *bbm->readp = *bbm->buf;
  237|   368k|    ret = inl;
  238|   368k| end:
  239|   368k|    return ret;
  240|   368k|}
bss_mem.c:mem_buf_sync:
  178|   368k|{
  179|   368k|    if (b != NULL && b->init != 0 && b->ptr != NULL) {
  ------------------
  |  Branch (179:9): [True: 368k, False: 0]
  |  Branch (179:22): [True: 368k, False: 0]
  |  Branch (179:38): [True: 368k, False: 0]
  ------------------
  180|   368k|        BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  181|       |
  182|   368k|        if (bbm->readp->data != bbm->buf->data) {
  ------------------
  |  Branch (182:13): [True: 159, False: 368k]
  ------------------
  183|    159|            memmove(bbm->buf->data, bbm->readp->data, bbm->readp->length);
  184|    159|            bbm->buf->length = bbm->readp->length;
  185|    159|            bbm->readp->data = bbm->buf->data;
  186|    159|        }
  187|   368k|    }
  188|   368k|    return 0;
  189|   368k|}
bss_mem.c:mem_read:
  192|   515k|{
  193|   515k|    int ret = -1;
  194|   515k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  195|   515k|    BUF_MEM *bm = bbm->readp;
  196|       |
  197|   515k|    if (b->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  233|   515k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (197:9): [True: 0, False: 515k]
  ------------------
  198|      0|        bm = bbm->buf;
  199|   515k|    BIO_clear_retry_flags(b);
  ------------------
  |  |  257|   515k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  219|   515k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|   515k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  217|   515k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  218|   515k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  220|   515k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  200|   515k|    ret = (outl >= 0 && (size_t)outl > bm->length) ? (int)bm->length : outl;
  ------------------
  |  Branch (200:12): [True: 515k, False: 0]
  |  Branch (200:25): [True: 0, False: 515k]
  ------------------
  201|   515k|    if ((out != NULL) && (ret > 0)) {
  ------------------
  |  Branch (201:9): [True: 515k, False: 0]
  |  Branch (201:26): [True: 515k, False: 0]
  ------------------
  202|   515k|        memcpy(out, bm->data, ret);
  203|   515k|        bm->length -= ret;
  204|   515k|        bm->max -= ret;
  205|   515k|        bm->data += ret;
  206|   515k|    } else if (bm->length == 0) {
  ------------------
  |  Branch (206:16): [True: 0, False: 0]
  ------------------
  207|      0|        ret = b->num;
  208|      0|        if (ret != 0)
  ------------------
  |  Branch (208:13): [True: 0, False: 0]
  ------------------
  209|      0|            BIO_set_retry_read(b);
  ------------------
  |  |  251|      0|                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  216|      0|# define BIO_FLAGS_READ          0x01
  |  |  ------------------
  |  |                               BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  220|      0|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  210|      0|    }
  211|   515k|    return ret;
  212|   515k|}
bss_mem.c:mem_puts:
  380|   367k|{
  381|   367k|    int n, ret;
  382|       |
  383|   367k|    n = strlen(str);
  384|   367k|    ret = mem_write(bp, str, n);
  385|       |    /* memory semantics is that it will always work */
  386|   367k|    return ret;
  387|   367k|}
bss_mem.c:mem_gets:
  342|   515k|{
  343|   515k|    int i, j;
  344|   515k|    int ret = -1;
  345|   515k|    char *p;
  346|   515k|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)bp->ptr;
  347|   515k|    BUF_MEM *bm = bbm->readp;
  348|       |
  349|   515k|    if (bp->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  233|   515k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (349:9): [True: 0, False: 515k]
  ------------------
  350|      0|        bm = bbm->buf;
  351|   515k|    BIO_clear_retry_flags(bp);
  ------------------
  |  |  257|   515k|                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  219|   515k|# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|   515k|# define BIO_FLAGS_READ          0x01
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  217|   515k|# define BIO_FLAGS_WRITE         0x02
  |  |  |  |  ------------------
  |  |  |  |               # define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  218|   515k|# define BIO_FLAGS_IO_SPECIAL    0x04
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                               BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
  |  |  ------------------
  |  |  |  |  220|   515k|# define BIO_FLAGS_SHOULD_RETRY  0x08
  |  |  ------------------
  ------------------
  352|   515k|    j = bm->length;
  353|   515k|    if ((size - 1) < j)
  ------------------
  |  Branch (353:9): [True: 507k, False: 8.49k]
  ------------------
  354|   507k|        j = size - 1;
  355|   515k|    if (j <= 0) {
  ------------------
  |  Branch (355:9): [True: 733, False: 515k]
  ------------------
  356|    733|        *buf = '\0';
  357|    733|        return 0;
  358|    733|    }
  359|   515k|    p = bm->data;
  360|  45.3M|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (360:17): [True: 45.1M, False: 154k]
  ------------------
  361|  45.1M|        if (p[i] == '\n') {
  ------------------
  |  Branch (361:13): [True: 360k, False: 44.7M]
  ------------------
  362|   360k|            i++;
  363|   360k|            break;
  364|   360k|        }
  365|  45.1M|    }
  366|       |
  367|       |    /*
  368|       |     * i is now the max num of bytes to copy, either j or up to
  369|       |     * and including the first newline
  370|       |     */
  371|       |
  372|   515k|    i = mem_read(bp, buf, i);
  373|   515k|    if (i > 0)
  ------------------
  |  Branch (373:9): [True: 515k, False: 0]
  ------------------
  374|   515k|        buf[i] = '\0';
  375|   515k|    ret = i;
  376|   515k|    return ret;
  377|   515k|}
bss_mem.c:mem_ctrl:
  243|    435|{
  244|    435|    long ret = 1;
  245|    435|    char **pptr;
  246|    435|    BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;
  247|    435|    BUF_MEM *bm, *bo;            /* bio_mem, bio_other */
  248|    435|    long off, remain;
  249|       |
  250|    435|    if (b->flags & BIO_FLAGS_MEM_RDONLY) {
  ------------------
  |  |  233|    435|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (250:9): [True: 0, False: 435]
  ------------------
  251|      0|        bm = bbm->buf;
  252|      0|        bo = bbm->readp;
  253|    435|    } else {
  254|    435|        bm = bbm->readp;
  255|    435|        bo = bbm->buf;
  256|    435|    }
  257|    435|    off = (bm->data == bo->data) ? 0 : bm->data - bo->data;
  ------------------
  |  Branch (257:11): [True: 435, False: 0]
  ------------------
  258|    435|    remain = bm->length;
  259|       |
  260|    435|    switch (cmd) {
  261|      0|    case BIO_CTRL_RESET:
  ------------------
  |  |   85|      0|# define BIO_CTRL_RESET          1/* opt - rewind/zero etc */
  ------------------
  |  Branch (261:5): [True: 0, False: 435]
  ------------------
  262|      0|        bm = bbm->buf;
  263|      0|        if (bm->data != NULL) {
  ------------------
  |  Branch (263:13): [True: 0, False: 0]
  ------------------
  264|      0|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY)) {
  ------------------
  |  |  233|      0|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (264:17): [True: 0, False: 0]
  ------------------
  265|      0|                if (!(b->flags & BIO_FLAGS_NONCLEAR_RST)) {
  ------------------
  |  |  234|      0|# define BIO_FLAGS_NONCLEAR_RST  0x400
  ------------------
  |  Branch (265:21): [True: 0, False: 0]
  ------------------
  266|      0|                    memset(bm->data, 0, bm->max);
  267|      0|                    bm->length = 0;
  268|      0|                }
  269|      0|                *bbm->readp = *bbm->buf;
  270|      0|            } else {
  271|       |                /* For read only case just reset to the start again */
  272|      0|                *bbm->buf = *bbm->readp;
  273|      0|            }
  274|      0|        }
  275|      0|        break;
  276|      0|    case BIO_C_FILE_SEEK:
  ------------------
  |  |  453|      0|# define BIO_C_FILE_SEEK                         128
  ------------------
  |  Branch (276:5): [True: 0, False: 435]
  ------------------
  277|      0|        if (num < 0 || num > off + remain)
  ------------------
  |  Branch (277:13): [True: 0, False: 0]
  |  Branch (277:24): [True: 0, False: 0]
  ------------------
  278|      0|            return -1;   /* Can't see outside of the current buffer */
  279|       |
  280|      0|        bm->data = (num != 0) ? bo->data + num : bo->data;
  ------------------
  |  Branch (280:20): [True: 0, False: 0]
  ------------------
  281|      0|        bm->length = bo->length - num;
  282|      0|        bm->max = bo->max - num;
  283|      0|        off = num;
  284|       |        /* FALLTHRU */
  285|      0|    case BIO_C_FILE_TELL:
  ------------------
  |  |  459|      0|# define BIO_C_FILE_TELL                         133
  ------------------
  |  Branch (285:5): [True: 0, False: 435]
  ------------------
  286|      0|        ret = off;
  287|      0|        break;
  288|      0|    case BIO_CTRL_EOF:
  ------------------
  |  |   86|      0|# define BIO_CTRL_EOF            2/* opt - are we at the eof */
  ------------------
  |  Branch (288:5): [True: 0, False: 435]
  ------------------
  289|      0|        ret = (long)(bm->length == 0);
  290|      0|        break;
  291|      0|    case BIO_C_SET_BUF_MEM_EOF_RETURN:
  ------------------
  |  |  455|      0|# define BIO_C_SET_BUF_MEM_EOF_RETURN            130/* return end of input
  ------------------
  |  Branch (291:5): [True: 0, False: 435]
  ------------------
  292|      0|        b->num = (int)num;
  293|      0|        break;
  294|    175|    case BIO_CTRL_INFO:
  ------------------
  |  |   87|    175|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  ------------------
  |  Branch (294:5): [True: 175, False: 260]
  ------------------
  295|    175|        ret = (long)bm->length;
  296|    175|        if (ptr != NULL) {
  ------------------
  |  Branch (296:13): [True: 0, False: 175]
  ------------------
  297|      0|            pptr = (char **)ptr;
  298|      0|            *pptr = (char *)(bm->data);
  299|      0|        }
  300|    175|        break;
  301|      0|    case BIO_C_SET_BUF_MEM:
  ------------------
  |  |  439|      0|# define BIO_C_SET_BUF_MEM                       114
  ------------------
  |  Branch (301:5): [True: 0, False: 435]
  ------------------
  302|      0|        mem_buf_free(b);
  303|      0|        b->shutdown = (int)num;
  304|      0|        bbm->buf = ptr;
  305|      0|        *bbm->readp = *bbm->buf;
  306|      0|        break;
  307|    260|    case BIO_C_GET_BUF_MEM_PTR:
  ------------------
  |  |  440|    260|# define BIO_C_GET_BUF_MEM_PTR                   115
  ------------------
  |  Branch (307:5): [True: 260, False: 175]
  ------------------
  308|    260|        if (ptr != NULL) {
  ------------------
  |  Branch (308:13): [True: 260, False: 0]
  ------------------
  309|    260|            if (!(b->flags & BIO_FLAGS_MEM_RDONLY))
  ------------------
  |  |  233|    260|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (309:17): [True: 260, False: 0]
  ------------------
  310|    260|                mem_buf_sync(b);
  311|    260|            bm = bbm->buf;
  312|    260|            pptr = (char **)ptr;
  313|    260|            *pptr = (char *)bm;
  314|    260|        }
  315|    260|        break;
  316|      0|    case BIO_CTRL_GET_CLOSE:
  ------------------
  |  |   92|      0|# define BIO_CTRL_GET_CLOSE      8/* man - set the 'close' on free */
  ------------------
  |  Branch (316:5): [True: 0, False: 435]
  ------------------
  317|      0|        ret = (long)b->shutdown;
  318|      0|        break;
  319|      0|    case BIO_CTRL_SET_CLOSE:
  ------------------
  |  |   93|      0|# define BIO_CTRL_SET_CLOSE      9/* man - set the 'close' on free */
  ------------------
  |  Branch (319:5): [True: 0, False: 435]
  ------------------
  320|      0|        b->shutdown = (int)num;
  321|      0|        break;
  322|      0|    case BIO_CTRL_WPENDING:
  ------------------
  |  |   97|      0|# define BIO_CTRL_WPENDING       13/* opt - number of bytes still to write */
  ------------------
  |  Branch (322:5): [True: 0, False: 435]
  ------------------
  323|      0|        ret = 0L;
  324|      0|        break;
  325|      0|    case BIO_CTRL_PENDING:
  ------------------
  |  |   94|      0|# define BIO_CTRL_PENDING        10/* opt - is their more data buffered */
  ------------------
  |  Branch (325:5): [True: 0, False: 435]
  ------------------
  326|      0|        ret = (long)bm->length;
  327|      0|        break;
  328|      0|    case BIO_CTRL_DUP:
  ------------------
  |  |   96|      0|# define BIO_CTRL_DUP            12/* man - extra stuff for 'duped' BIO */
  ------------------
  |  Branch (328:5): [True: 0, False: 435]
  ------------------
  329|      0|    case BIO_CTRL_FLUSH:
  ------------------
  |  |   95|      0|# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */
  ------------------
  |  Branch (329:5): [True: 0, False: 435]
  ------------------
  330|      0|        ret = 1;
  331|      0|        break;
  332|      0|    case BIO_CTRL_PUSH:
  ------------------
  |  |   90|      0|# define BIO_CTRL_PUSH           6/* opt - internal, used to signify change */
  ------------------
  |  Branch (332:5): [True: 0, False: 435]
  ------------------
  333|      0|    case BIO_CTRL_POP:
  ------------------
  |  |   91|      0|# define BIO_CTRL_POP            7/* opt - internal, used to signify change */
  ------------------
  |  Branch (333:5): [True: 0, False: 435]
  ------------------
  334|      0|    default:
  ------------------
  |  Branch (334:5): [True: 0, False: 435]
  ------------------
  335|      0|        ret = 0;
  336|      0|        break;
  337|    435|    }
  338|    435|    return ret;
  339|    435|}
bss_mem.c:mem_buf_free:
  158|  3.71k|{
  159|  3.71k|    if (a == NULL)
  ------------------
  |  Branch (159:9): [True: 0, False: 3.71k]
  ------------------
  160|      0|        return 0;
  161|       |
  162|  3.71k|    if (a->shutdown && a->init && a->ptr != NULL) {
  ------------------
  |  Branch (162:9): [True: 3.71k, False: 0]
  |  Branch (162:24): [True: 3.71k, False: 0]
  |  Branch (162:35): [True: 3.71k, False: 0]
  ------------------
  163|  3.71k|        BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;
  164|  3.71k|        BUF_MEM *b = bb->buf;
  165|       |
  166|  3.71k|        if (a->flags & BIO_FLAGS_MEM_RDONLY)
  ------------------
  |  |  233|  3.71k|# define BIO_FLAGS_MEM_RDONLY    0x200
  ------------------
  |  Branch (166:13): [True: 0, False: 3.71k]
  ------------------
  167|      0|            b->data = NULL;
  168|  3.71k|        BUF_MEM_free(b);
  169|  3.71k|    }
  170|  3.71k|    return 1;
  171|  3.71k|}
bss_mem.c:mem_new:
  133|  2.74k|{
  134|  2.74k|    return mem_init(bi, 0L);
  135|  2.74k|}
bss_mem.c:mem_init:
  110|  3.71k|{
  111|  3.71k|    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
  ------------------
  |  |   99|  3.71k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  112|       |
  113|  3.71k|    if (bb == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 3.71k]
  ------------------
  114|      0|        return 0;
  115|  3.71k|    if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 3.71k]
  ------------------
  116|      0|        OPENSSL_free(bb);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  117|      0|        return 0;
  118|      0|    }
  119|  3.71k|    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL) {
  ------------------
  |  |   99|  3.71k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (119:9): [True: 0, False: 3.71k]
  ------------------
  120|      0|        BUF_MEM_free(bb->buf);
  121|      0|        OPENSSL_free(bb);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  122|      0|        return 0;
  123|      0|    }
  124|  3.71k|    *bb->readp = *bb->buf;
  125|  3.71k|    bi->shutdown = 1;
  126|  3.71k|    bi->init = 1;
  127|  3.71k|    bi->num = -1;
  128|  3.71k|    bi->ptr = (char *)bb;
  129|  3.71k|    return 1;
  130|  3.71k|}
bss_mem.c:mem_free:
  143|  3.71k|{
  144|  3.71k|    BIO_BUF_MEM *bb;
  145|       |
  146|  3.71k|    if (a == NULL)
  ------------------
  |  Branch (146:9): [True: 0, False: 3.71k]
  ------------------
  147|      0|        return 0;
  148|       |
  149|  3.71k|    bb = (BIO_BUF_MEM *)a->ptr;
  150|  3.71k|    if (!mem_buf_free(a))
  ------------------
  |  Branch (150:9): [True: 0, False: 3.71k]
  ------------------
  151|      0|        return 0;
  152|  3.71k|    OPENSSL_free(bb->readp);
  ------------------
  |  |  107|  3.71k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  153|  3.71k|    OPENSSL_free(bb);
  ------------------
  |  |  107|  3.71k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  154|  3.71k|    return 1;
  155|  3.71k|}
bss_mem.c:secmem_new:
  138|    972|{
  139|    972|    return mem_init(bi, BUF_MEM_FLAG_SECURE);
  ------------------
  |  |   49|    972|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  140|    972|}

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

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

BUF_MEM_new_ex:
   22|  3.71k|{
   23|  3.71k|    BUF_MEM *ret;
   24|       |
   25|  3.71k|    ret = BUF_MEM_new();
   26|  3.71k|    if (ret != NULL)
  ------------------
  |  Branch (26:9): [True: 3.71k, False: 0]
  ------------------
   27|  3.71k|        ret->flags = flags;
   28|  3.71k|    return ret;
   29|  3.71k|}
BUF_MEM_new:
   32|  3.71k|{
   33|  3.71k|    BUF_MEM *ret;
   34|       |
   35|  3.71k|    ret = OPENSSL_zalloc(sizeof(*ret));
  ------------------
  |  |   99|  3.71k|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   36|  3.71k|    if (ret == NULL)
  ------------------
  |  Branch (36:9): [True: 0, False: 3.71k]
  ------------------
   37|      0|        return NULL;
   38|  3.71k|    return ret;
   39|  3.71k|}
BUF_MEM_free:
   42|  3.71k|{
   43|  3.71k|    if (a == NULL)
  ------------------
  |  Branch (43:9): [True: 0, False: 3.71k]
  ------------------
   44|      0|        return;
   45|  3.71k|    if (a->data != NULL) {
  ------------------
  |  Branch (45:9): [True: 1.94k, False: 1.77k]
  ------------------
   46|  1.94k|        if (a->flags & BUF_MEM_FLAG_SECURE)
  ------------------
  |  |   49|  1.94k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (46:13): [True: 230, False: 1.71k]
  ------------------
   47|    230|            OPENSSL_secure_clear_free(a->data, a->max);
  ------------------
  |  |  121|    230|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    230|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    230|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|  1.71k|        else
   49|  1.71k|            OPENSSL_clear_free(a->data, a->max);
  ------------------
  |  |  105|  1.71k|        CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   50|  1.94k|    }
   51|  3.71k|    OPENSSL_free(a);
  ------------------
  |  |  107|  3.71k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   52|  3.71k|}
BUF_MEM_grow_clean:
  108|   368k|{
  109|   368k|    char *ret;
  110|   368k|    size_t n;
  111|       |
  112|   368k|    if (str->length >= len) {
  ------------------
  |  Branch (112:9): [True: 0, False: 368k]
  ------------------
  113|      0|        if (str->data != NULL)
  ------------------
  |  Branch (113:13): [True: 0, False: 0]
  ------------------
  114|      0|            memset(&str->data[len], 0, str->length - len);
  115|      0|        str->length = len;
  116|      0|        return len;
  117|      0|    }
  118|   368k|    if (str->max >= len) {
  ------------------
  |  Branch (118:9): [True: 363k, False: 5.26k]
  ------------------
  119|   363k|        memset(&str->data[str->length], 0, len - str->length);
  120|   363k|        str->length = len;
  121|   363k|        return len;
  122|   363k|    }
  123|       |    /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
  124|  5.26k|    if (len > LIMIT_BEFORE_EXPANSION) {
  ------------------
  |  |   19|  5.26k|#define LIMIT_BEFORE_EXPANSION 0x5ffffffc
  ------------------
  |  Branch (124:9): [True: 0, False: 5.26k]
  ------------------
  125|      0|        ERR_raise(ERR_LIB_BUF, 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  126|      0|        return 0;
  127|      0|    }
  128|  5.26k|    n = (len + 3) / 3 * 4;
  129|  5.26k|    if ((str->flags & BUF_MEM_FLAG_SECURE))
  ------------------
  |  |   49|  5.26k|# define BUF_MEM_FLAG_SECURE  0x01
  ------------------
  |  Branch (129:9): [True: 1.13k, False: 4.13k]
  ------------------
  130|  1.13k|        ret = sec_alloc_realloc(str, n);
  131|  4.13k|    else
  132|  4.13k|        ret = OPENSSL_clear_realloc(str->data, str->max, n);
  ------------------
  |  |  103|  4.13k|        CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  4.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  4.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  133|  5.26k|    if (ret == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 5.26k]
  ------------------
  134|      0|        len = 0;
  135|  5.26k|    } else {
  136|  5.26k|        str->data = ret;
  137|  5.26k|        str->max = n;
  138|  5.26k|        memset(&str->data[str->length], 0, len - str->length);
  139|  5.26k|        str->length = len;
  140|  5.26k|    }
  141|  5.26k|    return len;
  142|  5.26k|}
buffer.c:sec_alloc_realloc:
   57|  1.13k|{
   58|  1.13k|    char *ret;
   59|       |
   60|  1.13k|    ret = OPENSSL_secure_malloc(len);
  ------------------
  |  |  115|  1.13k|        CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.13k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.13k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|  1.13k|    if (str->data != NULL) {
  ------------------
  |  Branch (61:9): [True: 901, False: 230]
  ------------------
   62|    901|        if (ret != NULL) {
  ------------------
  |  Branch (62:13): [True: 901, False: 0]
  ------------------
   63|    901|            memcpy(ret, str->data, str->length);
   64|    901|            OPENSSL_secure_clear_free(str->data, str->length);
  ------------------
  |  |  121|    901|        CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    901|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    901|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   65|    901|            str->data = NULL;
   66|    901|        }
   67|    901|    }
   68|  1.13k|    return ret;
   69|  1.13k|}

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

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

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

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

ossl_comp_zlib_cleanup:
  336|      2|{
  337|       |#ifdef ZLIB_SHARED
  338|       |    DSO_free(zlib_dso);
  339|       |    zlib_dso = NULL;
  340|       |#endif
  341|      2|}

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

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

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

CONF_modules_unload:
  482|      2|{
  483|      2|    int i;
  484|      2|    CONF_MODULE *md;
  485|       |
  486|      2|    if (!conf_modules_finish_int()) /* also inits module list lock */
  ------------------
  |  Branch (486:9): [True: 0, False: 2]
  ------------------
  487|      0|        return;
  488|       |
  489|      2|    if (!CRYPTO_THREAD_write_lock(module_list_lock))
  ------------------
  |  Branch (489:9): [True: 0, False: 2]
  ------------------
  490|      0|        return;
  491|       |
  492|       |    /* unload modules in reverse order */
  493|      2|    for (i = sk_CONF_MODULE_num(supported_modules) - 1; i >= 0; i--) {
  ------------------
  |  Branch (493:57): [True: 0, False: 2]
  ------------------
  494|      0|        md = sk_CONF_MODULE_value(supported_modules, i);
  495|       |        /* If static or in use and 'all' not set ignore it */
  496|      0|        if (((md->links > 0) || !md->dso) && !all)
  ------------------
  |  Branch (496:14): [True: 0, False: 0]
  |  Branch (496:33): [True: 0, False: 0]
  |  Branch (496:46): [True: 0, False: 0]
  ------------------
  497|      0|            continue;
  498|       |        /* Since we're working in reverse this is OK */
  499|      0|        (void)sk_CONF_MODULE_delete(supported_modules, i);
  500|      0|        module_free(md);
  501|      0|    }
  502|       |
  503|      2|    if (sk_CONF_MODULE_num(supported_modules) == 0) {
  ------------------
  |  Branch (503:9): [True: 0, False: 2]
  ------------------
  504|      0|        sk_CONF_MODULE_free(supported_modules);
  505|      0|        supported_modules = NULL;
  506|      0|    }
  507|       |
  508|      2|    CRYPTO_THREAD_unlock(module_list_lock);
  509|      2|}
ossl_config_modules_free:
  576|      2|{
  577|      2|    CONF_modules_unload(1); /* calls CONF_modules_finish */
  578|      2|    module_lists_free();
  579|      2|}
conf_mod.c:do_init_module_list_lock:
  100|      2|{
  101|      2|    module_list_lock = CRYPTO_THREAD_lock_new();
  102|      2|    if (module_list_lock == NULL) {
  ------------------
  |  Branch (102:9): [True: 0, False: 2]
  ------------------
  103|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  104|      0|        return 0;
  105|      0|    }
  106|       |
  107|      2|    return 1;
  108|      2|}
conf_mod.c:conf_modules_finish_int:
  522|      2|{
  523|      2|    CONF_IMODULE *imod;
  524|       |
  525|      2|    if (!RUN_ONCE(&init_module_list_lock, do_init_module_list_lock))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (525:9): [True: 0, False: 2]
  ------------------
  526|      0|        return 0;
  527|       |
  528|       |    /* If module_list_lock is NULL here it means we were already unloaded */
  529|      2|    if (module_list_lock == NULL
  ------------------
  |  Branch (529:9): [True: 0, False: 2]
  ------------------
  530|      2|        || !CRYPTO_THREAD_write_lock(module_list_lock))
  ------------------
  |  Branch (530:12): [True: 0, False: 2]
  ------------------
  531|      0|        return 0;
  532|       |
  533|      2|    while (sk_CONF_IMODULE_num(initialized_modules) > 0) {
  ------------------
  |  Branch (533:12): [True: 0, False: 2]
  ------------------
  534|      0|        imod = sk_CONF_IMODULE_pop(initialized_modules);
  535|      0|        module_finish(imod);
  536|      0|    }
  537|      2|    sk_CONF_IMODULE_free(initialized_modules);
  538|      2|    initialized_modules = NULL;
  539|       |
  540|      2|    CRYPTO_THREAD_unlock(module_list_lock);
  541|       |
  542|      2|    return 1;
  543|      2|}
conf_mod.c:module_lists_free:
   88|      2|{
   89|      2|    CRYPTO_THREAD_lock_free(module_list_lock);
   90|      2|    module_list_lock = NULL;
   91|       |
   92|      2|    sk_CONF_MODULE_free(supported_modules);
   93|      2|    supported_modules = NULL;
   94|       |
   95|      2|    sk_CONF_IMODULE_free(initialized_modules);
   96|      2|    initialized_modules = NULL;
   97|      2|}

ossl_lib_ctx_default_deinit:
  387|      2|{
  388|      2|    if (!default_context_inited)
  ------------------
  |  Branch (388:9): [True: 0, False: 2]
  ------------------
  389|      0|        return;
  390|      2|    context_deinit(&default_context_int);
  391|      2|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  392|      2|    default_context_inited = 0;
  393|      2|}
ossl_lib_ctx_get_concrete:
  518|  7.45k|{
  519|  7.45k|#ifndef FIPS_MODULE
  520|  7.45k|    if (ctx == NULL)
  ------------------
  |  Branch (520:9): [True: 7.43k, False: 20]
  ------------------
  521|  7.43k|        return get_default_context();
  522|     20|#endif
  523|     20|    return ctx;
  524|  7.45k|}
ossl_lib_ctx_get_data:
  545|     16|{
  546|     16|    void *p;
  547|       |
  548|     16|    ctx = ossl_lib_ctx_get_concrete(ctx);
  549|     16|    if (ctx == NULL)
  ------------------
  |  Branch (549:9): [True: 0, False: 16]
  ------------------
  550|      0|        return NULL;
  551|       |
  552|     16|    switch (index) {
  553|     16|    case OSSL_LIB_CTX_PROPERTY_STRING_INDEX:
  ------------------
  |  |  101|     16|# define OSSL_LIB_CTX_PROPERTY_STRING_INDEX          3
  ------------------
  |  Branch (553:5): [True: 16, False: 0]
  ------------------
  554|     16|        return ctx->property_string_data;
  555|      0|    case OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX:
  ------------------
  |  |   98|      0|# define OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX         0
  ------------------
  |  Branch (555:5): [True: 0, False: 16]
  ------------------
  556|      0|        return ctx->evp_method_store;
  557|      0|    case OSSL_LIB_CTX_PROVIDER_STORE_INDEX:
  ------------------
  |  |   99|      0|# define OSSL_LIB_CTX_PROVIDER_STORE_INDEX           1
  ------------------
  |  Branch (557:5): [True: 0, False: 16]
  ------------------
  558|      0|        return ctx->provider_store;
  559|      0|    case OSSL_LIB_CTX_NAMEMAP_INDEX:
  ------------------
  |  |  102|      0|# define OSSL_LIB_CTX_NAMEMAP_INDEX                  4
  ------------------
  |  Branch (559:5): [True: 0, False: 16]
  ------------------
  560|      0|        return ctx->namemap;
  561|      0|    case OSSL_LIB_CTX_PROPERTY_DEFN_INDEX:
  ------------------
  |  |  100|      0|# define OSSL_LIB_CTX_PROPERTY_DEFN_INDEX            2
  ------------------
  |  Branch (561:5): [True: 0, False: 16]
  ------------------
  562|      0|        return ctx->property_defns;
  563|      0|    case OSSL_LIB_CTX_GLOBAL_PROPERTIES:
  ------------------
  |  |  114|      0|# define OSSL_LIB_CTX_GLOBAL_PROPERTIES             14
  ------------------
  |  Branch (563:5): [True: 0, False: 16]
  ------------------
  564|      0|        return ctx->global_properties;
  565|      0|    case OSSL_LIB_CTX_DRBG_INDEX:
  ------------------
  |  |  103|      0|# define OSSL_LIB_CTX_DRBG_INDEX                     5
  ------------------
  |  Branch (565:5): [True: 0, False: 16]
  ------------------
  566|      0|        return ctx->drbg;
  567|      0|    case OSSL_LIB_CTX_DRBG_NONCE_INDEX:
  ------------------
  |  |  104|      0|# define OSSL_LIB_CTX_DRBG_NONCE_INDEX               6
  ------------------
  |  Branch (567:5): [True: 0, False: 16]
  ------------------
  568|      0|        return ctx->drbg_nonce;
  569|      0|#ifndef FIPS_MODULE
  570|      0|    case OSSL_LIB_CTX_PROVIDER_CONF_INDEX:
  ------------------
  |  |  116|      0|# define OSSL_LIB_CTX_PROVIDER_CONF_INDEX           16
  ------------------
  |  Branch (570:5): [True: 0, False: 16]
  ------------------
  571|      0|        return ctx->provider_conf;
  572|      0|    case OSSL_LIB_CTX_BIO_CORE_INDEX:
  ------------------
  |  |  117|      0|# define OSSL_LIB_CTX_BIO_CORE_INDEX                17
  ------------------
  |  Branch (572:5): [True: 0, False: 16]
  ------------------
  573|      0|        return ctx->bio_core;
  574|      0|    case OSSL_LIB_CTX_CHILD_PROVIDER_INDEX:
  ------------------
  |  |  118|      0|# define OSSL_LIB_CTX_CHILD_PROVIDER_INDEX          18
  ------------------
  |  Branch (574:5): [True: 0, False: 16]
  ------------------
  575|      0|        return ctx->child_provider;
  576|      0|    case OSSL_LIB_CTX_DECODER_STORE_INDEX:
  ------------------
  |  |  111|      0|# define OSSL_LIB_CTX_DECODER_STORE_INDEX           11
  ------------------
  |  Branch (576:5): [True: 0, False: 16]
  ------------------
  577|      0|        return ctx->decoder_store;
  578|      0|    case OSSL_LIB_CTX_DECODER_CACHE_INDEX:
  ------------------
  |  |  120|      0|# define OSSL_LIB_CTX_DECODER_CACHE_INDEX           20
  ------------------
  |  Branch (578:5): [True: 0, False: 16]
  ------------------
  579|      0|        return ctx->decoder_cache;
  580|      0|    case OSSL_LIB_CTX_ENCODER_STORE_INDEX:
  ------------------
  |  |  110|      0|# define OSSL_LIB_CTX_ENCODER_STORE_INDEX           10
  ------------------
  |  Branch (580:5): [True: 0, False: 16]
  ------------------
  581|      0|        return ctx->encoder_store;
  582|      0|    case OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX:
  ------------------
  |  |  115|      0|# define OSSL_LIB_CTX_STORE_LOADER_STORE_INDEX      15
  ------------------
  |  Branch (582:5): [True: 0, False: 16]
  ------------------
  583|      0|        return ctx->store_loader_store;
  584|      0|    case OSSL_LIB_CTX_SELF_TEST_CB_INDEX:
  ------------------
  |  |  112|      0|# define OSSL_LIB_CTX_SELF_TEST_CB_INDEX            12
  ------------------
  |  Branch (584:5): [True: 0, False: 16]
  ------------------
  585|      0|        return ctx->self_test_cb;
  586|      0|#endif
  587|      0|#ifndef OPENSSL_NO_THREAD_POOL
  588|      0|    case OSSL_LIB_CTX_THREAD_INDEX:
  ------------------
  |  |  119|      0|# define OSSL_LIB_CTX_THREAD_INDEX                  19
  ------------------
  |  Branch (588:5): [True: 0, False: 16]
  ------------------
  589|      0|        return ctx->threads;
  590|      0|#endif
  591|       |
  592|      0|    case OSSL_LIB_CTX_RAND_CRNGT_INDEX: {
  ------------------
  |  |  105|      0|# define OSSL_LIB_CTX_RAND_CRNGT_INDEX               7
  ------------------
  |  Branch (592:5): [True: 0, False: 16]
  ------------------
  593|       |
  594|       |        /*
  595|       |         * rand_crngt must be lazily initialized because it calls into
  596|       |         * libctx, so must not be called from context_init, else a deadlock
  597|       |         * will occur.
  598|       |         *
  599|       |         * We use a separate lock because code called by the instantiation
  600|       |         * of rand_crngt is liable to try and take the libctx lock.
  601|       |         */
  602|      0|        if (CRYPTO_THREAD_read_lock(ctx->rand_crngt_lock) != 1)
  ------------------
  |  Branch (602:13): [True: 0, False: 0]
  ------------------
  603|      0|            return NULL;
  604|       |
  605|      0|        if (ctx->rand_crngt == NULL) {
  ------------------
  |  Branch (605:13): [True: 0, False: 0]
  ------------------
  606|      0|            CRYPTO_THREAD_unlock(ctx->rand_crngt_lock);
  607|       |
  608|      0|            if (CRYPTO_THREAD_write_lock(ctx->rand_crngt_lock) != 1)
  ------------------
  |  Branch (608:17): [True: 0, False: 0]
  ------------------
  609|      0|                return NULL;
  610|       |
  611|      0|            if (ctx->rand_crngt == NULL)
  ------------------
  |  Branch (611:17): [True: 0, False: 0]
  ------------------
  612|      0|                ctx->rand_crngt = ossl_rand_crng_ctx_new(ctx);
  613|      0|        }
  614|       |
  615|      0|        p = ctx->rand_crngt;
  616|       |
  617|      0|        CRYPTO_THREAD_unlock(ctx->rand_crngt_lock);
  618|       |
  619|      0|        return p;
  620|      0|    }
  621|       |
  622|       |#ifdef FIPS_MODULE
  623|       |    case OSSL_LIB_CTX_THREAD_EVENT_HANDLER_INDEX:
  624|       |        return ctx->thread_event_handler;
  625|       |
  626|       |    case OSSL_LIB_CTX_FIPS_PROV_INDEX:
  627|       |        return ctx->fips_prov;
  628|       |#endif
  629|       |
  630|      0|    default:
  ------------------
  |  Branch (630:5): [True: 0, False: 16]
  ------------------
  631|      0|        return NULL;
  632|     16|    }
  633|     16|}
ossl_lib_ctx_get_ex_data_global:
  636|  7.43k|{
  637|  7.43k|    ctx = ossl_lib_ctx_get_concrete(ctx);
  638|  7.43k|    if (ctx == NULL)
  ------------------
  |  Branch (638:9): [True: 0, False: 7.43k]
  ------------------
  639|      0|        return NULL;
  640|  7.43k|    return &ctx->global;
  641|  7.43k|}
context.c:context_deinit:
  344|      2|{
  345|      2|    if (ctx == NULL)
  ------------------
  |  Branch (345:9): [True: 0, False: 2]
  ------------------
  346|      0|        return 1;
  347|       |
  348|      2|    ossl_ctx_thread_stop(ctx);
  349|       |
  350|      2|    context_deinit_objs(ctx);
  351|       |
  352|      2|    ossl_crypto_cleanup_all_ex_data_int(ctx);
  353|       |
  354|      2|    CRYPTO_THREAD_lock_free(ctx->rand_crngt_lock);
  355|      2|    CRYPTO_THREAD_lock_free(ctx->lock);
  356|      2|    ctx->rand_crngt_lock = NULL;
  357|      2|    ctx->lock = NULL;
  358|      2|    return 1;
  359|      2|}
context.c:context_deinit_objs:
  217|      2|{
  218|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
  219|      2|    if (ctx->evp_method_store != NULL) {
  ------------------
  |  Branch (219:9): [True: 2, False: 0]
  ------------------
  220|      2|        ossl_method_store_free(ctx->evp_method_store);
  221|      2|        ctx->evp_method_store = NULL;
  222|      2|    }
  223|       |
  224|       |    /* P2. */
  225|      2|    if (ctx->drbg != NULL) {
  ------------------
  |  Branch (225:9): [True: 2, False: 0]
  ------------------
  226|      2|        ossl_rand_ctx_free(ctx->drbg);
  227|      2|        ctx->drbg = NULL;
  228|      2|    }
  229|       |
  230|      2|#ifndef FIPS_MODULE
  231|       |    /* P2. */
  232|      2|    if (ctx->provider_conf != NULL) {
  ------------------
  |  Branch (232:9): [True: 2, False: 0]
  ------------------
  233|      2|        ossl_prov_conf_ctx_free(ctx->provider_conf);
  234|      2|        ctx->provider_conf = NULL;
  235|      2|    }
  236|       |
  237|       |    /*
  238|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  239|       |     * provider store
  240|       |     */
  241|      2|    if (ctx->decoder_store != NULL) {
  ------------------
  |  Branch (241:9): [True: 2, False: 0]
  ------------------
  242|      2|        ossl_method_store_free(ctx->decoder_store);
  243|      2|        ctx->decoder_store = NULL;
  244|      2|    }
  245|      2|    if (ctx->decoder_cache != NULL) {
  ------------------
  |  Branch (245:9): [True: 2, False: 0]
  ------------------
  246|      2|        ossl_decoder_cache_free(ctx->decoder_cache);
  247|      2|        ctx->decoder_cache = NULL;
  248|      2|    }
  249|       |
  250|       |
  251|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  252|      2|    if (ctx->encoder_store != NULL) {
  ------------------
  |  Branch (252:9): [True: 2, False: 0]
  ------------------
  253|      2|        ossl_method_store_free(ctx->encoder_store);
  254|      2|        ctx->encoder_store = NULL;
  255|      2|    }
  256|       |
  257|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  258|      2|    if (ctx->store_loader_store != NULL) {
  ------------------
  |  Branch (258:9): [True: 2, False: 0]
  ------------------
  259|      2|        ossl_method_store_free(ctx->store_loader_store);
  260|      2|        ctx->store_loader_store = NULL;
  261|      2|    }
  262|      2|#endif
  263|       |
  264|       |    /* P1. Needs to be freed before the child provider data is freed */
  265|      2|    if (ctx->provider_store != NULL) {
  ------------------
  |  Branch (265:9): [True: 2, False: 0]
  ------------------
  266|      2|        ossl_provider_store_free(ctx->provider_store);
  267|      2|        ctx->provider_store = NULL;
  268|      2|    }
  269|       |
  270|       |    /* Default priority. */
  271|      2|    if (ctx->property_string_data != NULL) {
  ------------------
  |  Branch (271:9): [True: 2, False: 0]
  ------------------
  272|      2|        ossl_property_string_data_free(ctx->property_string_data);
  273|      2|        ctx->property_string_data = NULL;
  274|      2|    }
  275|       |
  276|      2|    if (ctx->namemap != NULL) {
  ------------------
  |  Branch (276:9): [True: 2, False: 0]
  ------------------
  277|      2|        ossl_stored_namemap_free(ctx->namemap);
  278|      2|        ctx->namemap = NULL;
  279|      2|    }
  280|       |
  281|      2|    if (ctx->property_defns != NULL) {
  ------------------
  |  Branch (281:9): [True: 2, False: 0]
  ------------------
  282|      2|        ossl_property_defns_free(ctx->property_defns);
  283|      2|        ctx->property_defns = NULL;
  284|      2|    }
  285|       |
  286|      2|    if (ctx->global_properties != NULL) {
  ------------------
  |  Branch (286:9): [True: 2, False: 0]
  ------------------
  287|      2|        ossl_ctx_global_properties_free(ctx->global_properties);
  288|      2|        ctx->global_properties = NULL;
  289|      2|    }
  290|       |
  291|      2|#ifndef FIPS_MODULE
  292|      2|    if (ctx->bio_core != NULL) {
  ------------------
  |  Branch (292:9): [True: 2, False: 0]
  ------------------
  293|      2|        ossl_bio_core_globals_free(ctx->bio_core);
  294|      2|        ctx->bio_core = NULL;
  295|      2|    }
  296|      2|#endif
  297|       |
  298|      2|    if (ctx->drbg_nonce != NULL) {
  ------------------
  |  Branch (298:9): [True: 2, False: 0]
  ------------------
  299|      2|        ossl_prov_drbg_nonce_ctx_free(ctx->drbg_nonce);
  300|      2|        ctx->drbg_nonce = NULL;
  301|      2|    }
  302|       |
  303|      2|#ifndef FIPS_MODULE
  304|      2|    if (ctx->self_test_cb != NULL) {
  ------------------
  |  Branch (304:9): [True: 2, False: 0]
  ------------------
  305|      2|        ossl_self_test_set_callback_free(ctx->self_test_cb);
  306|      2|        ctx->self_test_cb = NULL;
  307|      2|    }
  308|      2|#endif
  309|       |
  310|      2|    if (ctx->rand_crngt != NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 2]
  ------------------
  311|      0|        ossl_rand_crng_ctx_free(ctx->rand_crngt);
  312|      0|        ctx->rand_crngt = NULL;
  313|      0|    }
  314|       |
  315|       |#ifdef FIPS_MODULE
  316|       |    if (ctx->thread_event_handler != NULL) {
  317|       |        ossl_thread_event_ctx_free(ctx->thread_event_handler);
  318|       |        ctx->thread_event_handler = NULL;
  319|       |    }
  320|       |
  321|       |    if (ctx->fips_prov != NULL) {
  322|       |        ossl_fips_prov_ossl_ctx_free(ctx->fips_prov);
  323|       |        ctx->fips_prov = NULL;
  324|       |    }
  325|       |#endif
  326|       |
  327|      2|#ifndef OPENSSL_NO_THREAD_POOL
  328|      2|    if (ctx->threads != NULL) {
  ------------------
  |  Branch (328:9): [True: 2, False: 0]
  ------------------
  329|      2|        ossl_threads_ctx_free(ctx->threads);
  330|      2|        ctx->threads = NULL;
  331|      2|    }
  332|      2|#endif
  333|       |
  334|       |    /* Low priority. */
  335|      2|#ifndef FIPS_MODULE
  336|      2|    if (ctx->child_provider != NULL) {
  ------------------
  |  Branch (336:9): [True: 2, False: 0]
  ------------------
  337|      2|        ossl_child_prov_ctx_free(ctx->child_provider);
  338|      2|        ctx->child_provider = NULL;
  339|      2|    }
  340|      2|#endif
  341|      2|}
context.c:context_init:
   81|      2|{
   82|      2|    int exdata_done = 0;
   83|       |
   84|      2|    ctx->lock = CRYPTO_THREAD_lock_new();
   85|      2|    if (ctx->lock == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 2]
  ------------------
   86|      0|        return 0;
   87|       |
   88|      2|    ctx->rand_crngt_lock = CRYPTO_THREAD_lock_new();
   89|      2|    if (ctx->rand_crngt_lock == NULL)
  ------------------
  |  Branch (89:9): [True: 0, False: 2]
  ------------------
   90|      0|        goto err;
   91|       |
   92|       |    /* Initialize ex_data. */
   93|      2|    if (!ossl_do_ex_data_init(ctx))
  ------------------
  |  Branch (93:9): [True: 0, False: 2]
  ------------------
   94|      0|        goto err;
   95|      2|    exdata_done = 1;
   96|       |
   97|       |    /* P2. We want evp_method_store to be cleaned up before the provider store */
   98|      2|    ctx->evp_method_store = ossl_method_store_new(ctx);
   99|      2|    if (ctx->evp_method_store == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 2]
  ------------------
  100|      0|        goto err;
  101|       |
  102|      2|#ifndef FIPS_MODULE
  103|       |    /* P2. Must be freed before the provider store is freed */
  104|      2|    ctx->provider_conf = ossl_prov_conf_ctx_new(ctx);
  105|      2|    if (ctx->provider_conf == NULL)
  ------------------
  |  Branch (105:9): [True: 0, False: 2]
  ------------------
  106|      0|        goto err;
  107|      2|#endif
  108|       |
  109|       |    /* P2. */
  110|      2|    ctx->drbg = ossl_rand_ctx_new(ctx);
  111|      2|    if (ctx->drbg == NULL)
  ------------------
  |  Branch (111:9): [True: 0, False: 2]
  ------------------
  112|      0|        goto err;
  113|       |
  114|      2|#ifndef FIPS_MODULE
  115|       |    /*
  116|       |     * P2. We want decoder_store/decoder_cache to be cleaned up before the
  117|       |     * provider store
  118|       |     */
  119|      2|    ctx->decoder_store = ossl_method_store_new(ctx);
  120|      2|    if (ctx->decoder_store == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        goto err;
  122|      2|    ctx->decoder_cache = ossl_decoder_cache_new(ctx);
  123|      2|    if (ctx->decoder_cache == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 2]
  ------------------
  124|      0|        goto err;
  125|       |
  126|       |    /* P2. We want encoder_store to be cleaned up before the provider store */
  127|      2|    ctx->encoder_store = ossl_method_store_new(ctx);
  128|      2|    if (ctx->encoder_store == NULL)
  ------------------
  |  Branch (128:9): [True: 0, False: 2]
  ------------------
  129|      0|        goto err;
  130|       |
  131|       |    /* P2. We want loader_store to be cleaned up before the provider store */
  132|      2|    ctx->store_loader_store = ossl_method_store_new(ctx);
  133|      2|    if (ctx->store_loader_store == NULL)
  ------------------
  |  Branch (133:9): [True: 0, False: 2]
  ------------------
  134|      0|        goto err;
  135|      2|#endif
  136|       |
  137|       |    /* P1. Needs to be freed before the child provider data is freed */
  138|      2|    ctx->provider_store = ossl_provider_store_new(ctx);
  139|      2|    if (ctx->provider_store == NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 2]
  ------------------
  140|      0|        goto err;
  141|       |
  142|       |    /* Default priority. */
  143|      2|    ctx->property_string_data = ossl_property_string_data_new(ctx);
  144|      2|    if (ctx->property_string_data == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 2]
  ------------------
  145|      0|        goto err;
  146|       |
  147|      2|    ctx->namemap = ossl_stored_namemap_new(ctx);
  148|      2|    if (ctx->namemap == NULL)
  ------------------
  |  Branch (148:9): [True: 0, False: 2]
  ------------------
  149|      0|        goto err;
  150|       |
  151|      2|    ctx->property_defns = ossl_property_defns_new(ctx);
  152|      2|    if (ctx->property_defns == NULL)
  ------------------
  |  Branch (152:9): [True: 0, False: 2]
  ------------------
  153|      0|        goto err;
  154|       |
  155|      2|    ctx->global_properties = ossl_ctx_global_properties_new(ctx);
  156|      2|    if (ctx->global_properties == NULL)
  ------------------
  |  Branch (156:9): [True: 0, False: 2]
  ------------------
  157|      0|        goto err;
  158|       |
  159|      2|#ifndef FIPS_MODULE
  160|      2|    ctx->bio_core = ossl_bio_core_globals_new(ctx);
  161|      2|    if (ctx->bio_core == NULL)
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  162|      0|        goto err;
  163|      2|#endif
  164|       |
  165|      2|    ctx->drbg_nonce = ossl_prov_drbg_nonce_ctx_new(ctx);
  166|      2|    if (ctx->drbg_nonce == NULL)
  ------------------
  |  Branch (166:9): [True: 0, False: 2]
  ------------------
  167|      0|        goto err;
  168|       |
  169|      2|#ifndef FIPS_MODULE
  170|      2|    ctx->self_test_cb = ossl_self_test_set_callback_new(ctx);
  171|      2|    if (ctx->self_test_cb == NULL)
  ------------------
  |  Branch (171:9): [True: 0, False: 2]
  ------------------
  172|      0|        goto err;
  173|      2|#endif
  174|       |
  175|       |#ifdef FIPS_MODULE
  176|       |    ctx->thread_event_handler = ossl_thread_event_ctx_new(ctx);
  177|       |    if (ctx->thread_event_handler == NULL)
  178|       |        goto err;
  179|       |
  180|       |    ctx->fips_prov = ossl_fips_prov_ossl_ctx_new(ctx);
  181|       |    if (ctx->fips_prov == NULL)
  182|       |        goto err;
  183|       |#endif
  184|       |
  185|      2|#ifndef OPENSSL_NO_THREAD_POOL
  186|      2|    ctx->threads = ossl_threads_ctx_new(ctx);
  187|      2|    if (ctx->threads == NULL)
  ------------------
  |  Branch (187:9): [True: 0, False: 2]
  ------------------
  188|      0|        goto err;
  189|      2|#endif
  190|       |
  191|       |    /* Low priority. */
  192|      2|#ifndef FIPS_MODULE
  193|      2|    ctx->child_provider = ossl_child_prov_ctx_new(ctx);
  194|      2|    if (ctx->child_provider == NULL)
  ------------------
  |  Branch (194:9): [True: 0, False: 2]
  ------------------
  195|      0|        goto err;
  196|      2|#endif
  197|       |
  198|       |    /* Everything depends on properties, so we also pre-initialise that */
  199|      2|    if (!ossl_property_parse_init(ctx))
  ------------------
  |  Branch (199:9): [True: 0, False: 2]
  ------------------
  200|      0|        goto err;
  201|       |
  202|      2|    return 1;
  203|       |
  204|      0| err:
  205|      0|    context_deinit_objs(ctx);
  206|       |
  207|      0|    if (exdata_done)
  ------------------
  |  Branch (207:9): [True: 0, False: 0]
  ------------------
  208|      0|        ossl_crypto_cleanup_all_ex_data_int(ctx);
  209|       |
  210|      0|    CRYPTO_THREAD_lock_free(ctx->rand_crngt_lock);
  211|      0|    CRYPTO_THREAD_lock_free(ctx->lock);
  212|      0|    memset(ctx, '\0', sizeof(*ctx));
  213|      0|    return 0;
  214|      2|}
context.c:default_context_do_init:
  370|      2|{
  371|      2|    if (!CRYPTO_THREAD_init_local(&default_context_thread_local, NULL))
  ------------------
  |  Branch (371:9): [True: 0, False: 2]
  ------------------
  372|      0|        goto err;
  373|       |
  374|      2|    if (!context_init(&default_context_int))
  ------------------
  |  Branch (374:9): [True: 0, False: 2]
  ------------------
  375|      0|        goto deinit_thread;
  376|       |
  377|      2|    default_context_inited = 1;
  378|      2|    return 1;
  379|       |
  380|      0|deinit_thread:
  381|      0|    CRYPTO_THREAD_cleanup_local(&default_context_thread_local);
  382|      0|err:
  383|      0|    return 0;
  384|      0|}
context.c:get_default_context:
  404|  7.43k|{
  405|  7.43k|    OSSL_LIB_CTX *current_defctx = get_thread_default_context();
  406|       |
  407|  7.43k|    if (current_defctx == NULL)
  ------------------
  |  Branch (407:9): [True: 7.43k, False: 0]
  ------------------
  408|  7.43k|        current_defctx = &default_context_int;
  409|  7.43k|    return current_defctx;
  410|  7.43k|}
context.c:get_thread_default_context:
  396|  7.43k|{
  397|  7.43k|    if (!RUN_ONCE(&default_context_init, default_context_do_init))
  ------------------
  |  |  130|  7.43k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 7.43k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (397:9): [True: 0, False: 7.43k]
  ------------------
  398|      0|        return NULL;
  399|       |
  400|  7.43k|    return CRYPTO_THREAD_get_local(&default_context_thread_local);
  401|  7.43k|}

ossl_stored_namemap_new:
   65|      2|{
   66|      2|    OSSL_NAMEMAP *namemap = ossl_namemap_new();
   67|       |
   68|      2|    if (namemap != NULL)
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        namemap->stored = 1;
   70|       |
   71|      2|    return namemap;
   72|      2|}
ossl_stored_namemap_free:
   75|      2|{
   76|      2|    OSSL_NAMEMAP *namemap = vnamemap;
   77|       |
   78|      2|    if (namemap != NULL) {
  ------------------
  |  Branch (78:9): [True: 2, False: 0]
  ------------------
   79|       |        /* Pretend it isn't stored, or ossl_namemap_free() will do nothing */
   80|      2|        namemap->stored = 0;
   81|      2|        ossl_namemap_free(namemap);
   82|      2|    }
   83|      2|}
ossl_namemap_new:
  512|      2|{
  513|      2|    OSSL_NAMEMAP *namemap;
  514|       |
  515|      2|    if ((namemap = OPENSSL_zalloc(sizeof(*namemap))) != NULL
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (515:9): [True: 2, False: 0]
  ------------------
  516|      2|        && (namemap->lock = CRYPTO_THREAD_lock_new()) != NULL
  ------------------
  |  Branch (516:12): [True: 2, False: 0]
  ------------------
  517|      2|        && (namemap->namenum =
  ------------------
  |  Branch (517:12): [True: 2, False: 0]
  ------------------
  518|      2|            lh_NAMENUM_ENTRY_new(namenum_hash, namenum_cmp)) != NULL)
  519|      2|        return namemap;
  520|       |
  521|      0|    ossl_namemap_free(namemap);
  522|      0|    return NULL;
  523|      2|}
ossl_namemap_free:
  526|      2|{
  527|      2|    if (namemap == NULL || namemap->stored)
  ------------------
  |  Branch (527:9): [True: 0, False: 2]
  |  Branch (527:28): [True: 0, False: 2]
  ------------------
  528|      0|        return;
  529|       |
  530|      2|    lh_NAMENUM_ENTRY_doall(namemap->namenum, namenum_free);
  531|      2|    lh_NAMENUM_ENTRY_free(namemap->namenum);
  532|       |
  533|      2|    CRYPTO_THREAD_lock_free(namemap->lock);
  534|      2|    OPENSSL_free(namemap);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  535|      2|}

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

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

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

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

ossl_ctype_check:
  253|  27.6M|{
  254|  27.6M|    const int max = sizeof(ctype_char_map) / sizeof(*ctype_char_map);
  255|  27.6M|    const int a = ossl_toascii(c);
  ------------------
  |  |   56|  27.6M|#  define ossl_toascii(c)       (c)
  ------------------
  256|       |
  257|  27.6M|    return a >= 0 && a < max && (ctype_char_map[a] & mask) != 0;
  ------------------
  |  Branch (257:12): [True: 25.5M, False: 2.07M]
  |  Branch (257:22): [True: 25.5M, False: 0]
  |  Branch (257:33): [True: 10.5M, False: 15.0M]
  ------------------
  258|  27.6M|}

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

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

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

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

ossl_decoder_cache_new:
  683|      2|{
  684|      2|    DECODER_CACHE *cache = OPENSSL_malloc(sizeof(*cache));
  ------------------
  |  |   97|      2|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  685|       |
  686|      2|    if (cache == NULL)
  ------------------
  |  Branch (686:9): [True: 0, False: 2]
  ------------------
  687|      0|        return NULL;
  688|       |
  689|      2|    cache->lock = CRYPTO_THREAD_lock_new();
  690|      2|    if (cache->lock == NULL) {
  ------------------
  |  Branch (690:9): [True: 0, False: 2]
  ------------------
  691|      0|        OPENSSL_free(cache);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  692|      0|        return NULL;
  693|      0|    }
  694|      2|    cache->hashtable = lh_DECODER_CACHE_ENTRY_new(decoder_cache_entry_hash,
  695|      2|                                                  decoder_cache_entry_cmp);
  696|      2|    if (cache->hashtable == NULL) {
  ------------------
  |  Branch (696:9): [True: 0, False: 2]
  ------------------
  697|      0|        CRYPTO_THREAD_lock_free(cache->lock);
  698|      0|        OPENSSL_free(cache);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  699|      0|        return NULL;
  700|      0|    }
  701|       |
  702|      2|    return cache;
  703|      2|}
ossl_decoder_cache_free:
  706|      2|{
  707|      2|    DECODER_CACHE *cache = (DECODER_CACHE *)vcache;
  708|       |
  709|      2|    lh_DECODER_CACHE_ENTRY_doall(cache->hashtable, decoder_cache_entry_free);
  710|      2|    lh_DECODER_CACHE_ENTRY_free(cache->hashtable);
  711|      2|    CRYPTO_THREAD_lock_free(cache->lock);
  712|      2|    OPENSSL_free(cache);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  713|      2|}

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

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

OSSL_ERR_STATE_free:
  202|      2|{
  203|      2|    int i;
  204|       |
  205|      2|    if (state == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 2]
  ------------------
  206|      0|        return;
  207|     34|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|     34|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (207:17): [True: 32, False: 2]
  ------------------
  208|     32|        err_clear(state, i, 1);
  209|     32|    }
  210|      2|    CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  ------------------
                  CRYPTO_free(state, OPENSSL_FILE, OPENSSL_LINE);
  ------------------
  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  ------------------
  211|      2|}
err_cleanup:
  233|      2|{
  234|      2|    if (set_err_thread_local != 0)
  ------------------
  |  Branch (234:9): [True: 2, False: 0]
  ------------------
  235|      2|        CRYPTO_THREAD_cleanup_local(&err_thread_local);
  236|      2|    CRYPTO_THREAD_lock_free(err_string_lock);
  237|      2|    err_string_lock = NULL;
  238|      2|#ifndef OPENSSL_NO_ERR
  239|      2|    lh_ERR_STRING_DATA_free(int_error_hash);
  ------------------
  |  |  376|      2|#define lh_ERR_STRING_DATA_free(lh) OPENSSL_LH_free(ossl_check_ERR_STRING_DATA_lh_type(lh))
  ------------------
  240|      2|    int_error_hash = NULL;
  241|      2|#endif
  242|      2|}
ossl_err_load_ERR_strings:
  272|     70|{
  273|     70|#ifndef OPENSSL_NO_ERR
  274|     70|    if (!RUN_ONCE(&err_string_init, do_err_strings_init))
  ------------------
  |  |  130|     70|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 70, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 70]
  ------------------
  275|      0|        return 0;
  276|       |
  277|     70|    err_load_strings(ERR_str_libraries);
  278|     70|    err_load_strings(ERR_str_reasons);
  279|     70|#endif
  280|     70|    return 1;
  281|     70|}
ERR_load_strings_const:
  297|     68|{
  298|     68|#ifndef OPENSSL_NO_ERR
  299|     68|    if (ossl_err_load_ERR_strings() == 0)
  ------------------
  |  Branch (299:9): [True: 0, False: 68]
  ------------------
  300|      0|        return 0;
  301|     68|    err_load_strings(str);
  302|     68|#endif
  303|       |
  304|     68|    return 1;
  305|     68|}
ERR_clear_error:
  335|  1.24k|{
  336|  1.24k|    int i;
  337|  1.24k|    ERR_STATE *es;
  338|       |
  339|  1.24k|    es = ossl_err_get_state_int();
  340|  1.24k|    if (es == NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 1.24k]
  ------------------
  341|      0|        return;
  342|       |
  343|  21.1k|    for (i = 0; i < ERR_NUM_ERRORS; i++) {
  ------------------
  |  |   55|  21.1k|#  define ERR_NUM_ERRORS  16
  ------------------
  |  Branch (343:17): [True: 19.8k, False: 1.24k]
  ------------------
  344|  19.8k|        err_clear(es, i, 0);
  345|  19.8k|    }
  346|  1.24k|    es->top = es->bottom = 0;
  347|  1.24k|}
ERR_reason_error_string:
  613|     68|{
  614|     68|#ifndef OPENSSL_NO_ERR
  615|     68|    ERR_STRING_DATA d, *p = NULL;
  616|     68|    unsigned long l, r;
  617|       |
  618|     68|    if (!RUN_ONCE(&err_string_init, do_err_strings_init)) {
  ------------------
  |  |  130|     68|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 68, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (618:9): [True: 0, False: 68]
  ------------------
  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|     68|    if (ERR_SYSTEM_ERROR(e))
  ------------------
  |  |  239|     68|# define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
  |  |  ------------------
  |  |  |  |  218|     68|# define ERR_SYSTEM_FLAG                ((unsigned int)INT_MAX + 1)
  |  |  ------------------
  |  |  |  Branch (239:41): [True: 0, False: 68]
  |  |  ------------------
  ------------------
  628|      0|        return NULL;
  629|       |
  630|     68|    l = ERR_GET_LIB(e);
  631|     68|    r = ERR_GET_REASON(e);
  632|     68|    d.error = ERR_PACK(l, 0, r);
  ------------------
  |  |  279|     68|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     68|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     68|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     68|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  633|     68|    p = int_err_get_item(&d);
  634|     68|    if (p == NULL) {
  ------------------
  |  Branch (634:9): [True: 68, False: 0]
  ------------------
  635|     68|        d.error = ERR_PACK(0, 0, r);
  ------------------
  |  |  279|     68|    ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  227|     68|# define ERR_LIB_MASK                   0xFF
  |  |  ------------------
  |  |                   ( (((unsigned long)(lib)    & ERR_LIB_MASK   ) << ERR_LIB_OFFSET) | \
  |  |  ------------------
  |  |  |  |  226|     68|# define ERR_LIB_OFFSET                 23L
  |  |  ------------------
  |  |  280|     68|      (((unsigned long)(reason) & ERR_REASON_MASK)) )
  |  |  ------------------
  |  |  |  |  230|     68|# define ERR_REASON_MASK                0X7FFFFF
  |  |  ------------------
  ------------------
  636|     68|        p = int_err_get_item(&d);
  637|     68|    }
  638|     68|    return ((p == NULL) ? NULL : p->string);
  ------------------
  |  Branch (638:13): [True: 68, False: 0]
  ------------------
  639|       |#else
  640|       |    return NULL;
  641|       |#endif
  642|     68|}
ossl_err_get_state_int:
  673|  4.40k|{
  674|  4.40k|    ERR_STATE *state;
  675|  4.40k|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|  4.40k|# define get_last_sys_error()    errno
  ------------------
  676|       |
  677|  4.40k|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|  4.40k|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (677:9): [True: 0, False: 4.40k]
  ------------------
  678|      0|        return NULL;
  679|       |
  680|  4.40k|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|  4.40k|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 4.40k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:9): [True: 0, False: 4.40k]
  ------------------
  681|      0|        return NULL;
  682|       |
  683|  4.40k|    state = CRYPTO_THREAD_get_local(&err_thread_local);
  684|  4.40k|    if (state == (ERR_STATE*)-1)
  ------------------
  |  Branch (684:9): [True: 0, False: 4.40k]
  ------------------
  685|      0|        return NULL;
  686|       |
  687|  4.40k|    if (state == NULL) {
  ------------------
  |  Branch (687:9): [True: 2, False: 4.40k]
  ------------------
  688|      2|        if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (688:13): [True: 0, False: 2]
  ------------------
  689|      0|            return NULL;
  690|       |
  691|      2|        state = OSSL_ERR_STATE_new();
  692|      2|        if (state == NULL) {
  ------------------
  |  Branch (692:13): [True: 0, False: 2]
  ------------------
  693|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  694|      0|            return NULL;
  695|      0|        }
  696|       |
  697|      2|        if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state)
  ------------------
  |  Branch (697:13): [True: 0, False: 2]
  ------------------
  698|      2|                || !CRYPTO_THREAD_set_local(&err_thread_local, state)) {
  ------------------
  |  Branch (698:20): [True: 0, False: 2]
  ------------------
  699|      0|            OSSL_ERR_STATE_free(state);
  700|      0|            CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  701|      0|            return NULL;
  702|      0|        }
  703|       |
  704|       |        /* Ignore failures from these */
  705|      2|        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  450|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
  706|      2|    }
  707|       |
  708|  4.40k|    set_sys_error(saveerrno);
  ------------------
  |  |   32|  4.40k|# define set_sys_error(e)        errno=(e)
  ------------------
  709|  4.40k|    return state;
  710|  4.40k|}
err_shelve_state:
  725|      2|{
  726|      2|    int saveerrno = get_last_sys_error();
  ------------------
  |  |   30|      2|# define get_last_sys_error()    errno
  ------------------
  727|       |
  728|       |    /*
  729|       |     * Note, at present our only caller is OPENSSL_init_crypto(), indirectly
  730|       |     * via ossl_init_load_crypto_nodelete(), by which point the requested
  731|       |     * "base" initialization has already been performed, so the below call is a
  732|       |     * NOOP, that re-enters OPENSSL_init_crypto() only to quickly return.
  733|       |     *
  734|       |     * If are no other valid callers of this function, the call below can be
  735|       |     * removed, avoiding the re-entry into OPENSSL_init_crypto().  If there are
  736|       |     * potential uses that are not from inside OPENSSL_init_crypto(), then this
  737|       |     * call is needed, but some care is required to make sure that the re-entry
  738|       |     * remains a NOOP.
  739|       |     */
  740|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (740:9): [True: 0, False: 2]
  ------------------
  741|      0|        return 0;
  742|       |
  743|      2|    if (!RUN_ONCE(&err_init, err_do_init))
  ------------------
  |  |  130|      2|    (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (743:9): [True: 0, False: 2]
  ------------------
  744|      0|        return 0;
  745|       |
  746|      2|    *state = CRYPTO_THREAD_get_local(&err_thread_local);
  747|      2|    if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1))
  ------------------
  |  Branch (747:9): [True: 0, False: 2]
  ------------------
  748|      0|        return 0;
  749|       |
  750|      2|    set_sys_error(saveerrno);
  ------------------
  |  |   32|      2|# define set_sys_error(e)        errno=(e)
  ------------------
  751|      2|    return 1;
  752|      2|}
err_unshelve_state:
  759|      2|{
  760|      2|    if (state != (void*)-1)
  ------------------
  |  Branch (760:9): [True: 2, False: 0]
  ------------------
  761|      2|        CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)state);
  762|      2|}
err.c:do_err_strings_init:
  214|      2|{
  215|      2|    if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL))
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  |  Branch (215:9): [True: 0, False: 2]
  ------------------
  216|      0|        return 0;
  217|      2|    err_string_lock = CRYPTO_THREAD_lock_new();
  218|      2|    if (err_string_lock == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 2]
  ------------------
  219|      0|        return 0;
  220|      2|#ifndef OPENSSL_NO_ERR
  221|      2|    int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
  ------------------
  |  |  375|      2|#define lh_ERR_STRING_DATA_new(hfn, cmp) ((LHASH_OF(ERR_STRING_DATA) *)OPENSSL_LH_new(ossl_check_ERR_STRING_DATA_lh_hashfunc_type(hfn), ossl_check_ERR_STRING_DATA_lh_compfunc_type(cmp)))
  ------------------
  222|      2|                                            err_string_data_cmp);
  223|      2|    if (int_error_hash == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        CRYPTO_THREAD_lock_free(err_string_lock);
  225|      0|        err_string_lock = NULL;
  226|      0|        return 0;
  227|      0|    }
  228|      2|#endif
  229|      2|    return 1;
  230|      2|}
err.c:err_string_data_hash:
  172|  8.63k|{
  173|  8.63k|    unsigned long ret, l;
  174|       |
  175|  8.63k|    l = a->error;
  176|  8.63k|    ret = l ^ ERR_GET_LIB(l);
  177|  8.63k|    return (ret ^ ret % 19 * 13);
  178|  8.63k|}
err.c:err_string_data_cmp:
  182|  5.87k|{
  183|  5.87k|    if (a->error == b->error)
  ------------------
  |  Branch (183:9): [True: 5.57k, False: 292]
  ------------------
  184|  5.57k|        return 0;
  185|    292|    return a->error > b->error ? 1 : -1;
  ------------------
  |  Branch (185:12): [True: 160, False: 132]
  ------------------
  186|  5.87k|}
err.c:err_load_strings:
  260|    208|{
  261|    208|    if (!CRYPTO_THREAD_write_lock(err_string_lock))
  ------------------
  |  Branch (261:9): [True: 0, False: 208]
  ------------------
  262|      0|        return 0;
  263|  8.70k|    for (; str->error; str++)
  ------------------
  |  Branch (263:12): [True: 8.49k, False: 208]
  ------------------
  264|  8.49k|        (void)lh_ERR_STRING_DATA_insert(int_error_hash,
  ------------------
  |  |  378|  8.70k|#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|    208|                                       (ERR_STRING_DATA *)str);
  266|    208|    CRYPTO_THREAD_unlock(err_string_lock);
  267|    208|    return 1;
  268|    208|}
err.c:int_err_get_item:
  189|    136|{
  190|    136|    ERR_STRING_DATA *p = NULL;
  191|       |
  192|    136|    if (!CRYPTO_THREAD_read_lock(err_string_lock))
  ------------------
  |  Branch (192:9): [True: 0, False: 136]
  ------------------
  193|      0|        return NULL;
  194|    136|    p = lh_ERR_STRING_DATA_retrieve(int_error_hash, d);
  ------------------
  |  |  380|    136|#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|    136|    CRYPTO_THREAD_unlock(err_string_lock);
  196|       |
  197|    136|    return p;
  198|    136|}
err.c:err_do_init:
  667|      2|{
  668|      2|    set_err_thread_local = 1;
  669|      2|    return CRYPTO_THREAD_init_local(&err_thread_local, NULL);
  670|      2|}
err.c:err_delete_thread_state:
  645|      2|{
  646|      2|    ERR_STATE *state = CRYPTO_THREAD_get_local(&err_thread_local);
  647|      2|    if (state == NULL)
  ------------------
  |  Branch (647:9): [True: 0, False: 2]
  ------------------
  648|      0|        return;
  649|       |
  650|      2|    CRYPTO_THREAD_set_local(&err_thread_local, NULL);
  651|      2|    OSSL_ERR_STATE_free(state);
  652|      2|}

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

ERR_new:
   17|  1.05k|{
   18|  1.05k|    ERR_STATE *es;
   19|       |
   20|  1.05k|    es = ossl_err_get_state_int();
   21|  1.05k|    if (es == NULL)
  ------------------
  |  Branch (21:9): [True: 0, False: 1.05k]
  ------------------
   22|      0|        return;
   23|       |
   24|       |    /* Allocate a slot */
   25|  1.05k|    err_get_slot(es);
   26|  1.05k|    err_clear(es, es->top, 0);
   27|  1.05k|}
ERR_set_debug:
   30|  1.05k|{
   31|  1.05k|    ERR_STATE *es;
   32|       |
   33|  1.05k|    es = ossl_err_get_state_int();
   34|  1.05k|    if (es == NULL)
  ------------------
  |  Branch (34:9): [True: 0, False: 1.05k]
  ------------------
   35|      0|        return;
   36|       |
   37|  1.05k|    err_set_debug(es, es->top, file, line, func);
   38|  1.05k|}
ERR_set_error:
   41|  1.05k|{
   42|  1.05k|    va_list args;
   43|       |
   44|  1.05k|    va_start(args, fmt);
   45|  1.05k|    ERR_vset_error(lib, reason, fmt, args);
   46|  1.05k|    va_end(args);
   47|  1.05k|}
ERR_vset_error:
   50|  1.05k|{
   51|  1.05k|    ERR_STATE *es;
   52|  1.05k|    char *buf = NULL;
   53|  1.05k|    size_t buf_size = 0;
   54|  1.05k|    unsigned long flags = 0;
   55|  1.05k|    size_t i;
   56|       |
   57|  1.05k|    es = ossl_err_get_state_int();
   58|  1.05k|    if (es == NULL)
  ------------------
  |  Branch (58:9): [True: 0, False: 1.05k]
  ------------------
   59|      0|        return;
   60|  1.05k|    i = es->top;
   61|       |
   62|  1.05k|    if (fmt != NULL) {
  ------------------
  |  Branch (62:9): [True: 0, False: 1.05k]
  ------------------
   63|      0|        int printed_len = 0;
   64|      0|        char *rbuf = NULL;
   65|       |
   66|      0|        buf = es->err_data[i];
   67|      0|        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|      0|        es->err_data[i] = NULL;
   77|      0|        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|      0|        if (buf_size < ERR_MAX_DATA_SIZE
  ------------------
  |  |  392|      0|#define ERR_MAX_DATA_SIZE       1024
  ------------------
  |  Branch (83:13): [True: 0, False: 0]
  ------------------
   84|      0|            && (rbuf = OPENSSL_realloc(buf, ERR_MAX_DATA_SIZE)) != NULL) {
  ------------------
  |  |  101|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (84:16): [True: 0, False: 0]
  ------------------
   85|      0|            buf = rbuf;
   86|      0|            buf_size = ERR_MAX_DATA_SIZE;
  ------------------
  |  |  392|      0|#define ERR_MAX_DATA_SIZE       1024
  ------------------
   87|      0|        }
   88|       |
   89|      0|        if (buf != NULL) {
  ------------------
  |  Branch (89:13): [True: 0, False: 0]
  ------------------
   90|      0|            printed_len = BIO_vsnprintf(buf, buf_size, fmt, args);
   91|      0|        }
   92|      0|        if (printed_len < 0)
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  ------------------
   93|      0|            printed_len = 0;
   94|      0|        if (buf != NULL)
  ------------------
  |  Branch (94:13): [True: 0, False: 0]
  ------------------
   95|      0|            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|      0|        if ((rbuf = OPENSSL_realloc(buf, printed_len + 1)) != NULL) {
  ------------------
  |  |  101|      0|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (103:13): [True: 0, False: 0]
  ------------------
  104|      0|            buf = rbuf;
  105|      0|            buf_size = printed_len + 1;
  106|      0|            buf[printed_len] = '\0';
  107|      0|        }
  108|       |
  109|      0|        if (buf != NULL)
  ------------------
  |  Branch (109:13): [True: 0, False: 0]
  ------------------
  110|      0|            flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   48|      0|# define ERR_TXT_MALLOCED        0x01
  ------------------
                          flags = ERR_TXT_MALLOCED | ERR_TXT_STRING;
  ------------------
  |  |   49|      0|# define ERR_TXT_STRING          0x02
  ------------------
  111|      0|    }
  112|       |
  113|  1.05k|    err_clear_data(es, es->top, 0);
  114|  1.05k|    err_set_error(es, es->top, lib, reason);
  115|  1.05k|    if (fmt != NULL)
  ------------------
  |  Branch (115:9): [True: 0, False: 1.05k]
  ------------------
  116|      0|        err_set_data(es, es->top, buf, buf_size, flags);
  117|  1.05k|}

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

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

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

EVP_ENCODE_CTX_new:
  128|    257|{
  129|    257|    return OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
  ------------------
  |  |   99|    257|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    257|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    257|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  130|    257|}
EVP_ENCODE_CTX_free:
  133|  1.24k|{
  134|  1.24k|    OPENSSL_free(ctx);
  ------------------
  |  |  107|  1.24k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.24k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.24k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  135|  1.24k|}
EVP_DecodeInit:
  275|    257|{
  276|       |    /* Only ctx->num and ctx->flags are used during decoding. */
  277|    257|    ctx->num = 0;
  278|    257|    ctx->length = 0;
  279|    257|    ctx->line_num = 0;
  280|    257|    ctx->flags = 0;
  281|    257|}
EVP_DecodeUpdate:
  305|    257|{
  306|    257|    int seof = 0, eof = 0, rv = -1, ret = 0, i, v, tmp, n, decoded_len;
  307|    257|    unsigned char *d;
  308|    257|    const unsigned char *table;
  309|       |
  310|    257|    n = ctx->num;
  311|    257|    d = ctx->enc_data;
  312|       |
  313|    257|    if (n > 0 && d[n - 1] == '=') {
  ------------------
  |  Branch (313:9): [True: 0, False: 257]
  |  Branch (313:18): [True: 0, False: 0]
  ------------------
  314|      0|        eof++;
  315|      0|        if (n > 1 && d[n - 2] == '=')
  ------------------
  |  Branch (315:13): [True: 0, False: 0]
  |  Branch (315:22): [True: 0, False: 0]
  ------------------
  316|      0|            eof++;
  317|      0|    }
  318|       |
  319|       |     /* Legacy behaviour: an empty input chunk signals end of input. */
  320|    257|    if (inl == 0) {
  ------------------
  |  Branch (320:9): [True: 0, False: 257]
  ------------------
  321|      0|        rv = 0;
  322|      0|        goto end;
  323|      0|    }
  324|       |
  325|    257|    if ((ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
  ------------------
  |  |  869|    257|#define EVP_ENCODE_CTX_USE_SRP_ALPHABET     2
  ------------------
  |  Branch (325:9): [True: 0, False: 257]
  ------------------
  326|      0|        table = srpdata_ascii2bin;
  327|    257|    else
  328|    257|        table = data_ascii2bin;
  329|       |
  330|  2.87M|    for (i = 0; i < inl; i++) {
  ------------------
  |  Branch (330:17): [True: 2.87M, False: 172]
  ------------------
  331|  2.87M|        tmp = *(in++);
  332|  2.87M|        v = conv_ascii2bin(tmp, table);
  333|  2.87M|        if (v == B64_ERROR) {
  ------------------
  |  |   68|  2.87M|#define B64_ERROR               0xFF
  ------------------
  |  Branch (333:13): [True: 21, False: 2.87M]
  ------------------
  334|     21|            rv = -1;
  335|     21|            goto end;
  336|     21|        }
  337|       |
  338|  2.87M|        if (tmp == '=') {
  ------------------
  |  Branch (338:13): [True: 83, False: 2.87M]
  ------------------
  339|     83|            eof++;
  340|  2.87M|        } else if (eof > 0 && B64_BASE64(v)) {
  ------------------
  |  |   70|    304|#define B64_BASE64(a)           (!B64_NOT_BASE64(a))
  |  |  ------------------
  |  |  |  |   69|    304|#define B64_NOT_BASE64(a)       (((a)|0x13) == 0xF3)
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 5, False: 299]
  |  |  ------------------
  ------------------
  |  Branch (340:20): [True: 304, False: 2.87M]
  ------------------
  341|       |            /* More data after padding. */
  342|      5|            rv = -1;
  343|      5|            goto end;
  344|      5|        }
  345|       |
  346|  2.87M|        if (eof > 2) {
  ------------------
  |  Branch (346:13): [True: 2, False: 2.87M]
  ------------------
  347|      2|            rv = -1;
  348|      2|            goto end;
  349|      2|        }
  350|       |
  351|  2.87M|        if (v == B64_EOF) {
  ------------------
  |  |   66|  2.87M|#define B64_EOF                 0xF2
  ------------------
  |  Branch (351:13): [True: 57, False: 2.87M]
  ------------------
  352|     57|            seof = 1;
  353|     57|            goto tail;
  354|     57|        }
  355|       |
  356|       |        /* Only save valid base64 characters. */
  357|  2.87M|        if (B64_BASE64(v)) {
  ------------------
  |  |   70|  2.87M|#define B64_BASE64(a)           (!B64_NOT_BASE64(a))
  |  |  ------------------
  |  |  |  |   69|  2.87M|#define B64_NOT_BASE64(a)       (((a)|0x13) == 0xF3)
  |  |  ------------------
  |  |  |  Branch (70:33): [True: 2.84M, False: 24.4k]
  |  |  ------------------
  ------------------
  358|  2.84M|            if (n >= 64) {
  ------------------
  |  Branch (358:17): [True: 0, False: 2.84M]
  ------------------
  359|       |                /*
  360|       |                 * We increment n once per loop, and empty the buffer as soon as
  361|       |                 * we reach 64 characters, so this can only happen if someone's
  362|       |                 * manually messed with the ctx. Refuse to write any more data.
  363|       |                 */
  364|      0|                rv = -1;
  365|      0|                goto end;
  366|      0|            }
  367|  2.84M|            OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
  ------------------
  |  |  421|  2.84M|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (421:12): [True: 2.84M, False: 0]
  |  |  ------------------
  ------------------
  368|  2.84M|            d[n++] = tmp;
  369|  2.84M|        }
  370|       |
  371|  2.87M|        if (n == 64) {
  ------------------
  |  Branch (371:13): [True: 44.4k, False: 2.82M]
  ------------------
  372|  44.4k|            decoded_len = evp_decodeblock_int(ctx, out, d, n);
  373|  44.4k|            n = 0;
  374|  44.4k|            if (decoded_len < 0 || eof > decoded_len) {
  ------------------
  |  Branch (374:17): [True: 0, False: 44.4k]
  |  Branch (374:36): [True: 0, False: 44.4k]
  ------------------
  375|      0|                rv = -1;
  376|      0|                goto end;
  377|      0|            }
  378|  44.4k|            ret += decoded_len - eof;
  379|  44.4k|            out += decoded_len - eof;
  380|  44.4k|        }
  381|  2.87M|    }
  382|       |
  383|       |    /*
  384|       |     * Legacy behaviour: if the current line is a full base64-block (i.e., has
  385|       |     * 0 mod 4 base64 characters), it is processed immediately. We keep this
  386|       |     * behaviour as applications may not be calling EVP_DecodeFinal properly.
  387|       |     */
  388|    229|tail:
  389|    229|    if (n > 0) {
  ------------------
  |  Branch (389:9): [True: 202, False: 27]
  ------------------
  390|    202|        if ((n & 3) == 0) {
  ------------------
  |  Branch (390:13): [True: 148, False: 54]
  ------------------
  391|    148|            decoded_len = evp_decodeblock_int(ctx, out, d, n);
  392|    148|            n = 0;
  393|    148|            if (decoded_len < 0 || eof > decoded_len) {
  ------------------
  |  Branch (393:17): [True: 0, False: 148]
  |  Branch (393:36): [True: 0, False: 148]
  ------------------
  394|      0|                rv = -1;
  395|      0|                goto end;
  396|      0|            }
  397|    148|            ret += (decoded_len - eof);
  398|    148|        } else if (seof) {
  ------------------
  |  Branch (398:20): [True: 6, False: 48]
  ------------------
  399|       |            /* EOF in the middle of a base64 block. */
  400|      6|            rv = -1;
  401|      6|            goto end;
  402|      6|        }
  403|    202|    }
  404|       |
  405|    223|    rv = seof || (n == 0 && eof) ? 0 : 1;
  ------------------
  |  Branch (405:10): [True: 51, False: 172]
  |  Branch (405:19): [True: 124, False: 48]
  |  Branch (405:29): [True: 10, False: 114]
  ------------------
  406|    257|end:
  407|       |    /* Legacy behaviour. This should probably rather be zeroed on error. */
  408|    257|    *outl = ret;
  409|    257|    ctx->num = n;
  410|    257|    return rv;
  411|    223|}
EVP_DecodeFinal:
  465|    223|{
  466|    223|    int i;
  467|       |
  468|    223|    *outl = 0;
  469|    223|    if (ctx->num != 0) {
  ------------------
  |  Branch (469:9): [True: 48, False: 175]
  ------------------
  470|     48|        i = evp_decodeblock_int(ctx, out, ctx->enc_data, ctx->num);
  471|     48|        if (i < 0)
  ------------------
  |  Branch (471:13): [True: 48, False: 0]
  ------------------
  472|     48|            return -1;
  473|      0|        ctx->num = 0;
  474|      0|        *outl = i;
  475|      0|        return 1;
  476|     48|    } else
  477|    175|        return 1;
  478|    223|}
encode.c:conv_ascii2bin:
  112|  5.81M|{
  113|  5.81M|    if (a & 0x80)
  ------------------
  |  Branch (113:9): [True: 13, False: 5.81M]
  ------------------
  114|     13|        return B64_ERROR;
  ------------------
  |  |   68|     13|#define B64_ERROR               0xFF
  ------------------
  115|  5.81M|    return table[a];
  116|  5.81M|}
encode.c:evp_decodeblock_int:
  415|  44.6k|{
  416|  44.6k|    int i, ret = 0, a, b, c, d;
  417|  44.6k|    unsigned long l;
  418|  44.6k|    const unsigned char *table;
  419|       |
  420|  44.6k|    if (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
  ------------------
  |  |  869|  44.6k|#define EVP_ENCODE_CTX_USE_SRP_ALPHABET     2
  ------------------
  |  Branch (420:9): [True: 44.6k, False: 0]
  |  Branch (420:24): [True: 0, False: 44.6k]
  ------------------
  421|      0|        table = srpdata_ascii2bin;
  422|  44.6k|    else
  423|  44.6k|        table = data_ascii2bin;
  424|       |
  425|       |    /* trim whitespace from the start of the line. */
  426|  44.6k|    while ((n > 0) && (conv_ascii2bin(*f, table) == B64_WS)) {
  ------------------
  |  |   67|  44.6k|#define B64_WS                  0xE0
  ------------------
  |  Branch (426:12): [True: 44.6k, False: 0]
  |  Branch (426:23): [True: 0, False: 44.6k]
  ------------------
  427|      0|        f++;
  428|      0|        n--;
  429|      0|    }
  430|       |
  431|       |    /*
  432|       |     * strip off stuff at the end of the line ascii2bin values B64_WS,
  433|       |     * B64_EOLN, B64_EOLN and B64_EOF
  434|       |     */
  435|  44.6k|    while ((n > 3) && (B64_NOT_BASE64(conv_ascii2bin(f[n - 1], table))))
  ------------------
  |  |   69|  44.6k|#define B64_NOT_BASE64(a)       (((a)|0x13) == 0xF3)
  ------------------
  |  Branch (435:12): [True: 44.6k, False: 32]
  |  Branch (435:23): [True: 0, False: 44.6k]
  ------------------
  436|      0|        n--;
  437|       |
  438|  44.6k|    if (n % 4 != 0)
  ------------------
  |  Branch (438:9): [True: 48, False: 44.6k]
  ------------------
  439|     48|        return -1;
  440|       |
  441|   756k|    for (i = 0; i < n; i += 4) {
  ------------------
  |  Branch (441:17): [True: 711k, False: 44.6k]
  ------------------
  442|   711k|        a = conv_ascii2bin(*(f++), table);
  443|   711k|        b = conv_ascii2bin(*(f++), table);
  444|   711k|        c = conv_ascii2bin(*(f++), table);
  445|   711k|        d = conv_ascii2bin(*(f++), table);
  446|   711k|        if ((a & 0x80) || (b & 0x80) || (c & 0x80) || (d & 0x80))
  ------------------
  |  Branch (446:13): [True: 0, False: 711k]
  |  Branch (446:27): [True: 0, False: 711k]
  |  Branch (446:41): [True: 0, False: 711k]
  |  Branch (446:55): [True: 0, False: 711k]
  ------------------
  447|      0|            return -1;
  448|   711k|        l = ((((unsigned long)a) << 18L) |
  449|   711k|             (((unsigned long)b) << 12L) |
  450|   711k|             (((unsigned long)c) << 6L) | (((unsigned long)d)));
  451|   711k|        *(t++) = (unsigned char)(l >> 16L) & 0xff;
  452|   711k|        *(t++) = (unsigned char)(l >> 8L) & 0xff;
  453|   711k|        *(t++) = (unsigned char)(l) & 0xff;
  454|   711k|        ret += 3;
  455|   711k|    }
  456|  44.6k|    return ret;
  457|  44.6k|}

ossl_err_load_EVP_strings:
  202|      2|{
  203|      2|#ifndef OPENSSL_NO_ERR
  204|      2|    if (ERR_reason_error_string(EVP_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (204:9): [True: 2, False: 0]
  ------------------
  205|      2|        ERR_load_strings_const(EVP_str_reasons);
  206|      2|#endif
  207|      2|    return 1;
  208|      2|}

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

EVP_RAND_CTX_free:
  374|      4|{
  375|      4|    int ref = 0;
  376|      4|    EVP_RAND_CTX *parent;
  377|       |
  378|      4|    if (ctx == NULL)
  ------------------
  |  Branch (378:9): [True: 4, False: 0]
  ------------------
  379|      4|        return;
  380|       |
  381|      0|    CRYPTO_DOWN_REF(&ctx->refcnt, &ref);
  382|      0|    if (ref > 0)
  ------------------
  |  Branch (382:9): [True: 0, False: 0]
  ------------------
  383|      0|        return;
  384|      0|    parent = ctx->parent;
  385|      0|    ctx->meth->freectx(ctx->algctx);
  386|      0|    ctx->algctx = NULL;
  387|      0|    EVP_RAND_free(ctx->meth);
  388|      0|    CRYPTO_FREE_REF(&ctx->refcnt);
  389|      0|    OPENSSL_free(ctx);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  390|      0|    EVP_RAND_CTX_free(parent);
  391|      0|}

evp_cleanup_int:
  154|      2|{
  155|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_KDF_METH);
  ------------------
  |  |   30|      2|# define OBJ_NAME_TYPE_KDF_METH          0x06
  ------------------
  156|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH);
  ------------------
  |  |   26|      2|# define OBJ_NAME_TYPE_CIPHER_METH       0x02
  ------------------
  157|      2|    OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH);
  ------------------
  |  |   25|      2|# define OBJ_NAME_TYPE_MD_METH           0x01
  ------------------
  158|       |    /*
  159|       |     * The above calls will only clean out the contents of the name hash
  160|       |     * table, but not the hash table itself.  The following line does that
  161|       |     * part.  -- Richard Levitte
  162|       |     */
  163|      2|    OBJ_NAME_cleanup(-1);
  164|       |
  165|      2|    EVP_PBE_cleanup();
  166|      2|    OBJ_sigid_free();
  167|       |
  168|      2|    evp_app_cleanup_int();
  169|      2|}

evp_app_cleanup_int:
  636|      2|{
  637|      2|    if (app_pkey_methods != NULL)
  ------------------
  |  Branch (637:9): [True: 0, False: 2]
  ------------------
  638|      0|        sk_EVP_PKEY_METHOD_pop_free(app_pkey_methods, EVP_PKEY_meth_free);
  639|      2|}

ossl_do_ex_data_init:
   15|      2|{
   16|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   17|       |
   18|      2|    if (global == NULL)
  ------------------
  |  Branch (18:9): [True: 0, False: 2]
  ------------------
   19|      0|        return 0;
   20|       |
   21|      2|    global->ex_data_lock = CRYPTO_THREAD_lock_new();
   22|      2|    return global->ex_data_lock != NULL;
   23|      2|}
ossl_crypto_cleanup_all_ex_data_int:
   73|      2|{
   74|      2|    int i;
   75|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
   76|       |
   77|      2|    if (global == NULL)
  ------------------
  |  Branch (77:9): [True: 0, False: 2]
  ------------------
   78|      0|        return;
   79|       |
   80|     38|    for (i = 0; i < CRYPTO_EX_INDEX__COUNT; ++i) {
  ------------------
  |  |  237|     38|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (80:17): [True: 36, False: 2]
  ------------------
   81|     36|        EX_CALLBACKS *ip = &global->ex_data[i];
   82|       |
   83|     36|        sk_EX_CALLBACK_pop_free(ip->meth, cleanup_cb);
   84|     36|        ip->meth = NULL;
   85|     36|    }
   86|       |
   87|      2|    CRYPTO_THREAD_lock_free(global->ex_data_lock);
   88|      2|    global->ex_data_lock = NULL;
   89|      2|}
ossl_crypto_free_ex_index_ex:
  114|      2|{
  115|      2|    EX_CALLBACKS *ip;
  116|      2|    EX_CALLBACK *a;
  117|      2|    int toret = 0;
  118|      2|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  119|       |
  120|      2|    if (global == NULL)
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        return 0;
  122|       |
  123|      2|    ip = get_and_lock(global, class_index, 0);
  124|      2|    if (ip == NULL)
  ------------------
  |  Branch (124:9): [True: 0, False: 2]
  ------------------
  125|      0|        return 0;
  126|       |
  127|      2|    if (idx < 0 || idx >= sk_EX_CALLBACK_num(ip->meth))
  ------------------
  |  Branch (127:9): [True: 2, False: 0]
  |  Branch (127:20): [True: 0, False: 0]
  ------------------
  128|      2|        goto err;
  129|      0|    a = sk_EX_CALLBACK_value(ip->meth, idx);
  130|      0|    if (a == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 0]
  ------------------
  131|      0|        goto err;
  132|      0|    a->new_func = dummy_new;
  133|      0|    a->dup_func = dummy_dup;
  134|      0|    a->free_func = dummy_free;
  135|      0|    toret = 1;
  136|      2|err:
  137|      2|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  138|      2|    return toret;
  139|      0|}
CRYPTO_free_ex_index:
  142|      2|{
  143|      2|    return ossl_crypto_free_ex_index_ex(NULL, class_index, idx);
  144|      2|}
ossl_crypto_new_ex_data_ex:
  221|  3.71k|{
  222|  3.71k|    int mx, i;
  223|  3.71k|    void *ptr;
  224|  3.71k|    EX_CALLBACK **storage = NULL;
  225|  3.71k|    EX_CALLBACK *stack[10];
  226|  3.71k|    EX_CALLBACKS *ip;
  227|  3.71k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ctx);
  228|       |
  229|  3.71k|    if (global == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 3.71k]
  ------------------
  230|      0|        return 0;
  231|       |
  232|  3.71k|    ip = get_and_lock(global, class_index, 1);
  233|  3.71k|    if (ip == NULL)
  ------------------
  |  Branch (233:9): [True: 0, False: 3.71k]
  ------------------
  234|      0|        return 0;
  235|       |
  236|  3.71k|    ad->ctx = ctx;
  237|  3.71k|    ad->sk = NULL;
  238|  3.71k|    mx = sk_EX_CALLBACK_num(ip->meth);
  239|  3.71k|    if (mx > 0) {
  ------------------
  |  Branch (239:9): [True: 0, False: 3.71k]
  ------------------
  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);
  ------------------
  |  |   97|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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|  3.71k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  249|       |
  250|  3.71k|    if (mx > 0 && storage == NULL)
  ------------------
  |  Branch (250:9): [True: 0, False: 3.71k]
  |  Branch (250:19): [True: 0, False: 0]
  ------------------
  251|      0|        return 0;
  252|  3.71k|    for (i = 0; i < mx; i++) {
  ------------------
  |  Branch (252:17): [True: 0, False: 3.71k]
  ------------------
  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|  3.71k|    if (storage != stack)
  ------------------
  |  Branch (259:9): [True: 3.71k, False: 0]
  ------------------
  260|  3.71k|        OPENSSL_free(storage);
  ------------------
  |  |  107|  3.71k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  261|  3.71k|    return 1;
  262|  3.71k|}
CRYPTO_new_ex_data:
  265|  3.71k|{
  266|  3.71k|    return ossl_crypto_new_ex_data_ex(NULL, class_index, obj, ad);
  267|  3.71k|}
CRYPTO_free_ex_data:
  368|  3.71k|{
  369|  3.71k|    int mx, i;
  370|  3.71k|    EX_CALLBACKS *ip;
  371|  3.71k|    void *ptr;
  372|  3.71k|    const EX_CALLBACK *f;
  373|  3.71k|    struct ex_callback_entry stack[10];
  374|  3.71k|    struct ex_callback_entry *storage = NULL;
  375|  3.71k|    OSSL_EX_DATA_GLOBAL *global = ossl_lib_ctx_get_ex_data_global(ad->ctx);
  376|       |
  377|  3.71k|    if (global == NULL)
  ------------------
  |  Branch (377:9): [True: 0, False: 3.71k]
  ------------------
  378|      0|        goto err;
  379|       |
  380|  3.71k|    ip = get_and_lock(global, class_index, 1);
  381|  3.71k|    if (ip == NULL)
  ------------------
  |  Branch (381:9): [True: 0, False: 3.71k]
  ------------------
  382|      0|        goto err;
  383|       |
  384|  3.71k|    mx = sk_EX_CALLBACK_num(ip->meth);
  385|  3.71k|    if (mx > 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 3.71k]
  ------------------
  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);
  ------------------
  |  |   97|      0|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      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|  3.71k|    CRYPTO_THREAD_unlock(global->ex_data_lock);
  397|       |
  398|  3.71k|    if (storage != NULL) {
  ------------------
  |  Branch (398:9): [True: 0, False: 3.71k]
  ------------------
  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|  3.71k|    if (storage != stack)
  ------------------
  |  Branch (411:9): [True: 3.71k, False: 0]
  ------------------
  412|  3.71k|        OPENSSL_free(storage);
  ------------------
  |  |  107|  3.71k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  3.71k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  3.71k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  413|  3.71k| err:
  414|  3.71k|    sk_void_free(ad->sk);
  ------------------
  |  |  193|  3.71k|#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
  ------------------
  415|  3.71k|    ad->sk = NULL;
  416|  3.71k|    ad->ctx = NULL;
  417|  3.71k|}
ex_data.c:get_and_lock:
   33|  7.43k|{
   34|  7.43k|    EX_CALLBACKS *ip;
   35|       |
   36|  7.43k|    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
  ------------------
  |  |  237|  7.43k|# define CRYPTO_EX_INDEX__COUNT          18
  ------------------
  |  Branch (36:9): [True: 0, False: 7.43k]
  |  Branch (36:28): [True: 0, False: 7.43k]
  ------------------
   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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
   38|      0|        return NULL;
   39|      0|    }
   40|       |
   41|  7.43k|    if (global->ex_data_lock == NULL) {
  ------------------
  |  Branch (41:9): [True: 0, False: 7.43k]
  ------------------
   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|  7.43k|    if (read) {
  ------------------
  |  Branch (49:9): [True: 7.42k, False: 2]
  ------------------
   50|  7.42k|        if (!CRYPTO_THREAD_read_lock(global->ex_data_lock))
  ------------------
  |  Branch (50:13): [True: 0, False: 7.42k]
  ------------------
   51|      0|            return NULL;
   52|  7.42k|    } else {
   53|      2|        if (!CRYPTO_THREAD_write_lock(global->ex_data_lock))
  ------------------
  |  Branch (53:13): [True: 0, False: 2]
  ------------------
   54|      0|            return NULL;
   55|      2|    }
   56|       |
   57|  7.43k|    ip = &global->ex_data[class_index];
   58|  7.43k|    return ip;
   59|  7.43k|}

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

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

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

OPENSSL_LH_new:
   48|     12|{
   49|     12|    OPENSSL_LHASH *ret;
   50|       |
   51|     12|    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
  ------------------
  |  |   99|     12|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (51:9): [True: 0, False: 12]
  ------------------
   52|      0|        return NULL;
   53|     12|    if ((ret->b = OPENSSL_zalloc(sizeof(*ret->b) * MIN_NODES)) == NULL)
  ------------------
  |  |   99|     12|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (53:9): [True: 0, False: 12]
  ------------------
   54|      0|        goto err;
   55|     12|    ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
  ------------------
  |  Branch (55:18): [True: 0, False: 12]
  ------------------
   56|     12|    ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
  ------------------
  |  Branch (56:18): [True: 0, False: 12]
  ------------------
   57|     12|    ret->num_nodes = MIN_NODES / 2;
  ------------------
  |  |   39|     12|#define MIN_NODES       16
  ------------------
   58|     12|    ret->num_alloc_nodes = MIN_NODES;
  ------------------
  |  |   39|     12|#define MIN_NODES       16
  ------------------
   59|     12|    ret->pmax = MIN_NODES / 2;
  ------------------
  |  |   39|     12|#define MIN_NODES       16
  ------------------
   60|     12|    ret->up_load = UP_LOAD;
  ------------------
  |  |   40|     12|#define UP_LOAD         (2*LH_LOAD_MULT) /* load times 256 (default 2) */
  |  |  ------------------
  |  |  |  |   81|     12|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   61|     12|    ret->down_load = DOWN_LOAD;
  ------------------
  |  |   41|     12|#define DOWN_LOAD       (LH_LOAD_MULT) /* load times 256 (default 1) */
  |  |  ------------------
  |  |  |  |   81|     12|# define LH_LOAD_MULT    256
  |  |  ------------------
  ------------------
   62|     12|    return ret;
   63|       |
   64|      0|err:
   65|      0|    OPENSSL_free(ret->b);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   66|      0|    OPENSSL_free(ret);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   67|      0|    return NULL;
   68|     12|}
OPENSSL_LH_free:
   71|     14|{
   72|     14|    if (lh == NULL)
  ------------------
  |  Branch (72:9): [True: 2, False: 12]
  ------------------
   73|      2|        return;
   74|       |
   75|     12|    OPENSSL_LH_flush(lh);
   76|     12|    OPENSSL_free(lh->b);
  ------------------
  |  |  107|     12|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   77|     12|    OPENSSL_free(lh);
  ------------------
  |  |  107|     12|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   78|     12|}
OPENSSL_LH_flush:
   81|     12|{
   82|     12|    unsigned int i;
   83|     12|    OPENSSL_LH_NODE *n, *nn;
   84|       |
   85|     12|    if (lh == NULL)
  ------------------
  |  Branch (85:9): [True: 0, False: 12]
  ------------------
   86|      0|        return;
   87|       |
   88|  1.55k|    for (i = 0; i < lh->num_nodes; i++) {
  ------------------
  |  Branch (88:17): [True: 1.53k, False: 12]
  ------------------
   89|  1.53k|        n = lh->b[i];
   90|  4.47k|        while (n != NULL) {
  ------------------
  |  Branch (90:16): [True: 2.93k, False: 1.53k]
  ------------------
   91|  2.93k|            nn = n->next;
   92|  2.93k|            OPENSSL_free(n);
  ------------------
  |  |  107|  2.93k|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.93k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.93k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   93|  2.93k|            n = nn;
   94|  2.93k|        }
   95|  1.53k|        lh->b[i] = NULL;
   96|  1.53k|    }
   97|       |
   98|     12|    lh->num_items = 0;
   99|     12|}
OPENSSL_LH_insert:
  102|  8.51k|{
  103|  8.51k|    unsigned long hash;
  104|  8.51k|    OPENSSL_LH_NODE *nn, **rn;
  105|  8.51k|    void *ret;
  106|       |
  107|  8.51k|    lh->error = 0;
  108|  8.51k|    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
  ------------------
  |  |   81|  8.51k|# define LH_LOAD_MULT    256
  ------------------
  |  Branch (108:9): [True: 1.44k, False: 7.06k]
  |  Branch (108:76): [True: 0, False: 1.44k]
  ------------------
  109|      0|        return NULL;        /* 'lh->error++' already done in 'expand' */
  110|       |
  111|  8.51k|    rn = getrn(lh, data, &hash);
  112|       |
  113|  8.51k|    if (*rn == NULL) {
  ------------------
  |  Branch (113:9): [True: 2.93k, False: 5.57k]
  ------------------
  114|  2.93k|        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {
  ------------------
  |  |   97|  2.93k|        CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  2.93k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  2.93k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (114:13): [True: 0, False: 2.93k]
  ------------------
  115|      0|            lh->error++;
  116|      0|            return NULL;
  117|      0|        }
  118|  2.93k|        nn->data = data;
  119|  2.93k|        nn->next = NULL;
  120|  2.93k|        nn->hash = hash;
  121|  2.93k|        *rn = nn;
  122|  2.93k|        ret = NULL;
  123|  2.93k|        lh->num_items++;
  124|  5.57k|    } else {                    /* replace same key */
  125|  5.57k|        ret = (*rn)->data;
  126|  5.57k|        (*rn)->data = data;
  127|  5.57k|    }
  128|  8.51k|    return ret;
  129|  8.51k|}
OPENSSL_LH_retrieve:
  158|    168|{
  159|    168|    unsigned long hash;
  160|    168|    OPENSSL_LH_NODE **rn;
  161|       |
  162|    168|    if (lh->error != 0)
  ------------------
  |  Branch (162:9): [True: 0, False: 168]
  ------------------
  163|      0|        lh->error = 0;
  164|       |
  165|    168|    rn = getrn(lh, data, &hash);
  166|       |
  167|    168|    return *rn == NULL ? NULL : (*rn)->data;
  ------------------
  |  Branch (167:12): [True: 168, False: 0]
  ------------------
  168|    168|}
OPENSSL_LH_doall:
  198|     10|{
  199|     10|    doall_util_fn(lh, 0, func, (OPENSSL_LH_DOALL_FUNCARG)0, NULL);
  200|     10|}
OPENSSL_LH_strhash:
  318|     48|{
  319|     48|    unsigned long ret = 0;
  320|     48|    long n;
  321|     48|    unsigned long v;
  322|     48|    int r;
  323|       |
  324|     48|    if ((c == NULL) || (*c == '\0'))
  ------------------
  |  Branch (324:9): [True: 0, False: 48]
  |  Branch (324:24): [True: 0, False: 48]
  ------------------
  325|      0|        return ret;
  326|       |
  327|     48|    n = 0x100;
  328|    312|    while (*c) {
  ------------------
  |  Branch (328:12): [True: 264, False: 48]
  ------------------
  329|    264|        v = n | (*c);
  330|    264|        n += 0x100;
  331|    264|        r = (int)((v >> 2) ^ v) & 0x0f;
  332|       |        /* cast to uint64_t to avoid 32 bit shift of 32 bit value */
  333|    264|        ret = (ret << r) | (unsigned long)((uint64_t)ret >> (32 - r));
  334|    264|        ret &= 0xFFFFFFFFL;
  335|    264|        ret ^= v * v;
  336|    264|        c++;
  337|    264|    }
  338|     48|    return (ret >> 16) ^ ret;
  339|     48|}
OPENSSL_LH_error:
  398|     16|{
  399|     16|    return lh->error;
  400|     16|}
lhash.c:doall_util_fn:
  173|     10|{
  174|     10|    int i;
  175|     10|    OPENSSL_LH_NODE *a, *n;
  176|       |
  177|     10|    if (lh == NULL)
  ------------------
  |  Branch (177:9): [True: 0, False: 10]
  ------------------
  178|      0|        return;
  179|       |
  180|       |    /*
  181|       |     * reverse the order so we search from 'top to bottom' We were having
  182|       |     * memory leaks otherwise
  183|       |     */
  184|     90|    for (i = lh->num_nodes - 1; i >= 0; i--) {
  ------------------
  |  Branch (184:33): [True: 80, False: 10]
  ------------------
  185|     80|        a = lh->b[i];
  186|     96|        while (a != NULL) {
  ------------------
  |  Branch (186:16): [True: 16, False: 80]
  ------------------
  187|     16|            n = a->next;
  188|     16|            if (use_arg)
  ------------------
  |  Branch (188:17): [True: 0, False: 16]
  ------------------
  189|      0|                func_arg(a->data, arg);
  190|     16|            else
  191|     16|                func(a->data);
  192|     16|            a = n;
  193|     16|        }
  194|     80|    }
  195|     10|}
lhash.c:expand:
  208|  1.44k|{
  209|  1.44k|    OPENSSL_LH_NODE **n, **n1, **n2, *np;
  210|  1.44k|    unsigned int p, pmax, nni, j;
  211|  1.44k|    unsigned long hash;
  212|       |
  213|  1.44k|    nni = lh->num_alloc_nodes;
  214|  1.44k|    p = lh->p;
  215|  1.44k|    pmax = lh->pmax;
  216|  1.44k|    if (p + 1 >= pmax) {
  ------------------
  |  Branch (216:9): [True: 12, False: 1.43k]
  ------------------
  217|     12|        j = nni * 2;
  218|     12|        n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
  ------------------
  |  |  101|     12|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     12|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     12|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  219|     12|        if (n == NULL) {
  ------------------
  |  Branch (219:13): [True: 0, False: 12]
  ------------------
  220|      0|            lh->error++;
  221|      0|            return 0;
  222|      0|        }
  223|     12|        lh->b = n;
  224|     12|        memset(n + nni, 0, sizeof(*n) * (j - nni));
  225|     12|        lh->pmax = nni;
  226|     12|        lh->num_alloc_nodes = j;
  227|     12|        lh->p = 0;
  228|  1.43k|    } else {
  229|  1.43k|        lh->p++;
  230|  1.43k|    }
  231|       |
  232|  1.44k|    lh->num_nodes++;
  233|  1.44k|    n1 = &(lh->b[p]);
  234|  1.44k|    n2 = &(lh->b[p + pmax]);
  235|  1.44k|    *n2 = NULL;
  236|       |
  237|  6.54k|    for (np = *n1; np != NULL;) {
  ------------------
  |  Branch (237:20): [True: 5.10k, False: 1.44k]
  ------------------
  238|  5.10k|        hash = np->hash;
  239|  5.10k|        if ((hash % nni) != p) { /* move it */
  ------------------
  |  Branch (239:13): [True: 794, False: 4.31k]
  ------------------
  240|    794|            *n1 = (*n1)->next;
  241|    794|            np->next = *n2;
  242|    794|            *n2 = np;
  243|    794|        } else
  244|  4.31k|            n1 = &((*n1)->next);
  245|  5.10k|        np = *n1;
  246|  5.10k|    }
  247|       |
  248|  1.44k|    return 1;
  249|  1.44k|}
lhash.c:getrn:
  286|  8.67k|{
  287|  8.67k|    OPENSSL_LH_NODE **ret, *n1;
  288|  8.67k|    unsigned long hash, nn;
  289|  8.67k|    OPENSSL_LH_COMPFUNC cf;
  290|       |
  291|  8.67k|    hash = (*(lh->hash)) (data);
  292|  8.67k|    *rhash = hash;
  293|       |
  294|  8.67k|    nn = hash % lh->pmax;
  295|  8.67k|    if (nn < lh->p)
  ------------------
  |  Branch (295:9): [True: 3.85k, False: 4.82k]
  ------------------
  296|  3.85k|        nn = hash % lh->num_alloc_nodes;
  297|       |
  298|  8.67k|    cf = lh->comp;
  299|  8.67k|    ret = &(lh->b[(int)nn]);
  300|  21.6k|    for (n1 = *ret; n1 != NULL; n1 = n1->next) {
  ------------------
  |  Branch (300:21): [True: 18.5k, False: 3.10k]
  ------------------
  301|  18.5k|        if (n1->hash != hash) {
  ------------------
  |  Branch (301:13): [True: 12.7k, False: 5.87k]
  ------------------
  302|  12.7k|            ret = &(n1->next);
  303|  12.7k|            continue;
  304|  12.7k|        }
  305|  5.87k|        if (cf(n1->data, data) == 0)
  ------------------
  |  Branch (305:13): [True: 5.57k, False: 292]
  ------------------
  306|  5.57k|            break;
  307|    292|        ret = &(n1->next);
  308|    292|    }
  309|  8.67k|    return ret;
  310|  8.67k|}

CRYPTO_malloc:
  172|  28.9k|{
  173|  28.9k|    void *ptr;
  174|       |
  175|  28.9k|    INCREMENT(malloc_count);
  176|  28.9k|    if (malloc_impl != CRYPTO_malloc) {
  ------------------
  |  Branch (176:9): [True: 0, False: 28.9k]
  ------------------
  177|      0|        ptr = malloc_impl(num, file, line);
  178|      0|        if (ptr != NULL || num == 0)
  ------------------
  |  Branch (178:13): [True: 0, False: 0]
  |  Branch (178:28): [True: 0, False: 0]
  ------------------
  179|      0|            return ptr;
  180|      0|        goto err;
  181|      0|    }
  182|       |
  183|  28.9k|    if (num == 0)
  ------------------
  |  Branch (183:9): [True: 16, False: 28.8k]
  ------------------
  184|     16|        return NULL;
  185|       |
  186|  28.8k|    FAILTEST();
  187|  28.8k|    if (allow_customize) {
  ------------------
  |  Branch (187:9): [True: 2, False: 28.8k]
  ------------------
  188|       |        /*
  189|       |         * Disallow customization after the first allocation. We only set this
  190|       |         * if necessary to avoid a store to the same cache line on every
  191|       |         * allocation.
  192|       |         */
  193|      2|        allow_customize = 0;
  194|      2|    }
  195|       |
  196|  28.8k|    ptr = malloc(num);
  197|  28.8k|    if (ptr != NULL)
  ------------------
  |  Branch (197:9): [True: 28.8k, False: 0]
  ------------------
  198|  28.8k|        return ptr;
  199|      0| err:
  200|       |    /*
  201|       |     * ossl_err_get_state_int() in err.c uses CRYPTO_zalloc(num, NULL, 0) for
  202|       |     * ERR_STATE allocation. Prevent mem alloc error loop while reporting error.
  203|       |     */
  204|      0|    if (file != NULL || line != 0) {
  ------------------
  |  Branch (204:9): [True: 0, False: 0]
  |  Branch (204:25): [True: 0, False: 0]
  ------------------
  205|      0|        ERR_new();
  206|      0|        ERR_set_debug(file, line, NULL);
  207|      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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|      0|    }
  209|      0|    return NULL;
  210|  28.8k|}
CRYPTO_zalloc:
  213|  15.2k|{
  214|  15.2k|    void *ret;
  215|       |
  216|  15.2k|    ret = CRYPTO_malloc(num, file, line);
  217|  15.2k|    if (ret != NULL)
  ------------------
  |  Branch (217:9): [True: 15.2k, False: 0]
  ------------------
  218|  15.2k|        memset(ret, 0, num);
  219|       |
  220|  15.2k|    return ret;
  221|  15.2k|}
CRYPTO_realloc:
  224|     14|{
  225|     14|    INCREMENT(realloc_count);
  226|     14|    if (realloc_impl != CRYPTO_realloc)
  ------------------
  |  Branch (226:9): [True: 0, False: 14]
  ------------------
  227|      0|        return realloc_impl(str, num, file, line);
  228|       |
  229|     14|    if (str == NULL)
  ------------------
  |  Branch (229:9): [True: 0, False: 14]
  ------------------
  230|      0|        return CRYPTO_malloc(num, file, line);
  231|       |
  232|     14|    if (num == 0) {
  ------------------
  |  Branch (232:9): [True: 0, False: 14]
  ------------------
  233|      0|        CRYPTO_free(str, file, line);
  234|      0|        return NULL;
  235|      0|    }
  236|       |
  237|     14|    FAILTEST();
  238|     14|    return realloc(str, num);
  239|     14|}
CRYPTO_clear_realloc:
  243|  4.13k|{
  244|  4.13k|    void *ret = NULL;
  245|       |
  246|  4.13k|    if (str == NULL)
  ------------------
  |  Branch (246:9): [True: 1.71k, False: 2.42k]
  ------------------
  247|  1.71k|        return CRYPTO_malloc(num, file, line);
  248|       |
  249|  2.42k|    if (num == 0) {
  ------------------
  |  Branch (249:9): [True: 0, False: 2.42k]
  ------------------
  250|      0|        CRYPTO_clear_free(str, old_len, file, line);
  251|      0|        return NULL;
  252|      0|    }
  253|       |
  254|       |    /* Can't shrink the buffer since memcpy below copies |old_len| bytes. */
  255|  2.42k|    if (num < old_len) {
  ------------------
  |  Branch (255:9): [True: 0, False: 2.42k]
  ------------------
  256|      0|        OPENSSL_cleanse((char*)str + num, old_len - num);
  257|      0|        return str;
  258|      0|    }
  259|       |
  260|  2.42k|    ret = CRYPTO_malloc(num, file, line);
  261|  2.42k|    if (ret != NULL) {
  ------------------
  |  Branch (261:9): [True: 2.42k, False: 0]
  ------------------
  262|  2.42k|        memcpy(ret, str, old_len);
  263|  2.42k|        CRYPTO_clear_free(str, old_len, file, line);
  264|  2.42k|    }
  265|  2.42k|    return ret;
  266|  2.42k|}
CRYPTO_free:
  269|  81.4k|{
  270|  81.4k|    INCREMENT(free_count);
  271|  81.4k|    if (free_impl != CRYPTO_free) {
  ------------------
  |  Branch (271:9): [True: 0, False: 81.4k]
  ------------------
  272|      0|        free_impl(str, file, line);
  273|      0|        return;
  274|      0|    }
  275|       |
  276|  81.4k|    free(str);
  277|  81.4k|}
CRYPTO_clear_free:
  280|  4.13k|{
  281|  4.13k|    if (str == NULL)
  ------------------
  |  Branch (281:9): [True: 0, False: 4.13k]
  ------------------
  282|      0|        return;
  283|  4.13k|    if (num)
  ------------------
  |  Branch (283:9): [True: 4.13k, False: 0]
  ------------------
  284|  4.13k|        OPENSSL_cleanse(str, num);
  285|  4.13k|    CRYPTO_free(str, file, line);
  286|  4.13k|}

CRYPTO_secure_malloc_done:
  132|      2|{
  133|      2|#ifndef OPENSSL_NO_SECURE_MEMORY
  134|      2|    if (secure_mem_used == 0) {
  ------------------
  |  Branch (134:9): [True: 2, False: 0]
  ------------------
  135|      2|        sh_done();
  136|      2|        secure_mem_initialized = 0;
  137|      2|        CRYPTO_THREAD_lock_free(sec_malloc_lock);
  138|      2|        sec_malloc_lock = NULL;
  139|      2|        return 1;
  140|      2|    }
  141|      0|#endif /* OPENSSL_NO_SECURE_MEMORY */
  142|      0|    return 0;
  143|      2|}
CRYPTO_secure_malloc:
  155|  2.34k|{
  156|  2.34k|#ifndef OPENSSL_NO_SECURE_MEMORY
  157|  2.34k|    void *ret = NULL;
  158|  2.34k|    size_t actual_size;
  159|  2.34k|    int reason = CRYPTO_R_SECURE_MALLOC_FAILURE;
  ------------------
  |  |   47|  2.34k|# define CRYPTO_R_SECURE_MALLOC_FAILURE                   111
  ------------------
  160|       |
  161|  2.34k|    if (!secure_mem_initialized) {
  ------------------
  |  Branch (161:9): [True: 2.34k, False: 0]
  ------------------
  162|  2.34k|        return CRYPTO_malloc(num, file, line);
  163|  2.34k|    }
  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_free:
  195|  1.46k|{
  196|  1.46k|#ifndef OPENSSL_NO_SECURE_MEMORY
  197|  1.46k|    size_t actual_size;
  198|       |
  199|  1.46k|    if (ptr == NULL)
  ------------------
  |  Branch (199:9): [True: 1.32k, False: 144]
  ------------------
  200|  1.32k|        return;
  201|    144|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (201:9): [True: 144, False: 0]
  ------------------
  202|    144|        CRYPTO_free(ptr, file, line);
  203|    144|        return;
  204|    144|    }
  205|      0|    if (!CRYPTO_THREAD_write_lock(sec_malloc_lock))
  ------------------
  |  Branch (205:9): [True: 0, False: 0]
  ------------------
  206|      0|        return;
  207|      0|    actual_size = sh_actual_size(ptr);
  208|      0|    CLEAR(ptr, actual_size);
  ------------------
  |  |   82|      0|#define CLEAR(p, s) OPENSSL_cleanse(p, s)
  ------------------
  209|      0|    secure_mem_used -= actual_size;
  210|      0|    sh_free(ptr);
  211|      0|    CRYPTO_THREAD_unlock(sec_malloc_lock);
  212|       |#else
  213|       |    CRYPTO_free(ptr, file, line);
  214|       |#endif /* OPENSSL_NO_SECURE_MEMORY */
  215|      0|}
CRYPTO_secure_clear_free:
  219|  2.43k|{
  220|  2.43k|#ifndef OPENSSL_NO_SECURE_MEMORY
  221|  2.43k|    size_t actual_size;
  222|       |
  223|  2.43k|    if (ptr == NULL)
  ------------------
  |  Branch (223:9): [True: 238, False: 2.19k]
  ------------------
  224|    238|        return;
  225|  2.19k|    if (!CRYPTO_secure_allocated(ptr)) {
  ------------------
  |  Branch (225:9): [True: 2.19k, False: 0]
  ------------------
  226|  2.19k|        OPENSSL_cleanse(ptr, num);
  227|  2.19k|        CRYPTO_free(ptr, file, line);
  228|  2.19k|        return;
  229|  2.19k|    }
  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|  2.33k|{
  247|  2.33k|#ifndef OPENSSL_NO_SECURE_MEMORY
  248|  2.33k|    if (!secure_mem_initialized)
  ------------------
  |  Branch (248:9): [True: 2.33k, False: 0]
  ------------------
  249|  2.33k|        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|  2.33k|}
mem_sec.c:sh_done:
  595|      2|{
  596|      2|    OPENSSL_free(sh.freelist);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  597|      2|    OPENSSL_free(sh.bittable);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  598|      2|    OPENSSL_free(sh.bitmalloc);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  599|      2|#if !defined(_WIN32)
  600|      2|    if (sh.map_result != MAP_FAILED && sh.map_size)
  ------------------
  |  Branch (600:9): [True: 2, False: 0]
  |  Branch (600:40): [True: 0, False: 2]
  ------------------
  601|      0|        munmap(sh.map_result, sh.map_size);
  602|       |#else
  603|       |    if (sh.map_result != NULL && sh.map_size)
  604|       |        VirtualFree(sh.map_result, 0, MEM_RELEASE);
  605|       |#endif
  606|      2|    memset(&sh, 0, sizeof(sh));
  607|      2|}

OBJ_NAME_cleanup:
  368|      8|{
  369|      8|    unsigned long down_load;
  370|       |
  371|      8|    if (names_lh == NULL)
  ------------------
  |  Branch (371:9): [True: 8, False: 0]
  ------------------
  372|      8|        return;
  373|       |
  374|      0|    free_type = type;
  375|      0|    down_load = lh_OBJ_NAME_get_down_load(names_lh);
  376|      0|    lh_OBJ_NAME_set_down_load(names_lh, 0);
  377|       |
  378|      0|    lh_OBJ_NAME_doall(names_lh, names_lh_free_doall);
  379|      0|    if (type < 0) {
  ------------------
  |  Branch (379:9): [True: 0, False: 0]
  ------------------
  380|      0|        lh_OBJ_NAME_free(names_lh);
  381|      0|        sk_NAME_FUNCS_pop_free(name_funcs_stack, name_funcs_free);
  382|      0|        CRYPTO_THREAD_lock_free(obj_lock);
  383|      0|        names_lh = NULL;
  384|      0|        name_funcs_stack = NULL;
  385|      0|        obj_lock = NULL;
  386|      0|    } else
  387|      0|        lh_OBJ_NAME_set_down_load(names_lh, down_load);
  388|      0|}

ossl_obj_cleanup_int:
  212|      2|{
  213|      2|    if (added != NULL) {
  ------------------
  |  Branch (213:9): [True: 0, False: 2]
  ------------------
  214|      0|        lh_ADDED_OBJ_set_down_load(added, 0);
  215|      0|        lh_ADDED_OBJ_doall(added, cleanup1_doall); /* zero counters */
  216|      0|        lh_ADDED_OBJ_doall(added, cleanup2_doall); /* set counters */
  217|      0|        lh_ADDED_OBJ_doall(added, cleanup3_doall); /* free objects */
  218|      0|        lh_ADDED_OBJ_free(added);
  219|      0|        added = NULL;
  220|      0|    }
  221|      2|    objs_free_locks();
  222|      2|}
obj_dat.c:objs_free_locks:
   49|      2|{
   50|      2|    CRYPTO_THREAD_lock_free(ossl_obj_lock);
   51|      2|    ossl_obj_lock = NULL;
   52|       |#ifdef TSAN_REQUIRES_LOCKING
   53|       |    CRYPTO_THREAD_lock_free(ossl_obj_nid_lock);
   54|       |    ossl_obj_nid_lock = NULL;
   55|       |#endif
   56|      2|}

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

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

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

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

PEM_read_bio_ex:
  926|  1.24k|{
  927|  1.24k|    EVP_ENCODE_CTX *ctx = NULL;
  928|  1.24k|    const BIO_METHOD *bmeth;
  929|  1.24k|    BIO *headerB = NULL, *dataB = NULL;
  930|  1.24k|    char *name = NULL;
  931|  1.24k|    int len, taillen, headerlen, ret = 0;
  932|  1.24k|    BUF_MEM *buf_mem;
  933|       |
  934|  1.24k|    *len_out = 0;
  935|  1.24k|    *name_out = *header = NULL;
  936|  1.24k|    *data = NULL;
  937|  1.24k|    if ((flags & PEM_FLAG_EAY_COMPATIBLE) && (flags & PEM_FLAG_ONLY_B64)) {
  ------------------
  |  |  380|  1.24k|#   define PEM_FLAG_EAY_COMPATIBLE     0x2
  ------------------
                  if ((flags & PEM_FLAG_EAY_COMPATIBLE) && (flags & PEM_FLAG_ONLY_B64)) {
  ------------------
  |  |  381|    412|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  |  Branch (937:9): [True: 412, False: 828]
  |  Branch (937:46): [True: 3, False: 409]
  ------------------
  938|       |        /* These two are mutually incompatible; bail out. */
  939|      3|        ERR_raise(ERR_LIB_PEM, ERR_R_PASSED_INVALID_ARGUMENT);
  ------------------
  |  |  401|      3|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      3|    (ERR_new(),                                                 \
  |  |  |  |  404|      3|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      3|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      3|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      3|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      3|     ERR_set_error)
  |  |  ------------------
  ------------------
  940|      3|        goto end;
  941|      3|    }
  942|  1.23k|    bmeth = (flags & PEM_FLAG_SECURE) ? BIO_s_secmem() : BIO_s_mem();
  ------------------
  |  |  379|  1.23k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (942:13): [True: 486, False: 751]
  ------------------
  943|       |
  944|  1.23k|    headerB = BIO_new(bmeth);
  945|  1.23k|    dataB = BIO_new(bmeth);
  946|  1.23k|    if (headerB == NULL || dataB == NULL) {
  ------------------
  |  Branch (946:9): [True: 0, False: 1.23k]
  |  Branch (946:28): [True: 0, False: 1.23k]
  ------------------
  947|      0|        ERR_raise(ERR_LIB_PEM, ERR_R_BIO_LIB);
  ------------------
  |  |  401|      0|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|      0|    (ERR_new(),                                                 \
  |  |  |  |  404|      0|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  948|      0|        goto end;
  949|      0|    }
  950|       |
  951|  1.23k|    if (!get_name(bp, &name, flags))
  ------------------
  |  Branch (951:9): [True: 364, False: 873]
  ------------------
  952|    364|        goto end;
  953|    873|    if (!get_header_and_data(bp, &headerB, &dataB, name, flags))
  ------------------
  |  Branch (953:9): [True: 613, False: 260]
  ------------------
  954|    613|        goto end;
  955|       |
  956|    260|    BIO_get_mem_ptr(dataB, &buf_mem);
  ------------------
  |  |  608|    260|# define BIO_get_mem_ptr(b,pp)   BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0, \
  |  |  ------------------
  |  |  |  |  440|    260|# define BIO_C_GET_BUF_MEM_PTR                   115
  |  |  ------------------
  |  |  609|    260|                                          (char *)(pp))
  ------------------
  957|    260|    len = buf_mem->length;
  958|       |
  959|       |    /* There was no data in the PEM file */
  960|    260|    if (len == 0)
  ------------------
  |  Branch (960:9): [True: 3, False: 257]
  ------------------
  961|      3|        goto end;
  962|       |
  963|    257|    ctx = EVP_ENCODE_CTX_new();
  964|    257|    if (ctx == NULL) {
  ------------------
  |  Branch (964:9): [True: 0, False: 257]
  ------------------
  965|      0|        ERR_raise(ERR_LIB_PEM, 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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  966|      0|        goto end;
  967|      0|    }
  968|       |
  969|    257|    EVP_DecodeInit(ctx);
  970|    257|    if (EVP_DecodeUpdate(ctx, (unsigned char*)buf_mem->data, &len,
  ------------------
  |  Branch (970:9): [True: 34, False: 223]
  ------------------
  971|    257|                         (unsigned char*)buf_mem->data, len) < 0
  972|    257|            || EVP_DecodeFinal(ctx, (unsigned char*)&(buf_mem->data[len]),
  ------------------
  |  Branch (972:16): [True: 48, False: 175]
  ------------------
  973|    223|                               &taillen) < 0) {
  974|     82|        ERR_raise(ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE);
  ------------------
  |  |  401|     82|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     82|    (ERR_new(),                                                 \
  |  |  |  |  404|     82|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     82|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     82|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     82|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     82|     ERR_set_error)
  |  |  ------------------
  ------------------
  975|     82|        goto end;
  976|     82|    }
  977|    175|    len += taillen;
  978|    175|    buf_mem->length = len;
  979|       |
  980|    175|    headerlen = BIO_get_mem_data(headerB, NULL);
  ------------------
  |  |  606|    175|# define BIO_get_mem_data(b,pp)  BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)(pp))
  |  |  ------------------
  |  |  |  |   87|    175|# define BIO_CTRL_INFO           3/* opt - extra tit-bits */
  |  |  ------------------
  ------------------
  981|    175|    *header = PEM_MALLOC(headerlen + 1, flags);
  ------------------
  |  |  233|    175|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    175|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    175|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  982|    175|    *data = PEM_MALLOC(len, flags);
  ------------------
  |  |  233|    175|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    175|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    175|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  983|    175|    if (*header == NULL || *data == NULL)
  ------------------
  |  Branch (983:9): [True: 0, False: 175]
  |  Branch (983:28): [True: 16, False: 159]
  ------------------
  984|     16|        goto out_free;
  985|    159|    if (headerlen != 0 && BIO_read(headerB, *header, headerlen) != headerlen)
  ------------------
  |  Branch (985:9): [True: 48, False: 111]
  |  Branch (985:27): [True: 0, False: 48]
  ------------------
  986|      0|        goto out_free;
  987|    159|    (*header)[headerlen] = '\0';
  988|    159|    if (BIO_read(dataB, *data, len) != len)
  ------------------
  |  Branch (988:9): [True: 0, False: 159]
  ------------------
  989|      0|        goto out_free;
  990|    159|    *len_out = len;
  991|    159|    *name_out = name;
  992|    159|    name = NULL;
  993|    159|    ret = 1;
  994|    159|    goto end;
  995|       |
  996|     16|out_free:
  997|     16|    PEM_FREE(*header, flags, 0);
  ------------------
  |  |  222|     16|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  998|     16|    *header = NULL;
  999|     16|    PEM_FREE(*data, flags, 0);
  ------------------
  |  |  222|     16|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     16|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     16|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1000|     16|    *data = NULL;
 1001|  1.24k|end:
 1002|  1.24k|    EVP_ENCODE_CTX_free(ctx);
 1003|  1.24k|    PEM_FREE(name, flags, 0);
  ------------------
  |  |  222|  1.24k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.24k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.24k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
 1004|  1.24k|    BIO_free(headerB);
 1005|  1.24k|    BIO_free(dataB);
 1006|  1.24k|    return ret;
 1007|     16|}
pem_lib.c:get_name:
  755|  1.23k|{
  756|  1.23k|    char *linebuf;
  757|  1.23k|    int ret = 0;
  758|  1.23k|    int len;
  759|  1.23k|    int first_call = 1;
  760|       |
  761|       |    /*
  762|       |     * Need to hold trailing NUL (accounted for by BIO_gets() and the newline
  763|       |     * that will be added by sanitize_line() (the extra '1').
  764|       |     */
  765|  1.23k|    linebuf = PEM_MALLOC(LINESIZE + 1, flags);
  ------------------
  |  |  233|  1.23k|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.23k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.23k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  766|  1.23k|    if (linebuf == NULL)
  ------------------
  |  Branch (766:9): [True: 0, False: 1.23k]
  ------------------
  767|      0|        return 0;
  768|       |
  769|   145k|    do {
  770|   145k|        len = BIO_gets(bp, linebuf, LINESIZE);
  ------------------
  |  |  746|   145k|#define LINESIZE 255
  ------------------
  771|       |
  772|   145k|        if (len <= 0) {
  ------------------
  |  Branch (772:13): [True: 364, False: 145k]
  ------------------
  773|    364|            ERR_raise(ERR_LIB_PEM, PEM_R_NO_START_LINE);
  ------------------
  |  |  401|    364|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    364|    (ERR_new(),                                                 \
  |  |  |  |  404|    364|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    364|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    364|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    364|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    364|     ERR_set_error)
  |  |  ------------------
  ------------------
  774|    364|            goto err;
  775|    364|        }
  776|       |
  777|       |        /* Strip trailing garbage and standardize ending. */
  778|   145k|        len = sanitize_line(linebuf, len, flags & ~PEM_FLAG_ONLY_B64, first_call);
  ------------------
  |  |  381|   145k|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  779|   145k|        first_call = 0;
  780|       |
  781|       |        /* Allow leading empty or non-matching lines. */
  782|   145k|    } while (!HAS_PREFIX(linebuf, BEGINSTR)
  ------------------
  |  |   58|   291k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (782:14): [True: 144k, False: 1.13k]
  ------------------
  783|   145k|             || len < TAILLEN
  ------------------
  |  |  753|   146k|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  750|  1.13k|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  |  Branch (783:17): [True: 0, False: 1.13k]
  ------------------
  784|   145k|             || !HAS_PREFIX(linebuf + len - TAILLEN, TAILSTR));
  ------------------
  |  |   58|  1.13k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (784:17): [True: 264, False: 873]
  ------------------
  785|    873|    linebuf[len - TAILLEN] = '\0';
  ------------------
  |  |  753|    873|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  750|    873|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  786|    873|    len = len - BEGINLEN - TAILLEN + 1;
  ------------------
  |  |  751|    873|#define BEGINLEN ((int)(sizeof(BEGINSTR) - 1))
  |  |  ------------------
  |  |  |  |  748|    873|#define BEGINSTR "-----BEGIN "
  |  |  ------------------
  ------------------
                  len = len - BEGINLEN - TAILLEN + 1;
  ------------------
  |  |  753|    873|#define TAILLEN ((int)(sizeof(TAILSTR) - 1))
  |  |  ------------------
  |  |  |  |  750|    873|#define TAILSTR "-----\n"
  |  |  ------------------
  ------------------
  787|    873|    *name = PEM_MALLOC(len, flags);
  ------------------
  |  |  233|    873|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    873|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    873|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  788|    873|    if (*name == NULL)
  ------------------
  |  Branch (788:9): [True: 0, False: 873]
  ------------------
  789|      0|        goto err;
  790|    873|    memcpy(*name, linebuf + BEGINLEN, len);
  ------------------
  |  |  751|    873|#define BEGINLEN ((int)(sizeof(BEGINSTR) - 1))
  |  |  ------------------
  |  |  |  |  748|    873|#define BEGINSTR "-----BEGIN "
  |  |  ------------------
  ------------------
  791|    873|    ret = 1;
  792|       |
  793|  1.23k|err:
  794|  1.23k|    PEM_FREE(linebuf, flags, LINESIZE + 1);
  ------------------
  |  |  222|  1.23k|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|  1.23k|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|  1.23k|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  795|  1.23k|    return ret;
  796|    873|}
pem_lib.c:sanitize_line:
  702|   515k|{
  703|   515k|    int i;
  704|   515k|    if (first_call) {
  ------------------
  |  Branch (704:9): [True: 1.23k, False: 513k]
  ------------------
  705|       |        /* Other BOMs imply unsupported multibyte encoding,
  706|       |         * so don't strip them and let the error raise */
  707|  1.23k|        const unsigned char utf8_bom[3] = {0xEF, 0xBB, 0xBF};
  708|       |
  709|  1.23k|        if (len > 3 && memcmp(linebuf, utf8_bom, 3) == 0) {
  ------------------
  |  Branch (709:13): [True: 1.11k, False: 125]
  |  Branch (709:24): [True: 2, False: 1.11k]
  ------------------
  710|      2|            memmove(linebuf, linebuf + 3, len - 3);
  711|      2|            linebuf[len - 3] = 0;
  712|      2|            len -= 3;
  713|      2|        }
  714|  1.23k|    }
  715|       |
  716|   515k|    if (flags & PEM_FLAG_EAY_COMPATIBLE) {
  ------------------
  |  |  380|   515k|#   define PEM_FLAG_EAY_COMPATIBLE     0x2
  ------------------
  |  Branch (716:9): [True: 84.4k, False: 430k]
  ------------------
  717|       |        /* Strip trailing whitespace */
  718|  1.40M|        while ((len >= 0) && (linebuf[len] <= ' '))
  ------------------
  |  Branch (718:16): [True: 1.39M, False: 10.4k]
  |  Branch (718:30): [True: 1.31M, False: 74.0k]
  ------------------
  719|  1.31M|            len--;
  720|       |        /* Go back to whitespace before applying uniform line ending. */
  721|  84.4k|        len++;
  722|   430k|    } else if (flags & PEM_FLAG_ONLY_B64) {
  ------------------
  |  |  381|   430k|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  |  Branch (722:16): [True: 3.89k, False: 426k]
  ------------------
  723|   651k|        for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (723:21): [True: 649k, False: 2.50k]
  ------------------
  724|   649k|            if (!ossl_isbase64(linebuf[i]) || linebuf[i] == '\n'
  ------------------
  |  |   84|  1.29M|# define ossl_isbase64(c)       (ossl_ctype_check((c), CTYPE_MASK_base64))
  |  |  ------------------
  |  |  |  |   37|   649k|# define CTYPE_MASK_base64      0x400
  |  |  ------------------
  ------------------
  |  Branch (724:17): [True: 1.39k, False: 647k]
  |  Branch (724:47): [True: 0, False: 647k]
  ------------------
  725|   649k|                || linebuf[i] == '\r')
  ------------------
  |  Branch (725:20): [True: 0, False: 647k]
  ------------------
  726|  1.39k|                break;
  727|   649k|        }
  728|  3.89k|        len = i;
  729|   426k|    } else {
  730|       |        /* EVP_DecodeBlock strips leading and trailing whitespace, so just strip
  731|       |         * control characters in-place and let everything through. */
  732|  27.4M|        for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (732:21): [True: 27.3M, False: 86.8k]
  ------------------
  733|  27.3M|            if (linebuf[i] == '\n' || linebuf[i] == '\r')
  ------------------
  |  Branch (733:17): [True: 339k, False: 27.0M]
  |  Branch (733:39): [True: 651, False: 27.0M]
  ------------------
  734|   339k|                break;
  735|  27.0M|            if (ossl_iscntrl(linebuf[i]))
  ------------------
  |  |   78|  27.0M|# define ossl_iscntrl(c)        (ossl_ctype_check((c), CTYPE_MASK_cntrl))
  |  |  ------------------
  |  |  |  |   33|  27.0M|# define CTYPE_MASK_cntrl       0x40
  |  |  ------------------
  |  |  |  Branch (78:33): [True: 9.88M, False: 17.1M]
  |  |  ------------------
  ------------------
  736|  9.88M|                linebuf[i] = ' ';
  737|  27.0M|        }
  738|   426k|        len = i;
  739|   426k|    }
  740|       |    /* The caller allocated LINESIZE+1, so this is safe. */
  741|   515k|    linebuf[len++] = '\n';
  742|   515k|    linebuf[len] = '\0';
  743|   515k|    return len;
  744|   515k|}
pem_lib.c:get_header_and_data:
  818|    873|{
  819|    873|    BIO *tmp = *header;
  820|    873|    char *linebuf, *p;
  821|    873|    int len, ret = 0, end = 0, prev_partial_line_read = 0, partial_line_read = 0;
  822|       |    /* 0 if not seen (yet), 1 if reading header, 2 if finished header */
  823|    873|    enum header_status got_header = MAYBE_HEADER;
  824|    873|    unsigned int flags_mask;
  825|    873|    size_t namelen;
  826|       |
  827|       |    /* Need to hold trailing NUL (accounted for by BIO_gets() and the newline
  828|       |     * that will be added by sanitize_line() (the extra '1'). */
  829|    873|    linebuf = PEM_MALLOC(LINESIZE + 1, flags);
  ------------------
  |  |  233|    873|    pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    873|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_malloc((num), (flags), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    873|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  830|    873|    if (linebuf == NULL)
  ------------------
  |  Branch (830:9): [True: 0, False: 873]
  ------------------
  831|      0|        return 0;
  832|       |
  833|   369k|    while(1) {
  ------------------
  |  Branch (833:11): [Folded - Ignored]
  ------------------
  834|   369k|        flags_mask = ~0u;
  835|   369k|        len = BIO_gets(bp, linebuf, LINESIZE);
  ------------------
  |  |  746|   369k|#define LINESIZE 255
  ------------------
  836|   369k|        if (len <= 0) {
  ------------------
  |  Branch (836:13): [True: 369, False: 369k]
  ------------------
  837|    369|            ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|    369|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    369|    (ERR_new(),                                                 \
  |  |  |  |  404|    369|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    369|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    369|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    369|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    369|     ERR_set_error)
  |  |  ------------------
  ------------------
  838|    369|            goto err;
  839|    369|        }
  840|       |
  841|       |        /*
  842|       |         * Check if line has been read completely or if only part of the line
  843|       |         * has been read. Keep the previous value to ignore newlines that
  844|       |         * appear due to reading a line up until the char before the newline.
  845|       |         */
  846|   369k|        prev_partial_line_read = partial_line_read;
  847|   369k|        partial_line_read = len == LINESIZE-1 && linebuf[LINESIZE-2] != '\n';
  ------------------
  |  |  746|   369k|#define LINESIZE 255
  ------------------
                      partial_line_read = len == LINESIZE-1 && linebuf[LINESIZE-2] != '\n';
  ------------------
  |  |  746|   118k|#define LINESIZE 255
  ------------------
  |  Branch (847:29): [True: 118k, False: 251k]
  |  Branch (847:50): [True: 118k, False: 196]
  ------------------
  848|       |
  849|   369k|        if (got_header == MAYBE_HEADER) {
  ------------------
  |  Branch (849:13): [True: 257k, False: 111k]
  ------------------
  850|   257k|            if (memchr(linebuf, ':', len) != NULL)
  ------------------
  |  Branch (850:17): [True: 88, False: 257k]
  ------------------
  851|     88|                got_header = IN_HEADER;
  852|   257k|        }
  853|   369k|        if (HAS_PREFIX(linebuf, ENDSTR) || got_header == IN_HEADER)
  ------------------
  |  |   58|   738k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  ------------------
  |  |  |  Branch (58:30): [True: 705, False: 368k]
  |  |  ------------------
  ------------------
  |  Branch (853:44): [True: 110k, False: 258k]
  ------------------
  854|   111k|            flags_mask &= ~PEM_FLAG_ONLY_B64;
  ------------------
  |  |  381|   111k|#   define PEM_FLAG_ONLY_B64           0x4
  ------------------
  855|   369k|        len = sanitize_line(linebuf, len, flags & flags_mask, 0);
  856|       |
  857|       |        /* Check for end of header. */
  858|   369k|        if (linebuf[0] == '\n') {
  ------------------
  |  Branch (858:13): [True: 1.47k, False: 367k]
  ------------------
  859|       |            /*
  860|       |             * If previous line has been read only partially this newline is a
  861|       |             * regular newline at the end of a line and not an empty line.
  862|       |             */
  863|  1.47k|            if (!prev_partial_line_read) {
  ------------------
  |  Branch (863:17): [True: 175, False: 1.29k]
  ------------------
  864|    175|                if (got_header == POST_HEADER) {
  ------------------
  |  Branch (864:21): [True: 22, False: 153]
  ------------------
  865|       |                    /* Another blank line is an error. */
  866|     22|                    ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|     22|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|     22|    (ERR_new(),                                                 \
  |  |  |  |  404|     22|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|     22|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|     22|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|     22|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|     22|     ERR_set_error)
  |  |  ------------------
  ------------------
  867|     22|                    goto err;
  868|     22|                }
  869|    153|                got_header = POST_HEADER;
  870|    153|                tmp = *data;
  871|    153|            }
  872|  1.45k|            continue;
  873|  1.47k|        }
  874|       |
  875|       |        /* Check for end of stream (which means there is no header). */
  876|   367k|        p = linebuf;
  877|   367k|        if (CHECK_AND_SKIP_PREFIX(p, ENDSTR)) {
  ------------------
  |  |   61|   367k|    (HAS_PREFIX(str, pre) ? ((str) += sizeof(pre) - 1, 1) : 0)
  |  |  ------------------
  |  |  |  |   58|   367k|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (58:30): [True: 467, False: 367k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (61:5): [True: 467, False: 367k]
  |  |  ------------------
  ------------------
  878|    467|            namelen = strlen(name);
  879|    467|            if (strncmp(p, name, namelen) != 0 ||
  ------------------
  |  Branch (879:17): [True: 148, False: 319]
  ------------------
  880|    467|                !HAS_PREFIX(p + namelen, TAILSTR)) {
  ------------------
  |  |   58|    319|#define HAS_PREFIX(str, pre) (strncmp(str, pre "", sizeof(pre) - 1) == 0)
  ------------------
  |  Branch (880:17): [True: 59, False: 260]
  ------------------
  881|    207|                ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  401|    207|# define ERR_raise(lib, reason) ERR_raise_data((lib),(reason),NULL)
  |  |  ------------------
  |  |  |  |  403|    207|    (ERR_new(),                                                 \
  |  |  |  |  404|    207|     ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|    207|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|    207|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|    207|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|    207|     ERR_set_error)
  |  |  ------------------
  ------------------
  882|    207|                goto err;
  883|    207|            }
  884|    260|            if (got_header == MAYBE_HEADER) {
  ------------------
  |  Branch (884:17): [True: 204, False: 56]
  ------------------
  885|    204|                *header = *data;
  886|    204|                *data = tmp;
  887|    204|            }
  888|    260|            break;
  889|   367k|        } else if (end) {
  ------------------
  |  Branch (889:20): [True: 7, False: 367k]
  ------------------
  890|       |            /* Malformed input; short line not at end of data. */
  891|      7|            ERR_raise(ERR_LIB_PEM, PEM_R_BAD_END_LINE);
  ------------------
  |  |  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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      7|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      7|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      7|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      7|     ERR_set_error)
  |  |  ------------------
  ------------------
  892|      7|            goto err;
  893|      7|        }
  894|       |        /*
  895|       |         * Else, a line of text -- could be header or data; we don't
  896|       |         * know yet.  Just pass it through.
  897|       |         */
  898|   367k|        if (BIO_puts(tmp, linebuf) < 0)
  ------------------
  |  Branch (898:13): [True: 0, False: 367k]
  ------------------
  899|      0|            goto err;
  900|       |        /*
  901|       |         * Only encrypted files need the line length check applied.
  902|       |         */
  903|   367k|        if (got_header == POST_HEADER) {
  ------------------
  |  Branch (903:13): [True: 446, False: 367k]
  ------------------
  904|       |            /* 65 includes the trailing newline */
  905|    446|            if (len > 65)
  ------------------
  |  Branch (905:17): [True: 8, False: 438]
  ------------------
  906|      8|                goto err;
  907|    438|            if (len < 65)
  ------------------
  |  Branch (907:17): [True: 91, False: 347]
  ------------------
  908|     91|                end = 1;
  909|    438|        }
  910|   367k|    }
  911|       |
  912|    260|    ret = 1;
  913|    873|err:
  914|    873|    PEM_FREE(linebuf, flags, LINESIZE + 1);
  ------------------
  |  |  222|    873|    pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    873|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   pem_free((p), (flags), (num), OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    873|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  915|    873|    return ret;
  916|    260|}
pem_lib.c:pem_malloc:
  236|  3.33k|{
  237|  3.33k|    return (flags & PEM_FLAG_SECURE) ? CRYPTO_secure_malloc(num, file, line)
  ------------------
  |  |  379|  3.33k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (237:12): [True: 1.21k, False: 2.11k]
  ------------------
  238|  3.33k|                                     : CRYPTO_malloc(num, file, line);
  239|       |
  240|  3.33k|}
pem_lib.c:pem_free:
  225|  3.38k|{
  226|  3.38k|    if (flags & PEM_FLAG_SECURE)
  ------------------
  |  |  379|  3.38k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (226:9): [True: 1.29k, False: 2.08k]
  ------------------
  227|  1.29k|        CRYPTO_secure_clear_free(p, num, file, line);
  228|  2.08k|    else
  229|  2.08k|        CRYPTO_free(p, file, line);
  230|  3.38k|}

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

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

ossl_property_defns_free:
   52|      2|{
   53|      2|    LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns = vproperty_defns;
  ------------------
  |  |  135|      2|# define LHASH_OF(type) struct lhash_st_##type
  ------------------
   54|       |
   55|      2|    if (property_defns != NULL) {
  ------------------
  |  Branch (55:9): [True: 2, False: 0]
  ------------------
   56|      2|        lh_PROPERTY_DEFN_ELEM_doall(property_defns,
   57|      2|                                    &property_defn_free);
   58|      2|        lh_PROPERTY_DEFN_ELEM_free(property_defns);
   59|      2|    }
   60|      2|}
ossl_property_defns_new:
   62|      2|void *ossl_property_defns_new(OSSL_LIB_CTX *ctx) {
   63|      2|    return lh_PROPERTY_DEFN_ELEM_new(&property_defn_hash, &property_defn_cmp);
   64|      2|}

ossl_ctx_global_properties_free:
  112|      2|{
  113|      2|    OSSL_GLOBAL_PROPERTIES *globp = vglobp;
  114|       |
  115|      2|    if (globp != NULL) {
  ------------------
  |  Branch (115:9): [True: 2, False: 0]
  ------------------
  116|      2|        ossl_property_free(globp->list);
  117|      2|        OPENSSL_free(globp);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  118|      2|    }
  119|      2|}
ossl_ctx_global_properties_new:
  122|      2|{
  123|      2|    return OPENSSL_zalloc(sizeof(OSSL_GLOBAL_PROPERTIES));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  124|      2|}
ossl_method_store_new:
  241|      8|{
  242|      8|    OSSL_METHOD_STORE *res;
  243|       |
  244|      8|    res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |   99|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  245|      8|    if (res != NULL) {
  ------------------
  |  Branch (245:9): [True: 8, False: 0]
  ------------------
  246|      8|        res->ctx = ctx;
  247|      8|        if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL
  ------------------
  |  Branch (247:13): [True: 0, False: 8]
  ------------------
  248|      8|            || (res->lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (248:16): [True: 0, False: 8]
  ------------------
  249|      8|            || (res->biglock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (249:16): [True: 0, False: 8]
  ------------------
  250|      0|            ossl_method_store_free(res);
  251|      0|            return NULL;
  252|      0|        }
  253|      8|    }
  254|      8|    return res;
  255|      8|}
ossl_method_store_free:
  258|      8|{
  259|      8|    if (store != NULL) {
  ------------------
  |  Branch (259:9): [True: 8, False: 0]
  ------------------
  260|      8|        if (store->algs != NULL)
  ------------------
  |  Branch (260:13): [True: 8, False: 0]
  ------------------
  261|      8|            ossl_sa_ALGORITHM_doall_arg(store->algs, &alg_cleanup, store);
  262|      8|        ossl_sa_ALGORITHM_free(store->algs);
  263|      8|        CRYPTO_THREAD_lock_free(store->lock);
  264|      8|        CRYPTO_THREAD_lock_free(store->biglock);
  265|      8|        OPENSSL_free(store);
  ------------------
  |  |  107|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  266|      8|    }
  267|      8|}

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

ossl_property_free:
  499|      2|{
  500|      2|    OPENSSL_free(p);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  501|      2|}
ossl_property_parse_init:
  545|      2|{
  546|      2|    static const char *const predefined_names[] = {
  547|      2|        "provider",     /* Name of provider (default, legacy, fips) */
  548|      2|        "version",      /* Version number of this provider */
  549|      2|        "fips",         /* FIPS validated or FIPS supporting algorithm */
  550|      2|        "output",       /* Output type for encoders */
  551|      2|        "input",        /* Input type for decoders */
  552|      2|        "structure",    /* Structure name for encoders and decoders */
  553|      2|    };
  554|      2|    size_t i;
  555|       |
  556|     14|    for (i = 0; i < OSSL_NELEM(predefined_names); i++)
  ------------------
  |  |   14|     14|# define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
  ------------------
  |  Branch (556:17): [True: 12, False: 2]
  ------------------
  557|     12|        if (ossl_property_name(ctx, predefined_names[i], 1) == 0)
  ------------------
  |  Branch (557:13): [True: 0, False: 12]
  ------------------
  558|      0|            goto err;
  559|       |
  560|       |    /*
  561|       |     * Pre-populate the two Boolean values. We must do them before any other
  562|       |     * values and in this order so that we get the same index as the global
  563|       |     * OSSL_PROPERTY_TRUE and OSSL_PROPERTY_FALSE values
  564|       |     */
  565|      2|    if ((ossl_property_value(ctx, "yes", 1) != OSSL_PROPERTY_TRUE)
  ------------------
  |  |   37|      2|#define OSSL_PROPERTY_TRUE      1
  ------------------
  |  Branch (565:9): [True: 0, False: 2]
  ------------------
  566|      2|        || (ossl_property_value(ctx, "no", 1) != OSSL_PROPERTY_FALSE))
  ------------------
  |  |   38|      2|#define OSSL_PROPERTY_FALSE     2
  ------------------
  |  Branch (566:12): [True: 0, False: 2]
  ------------------
  567|      0|        goto err;
  568|       |
  569|      2|    return 1;
  570|      0|err:
  571|      0|    return 0;
  572|      2|}

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

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

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

ossl_provider_store_free:
  286|      2|{
  287|      2|    struct provider_store_st *store = vstore;
  288|      2|    size_t i;
  289|       |
  290|      2|    if (store == NULL)
  ------------------
  |  Branch (290:9): [True: 0, False: 2]
  ------------------
  291|      0|        return;
  292|      2|    store->freeing = 1;
  293|      2|    OPENSSL_free(store->default_path);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  294|      2|    sk_OSSL_PROVIDER_pop_free(store->providers, provider_deactivate_free);
  295|      2|#ifndef FIPS_MODULE
  296|      2|    sk_OSSL_PROVIDER_CHILD_CB_pop_free(store->child_cbs,
  297|      2|                                       ossl_provider_child_cb_free);
  298|      2|#endif
  299|      2|    CRYPTO_THREAD_lock_free(store->default_path_lock);
  300|      2|    CRYPTO_THREAD_lock_free(store->lock);
  301|      2|    for (i = 0; i < store->numprovinfo; i++)
  ------------------
  |  Branch (301:17): [True: 0, False: 2]
  ------------------
  302|      0|        ossl_provider_info_clear(&store->provinfo[i]);
  303|      2|    OPENSSL_free(store->provinfo);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  304|      2|    OPENSSL_free(store);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  305|      2|}
ossl_provider_store_new:
  308|      2|{
  309|      2|    struct provider_store_st *store = OPENSSL_zalloc(sizeof(*store));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  310|       |
  311|      2|    if (store == NULL
  ------------------
  |  Branch (311:9): [True: 0, False: 2]
  ------------------
  312|      2|        || (store->providers = sk_OSSL_PROVIDER_new(ossl_provider_cmp)) == NULL
  ------------------
  |  Branch (312:12): [True: 0, False: 2]
  ------------------
  313|      2|        || (store->default_path_lock = CRYPTO_THREAD_lock_new()) == NULL
  ------------------
  |  Branch (313:12): [True: 0, False: 2]
  ------------------
  314|      2|#ifndef FIPS_MODULE
  315|      2|        || (store->child_cbs = sk_OSSL_PROVIDER_CHILD_CB_new_null()) == NULL
  ------------------
  |  Branch (315:12): [True: 0, False: 2]
  ------------------
  316|      2|#endif
  317|      2|        || (store->lock = CRYPTO_THREAD_lock_new()) == NULL) {
  ------------------
  |  Branch (317:12): [True: 0, False: 2]
  ------------------
  318|      0|        ossl_provider_store_free(store);
  319|      0|        return NULL;
  320|      0|    }
  321|      2|    store->libctx = ctx;
  322|      2|    store->use_fallbacks = 1;
  323|       |
  324|      2|    return store;
  325|      2|}

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

ossl_rand_cleanup_int:
   80|      2|{
   81|      2|# ifndef OPENSSL_NO_DEPRECATED_3_0
   82|      2|    const RAND_METHOD *meth = default_RAND_meth;
   83|       |
   84|      2|    if (!rand_inited)
  ------------------
  |  Branch (84:9): [True: 2, False: 0]
  ------------------
   85|      2|        return;
   86|       |
   87|      0|    if (meth != NULL && meth->cleanup != NULL)
  ------------------
  |  Branch (87:9): [True: 0, False: 0]
  |  Branch (87:25): [True: 0, False: 0]
  ------------------
   88|      0|        meth->cleanup();
   89|      0|    RAND_set_rand_method(NULL);
   90|      0|# endif
   91|      0|    ossl_rand_pool_cleanup();
   92|      0|# ifndef OPENSSL_NO_ENGINE
   93|      0|    CRYPTO_THREAD_lock_free(rand_engine_lock);
   94|      0|    rand_engine_lock = NULL;
   95|      0|# endif
   96|      0|# ifndef OPENSSL_NO_DEPRECATED_3_0
   97|      0|    CRYPTO_THREAD_lock_free(rand_meth_lock);
   98|      0|    rand_meth_lock = NULL;
   99|      0|# endif
  100|      0|    ossl_release_default_drbg_ctx();
  101|      0|    rand_inited = 0;
  102|      0|}
ossl_rand_ctx_new:
  453|      2|{
  454|      2|    RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  455|       |
  456|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (456:9): [True: 0, False: 2]
  ------------------
  457|      0|        return NULL;
  458|       |
  459|      2|#ifndef FIPS_MODULE
  460|       |    /*
  461|       |     * We need to ensure that base libcrypto thread handling has been
  462|       |     * initialised.
  463|       |     */
  464|      2|     OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
  ------------------
  |  |   31|      2|# define OPENSSL_INIT_BASE_ONLY              0x00040000L
  ------------------
  465|      2|#endif
  466|       |
  467|      2|    dgbl->lock = CRYPTO_THREAD_lock_new();
  468|      2|    if (dgbl->lock == NULL)
  ------------------
  |  Branch (468:9): [True: 0, False: 2]
  ------------------
  469|      0|        goto err1;
  470|       |
  471|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->private, NULL))
  ------------------
  |  Branch (471:9): [True: 0, False: 2]
  ------------------
  472|      0|        goto err1;
  473|       |
  474|      2|    if (!CRYPTO_THREAD_init_local(&dgbl->public, NULL))
  ------------------
  |  Branch (474:9): [True: 0, False: 2]
  ------------------
  475|      0|        goto err2;
  476|       |
  477|      2|    return dgbl;
  478|       |
  479|      0| err2:
  480|      0|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  481|      0| err1:
  482|      0|    CRYPTO_THREAD_lock_free(dgbl->lock);
  483|      0|    OPENSSL_free(dgbl);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  484|      0|    return NULL;
  485|      0|}
ossl_rand_ctx_free:
  488|      2|{
  489|      2|    RAND_GLOBAL *dgbl = vdgbl;
  490|       |
  491|      2|    if (dgbl == NULL)
  ------------------
  |  Branch (491:9): [True: 0, False: 2]
  ------------------
  492|      0|        return;
  493|       |
  494|      2|    CRYPTO_THREAD_lock_free(dgbl->lock);
  495|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->private);
  496|      2|    CRYPTO_THREAD_cleanup_local(&dgbl->public);
  497|      2|    EVP_RAND_CTX_free(dgbl->primary);
  498|      2|    EVP_RAND_CTX_free(dgbl->seed);
  499|      2|    OPENSSL_free(dgbl->rng_name);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  500|      2|    OPENSSL_free(dgbl->rng_cipher);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  501|      2|    OPENSSL_free(dgbl->rng_digest);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  502|      2|    OPENSSL_free(dgbl->rng_propq);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  503|      2|    OPENSSL_free(dgbl->seed_name);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  504|      2|    OPENSSL_free(dgbl->seed_propq);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  505|       |
  506|      2|    OPENSSL_free(dgbl);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  507|      2|}

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

ossl_self_test_set_callback_new:
   37|      2|{
   38|      2|    SELF_TEST_CB *stcb;
   39|       |
   40|      2|    stcb = OPENSSL_zalloc(sizeof(*stcb));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   41|      2|    return stcb;
   42|      2|}
ossl_self_test_set_callback_free:
   45|      2|{
   46|      2|    OPENSSL_free(stcb);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   47|      2|}

ossl_sa_new:
   59|      8|{
   60|      8|    OPENSSL_SA *res = OPENSSL_zalloc(sizeof(*res));
  ------------------
  |  |   99|      8|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   61|       |
   62|      8|    return res;
   63|      8|}
ossl_sa_free:
  111|      8|{
  112|      8|    if (sa != NULL) {
  ------------------
  |  Branch (112:9): [True: 8, False: 0]
  ------------------
  113|      8|        sa_doall(sa, &sa_free_node, NULL, NULL);
  114|      8|        OPENSSL_free(sa);
  ------------------
  |  |  107|      8|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      8|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      8|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  115|      8|    }
  116|      8|}
ossl_sa_doall_arg:
  146|      8|{
  147|      8|    if (sa != NULL)
  ------------------
  |  Branch (147:9): [True: 8, False: 0]
  ------------------
  148|      8|        sa_doall(sa, NULL, leaf, arg);
  149|      8|}
sparse_array.c:sa_doall:
   67|     16|{
   68|     16|    int i[SA_BLOCK_MAX_LEVELS];
   69|     16|    void *nodes[SA_BLOCK_MAX_LEVELS];
   70|     16|    ossl_uintmax_t idx = 0;
   71|     16|    int l = 0;
   72|       |
   73|     16|    i[0] = 0;
   74|     16|    nodes[0] = sa->nodes;
   75|    288|    while (l >= 0) {
  ------------------
  |  Branch (75:12): [True: 272, False: 16]
  ------------------
   76|    272|        const int n = i[l];
   77|    272|        void ** const p = nodes[l];
   78|       |
   79|    272|        if (n >= SA_BLOCK_MAX) {
  ------------------
  |  |   45|    272|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  ------------------
  |  |  |  |   34|    272|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  ------------------
  ------------------
  |  Branch (79:13): [True: 16, False: 256]
  ------------------
   80|     16|            if (p != NULL && node != NULL)
  ------------------
  |  Branch (80:17): [True: 0, False: 16]
  |  Branch (80:30): [True: 0, False: 0]
  ------------------
   81|      0|                (*node)(p);
   82|     16|            l--;
   83|     16|            idx >>= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|     16|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   84|    256|        } else {
   85|    256|            i[l] = n + 1;
   86|    256|            if (p != NULL && p[n] != NULL) {
  ------------------
  |  Branch (86:17): [True: 0, False: 256]
  |  Branch (86:30): [True: 0, False: 0]
  ------------------
   87|      0|                idx = (idx & ~SA_BLOCK_MASK) | n;
  ------------------
  |  |   46|      0|#define SA_BLOCK_MASK           (SA_BLOCK_MAX - 1)
  |  |  ------------------
  |  |  |  |   45|      0|#define SA_BLOCK_MAX            (1 << OPENSSL_SA_BLOCK_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|      0|# define OPENSSL_SA_BLOCK_BITS           4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|      0|                if (l < sa->levels - 1) {
  ------------------
  |  Branch (88:21): [True: 0, False: 0]
  ------------------
   89|      0|                    i[++l] = 0;
   90|      0|                    nodes[l] = p[n];
   91|      0|                    idx <<= OPENSSL_SA_BLOCK_BITS;
  ------------------
  |  |   34|      0|# define OPENSSL_SA_BLOCK_BITS           4
  ------------------
   92|      0|                } else if (leaf != NULL) {
  ------------------
  |  Branch (92:28): [True: 0, False: 0]
  ------------------
   93|      0|                    (*leaf)(idx, p[n], arg);
   94|      0|                }
   95|      0|            }
   96|    256|        }
   97|    272|    }
   98|     16|}

OPENSSL_sk_new_null:
  131|      8|{
  132|      8|    return OPENSSL_sk_new_reserve(NULL, 0);
  133|      8|}
OPENSSL_sk_new:
  136|      2|{
  137|      2|    return OPENSSL_sk_new_reserve(c, 0);
  138|      2|}
OPENSSL_sk_new_reserve:
  227|     10|{
  228|     10|    OPENSSL_STACK *st = OPENSSL_zalloc(sizeof(OPENSSL_STACK));
  ------------------
  |  |   99|     10|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  229|       |
  230|     10|    if (st == NULL)
  ------------------
  |  Branch (230:9): [True: 0, False: 10]
  ------------------
  231|      0|        return NULL;
  232|       |
  233|     10|    st->comp = c;
  234|       |
  235|     10|    if (n <= 0)
  ------------------
  |  Branch (235:9): [True: 10, False: 0]
  ------------------
  236|     10|        return st;
  237|       |
  238|      0|    if (!sk_reserve(st, n, 1)) {
  ------------------
  |  Branch (238:9): [True: 0, False: 0]
  ------------------
  239|      0|        OPENSSL_sk_free(st);
  240|      0|        return NULL;
  241|      0|    }
  242|       |
  243|      0|    return st;
  244|      0|}
OPENSSL_sk_insert:
  259|     18|{
  260|     18|    if (st == NULL) {
  ------------------
  |  Branch (260:9): [True: 0, False: 18]
  ------------------
  261|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  262|      0|        return 0;
  263|      0|    }
  264|     18|    if (st->num == max_nodes) {
  ------------------
  |  Branch (264:9): [True: 0, False: 18]
  ------------------
  265|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  266|      0|        return 0;
  267|      0|    }
  268|       |
  269|     18|    if (!sk_reserve(st, 1, 0))
  ------------------
  |  Branch (269:9): [True: 0, False: 18]
  ------------------
  270|      0|        return 0;
  271|       |
  272|     18|    if ((loc >= st->num) || (loc < 0)) {
  ------------------
  |  Branch (272:9): [True: 18, False: 0]
  |  Branch (272:29): [True: 0, False: 0]
  ------------------
  273|     18|        st->data[st->num] = data;
  274|     18|    } else {
  275|      0|        memmove(&st->data[loc + 1], &st->data[loc],
  276|      0|                sizeof(st->data[0]) * (st->num - loc));
  277|      0|        st->data[loc] = data;
  278|      0|    }
  279|     18|    st->num++;
  280|     18|    st->sorted = 0;
  281|     18|    return st->num;
  282|     18|}
OPENSSL_sk_delete:
  310|      2|{
  311|      2|    if (st == NULL || loc < 0 || loc >= st->num)
  ------------------
  |  Branch (311:9): [True: 0, False: 2]
  |  Branch (311:23): [True: 0, False: 2]
  |  Branch (311:34): [True: 0, False: 2]
  ------------------
  312|      0|        return NULL;
  313|       |
  314|      2|    return internal_delete(st, loc);
  315|      2|}
OPENSSL_sk_push:
  398|     18|{
  399|     18|    if (st == NULL)
  ------------------
  |  Branch (399:9): [True: 0, False: 18]
  ------------------
  400|      0|        return -1;
  401|     18|    return OPENSSL_sk_insert(st, data, st->num);
  402|     18|}
OPENSSL_sk_pop_free:
  432|     46|{
  433|     46|    int i;
  434|       |
  435|     46|    if (st == NULL)
  ------------------
  |  Branch (435:9): [True: 42, False: 4]
  ------------------
  436|     42|        return;
  437|      4|    for (i = 0; i < st->num; i++)
  ------------------
  |  Branch (437:17): [True: 0, False: 4]
  ------------------
  438|      0|        if (st->data[i] != NULL)
  ------------------
  |  Branch (438:13): [True: 0, False: 0]
  ------------------
  439|      0|            func((char *)st->data[i]);
  440|      4|    OPENSSL_sk_free(st);
  441|      4|}
OPENSSL_sk_free:
  444|  3.73k|{
  445|  3.73k|    if (st == NULL)
  ------------------
  |  Branch (445:9): [True: 3.72k, False: 10]
  ------------------
  446|  3.72k|        return;
  447|     10|    OPENSSL_free(st->data);
  ------------------
  |  |  107|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  448|     10|    OPENSSL_free(st);
  ------------------
  |  |  107|     10|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     10|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     10|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  449|     10|}
OPENSSL_sk_num:
  452|  7.43k|{
  453|  7.43k|    return st == NULL ? -1 : st->num;
  ------------------
  |  Branch (453:12): [True: 7.43k, False: 4]
  ------------------
  454|  7.43k|}
OPENSSL_sk_value:
  457|      2|{
  458|      2|    if (st == NULL || i < 0 || i >= st->num)
  ------------------
  |  Branch (458:9): [True: 0, False: 2]
  |  Branch (458:23): [True: 0, False: 2]
  |  Branch (458:32): [True: 0, False: 2]
  ------------------
  459|      0|        return NULL;
  460|      2|    return (void *)st->data[i];
  461|      2|}
stack.c:sk_reserve:
  178|     18|{
  179|     18|    const void **tmpdata;
  180|     18|    int num_alloc;
  181|       |
  182|       |    /* Check to see the reservation isn't exceeding the hard limit */
  183|     18|    if (n > max_nodes - st->num) {
  ------------------
  |  Branch (183:9): [True: 0, False: 18]
  ------------------
  184|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  185|      0|        return 0;
  186|      0|    }
  187|       |
  188|       |    /* Figure out the new size */
  189|     18|    num_alloc = st->num + n;
  190|     18|    if (num_alloc < min_nodes)
  ------------------
  |  Branch (190:9): [True: 12, False: 6]
  ------------------
  191|     12|        num_alloc = min_nodes;
  192|       |
  193|       |    /* If |st->data| allocation was postponed */
  194|     18|    if (st->data == NULL) {
  ------------------
  |  Branch (194:9): [True: 6, False: 12]
  ------------------
  195|       |        /*
  196|       |         * At this point, |st->num_alloc| and |st->num| are 0;
  197|       |         * so |num_alloc| value is |n| or |min_nodes| if greater than |n|.
  198|       |         */
  199|      6|        if ((st->data = OPENSSL_zalloc(sizeof(void *) * num_alloc)) == NULL)
  ------------------
  |  |   99|      6|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      6|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      6|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (199:13): [True: 0, False: 6]
  ------------------
  200|      0|            return 0;
  201|      6|        st->num_alloc = num_alloc;
  202|      6|        return 1;
  203|      6|    }
  204|       |
  205|     12|    if (!exact) {
  ------------------
  |  Branch (205:9): [True: 12, False: 0]
  ------------------
  206|     12|        if (num_alloc <= st->num_alloc)
  ------------------
  |  Branch (206:13): [True: 10, False: 2]
  ------------------
  207|     10|            return 1;
  208|      2|        num_alloc = compute_growth(num_alloc, st->num_alloc);
  209|      2|        if (num_alloc == 0) {
  ------------------
  |  Branch (209:13): [True: 0, False: 2]
  ------------------
  210|      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),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  |  |  ------------------
  |  |  |  |                    ERR_set_debug(OPENSSL_FILE,OPENSSL_LINE,OPENSSL_FUNC),     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  300|      0|#    define OPENSSL_FUNC __func__
  |  |  |  |  ------------------
  |  |  |  |  405|      0|     ERR_set_error)
  |  |  ------------------
  ------------------
  211|      0|            return 0;
  212|      0|        }
  213|      2|    } else if (num_alloc == st->num_alloc) {
  ------------------
  |  Branch (213:16): [True: 0, False: 0]
  ------------------
  214|      0|        return 1;
  215|      0|    }
  216|       |
  217|      2|    tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc);
  ------------------
  |  |  101|      2|        CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  218|      2|    if (tmpdata == NULL)
  ------------------
  |  Branch (218:9): [True: 0, False: 2]
  ------------------
  219|      0|        return 0;
  220|       |
  221|      2|    st->data = tmpdata;
  222|      2|    st->num_alloc = num_alloc;
  223|      2|    return 1;
  224|      2|}
stack.c:compute_growth:
  160|      2|{
  161|      2|    int err = 0;
  162|       |
  163|      4|    while (current < target) {
  ------------------
  |  Branch (163:12): [True: 2, False: 2]
  ------------------
  164|      2|        if (current >= max_nodes)
  ------------------
  |  Branch (164:13): [True: 0, False: 2]
  ------------------
  165|      0|            return 0;
  166|       |
  167|      2|        current = safe_muldiv_int(current, 8, 5, &err);
  168|      2|        if (err != 0)
  ------------------
  |  Branch (168:13): [True: 0, False: 2]
  ------------------
  169|      0|            return 0;
  170|      2|        if (current >= max_nodes)
  ------------------
  |  Branch (170:13): [True: 0, False: 2]
  ------------------
  171|      0|            current = max_nodes;
  172|      2|    }
  173|      2|    return current;
  174|      2|}
stack.c:internal_delete:
  285|      2|{
  286|      2|    const void *ret = st->data[loc];
  287|       |
  288|      2|    if (loc != st->num - 1)
  ------------------
  |  Branch (288:9): [True: 0, False: 2]
  ------------------
  289|      0|        memmove(&st->data[loc], &st->data[loc + 1],
  290|      0|                sizeof(st->data[0]) * (st->num - loc - 1));
  291|      2|    st->num--;
  292|       |
  293|      2|    return (void *)ret;
  294|      2|}

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

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

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

ossl_crypto_mutex_new:
   97|      2|{
   98|      2|    pthread_mutex_t *mutex;
   99|       |
  100|      2|    if ((mutex = OPENSSL_zalloc(sizeof(*mutex))) == NULL)
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 0, False: 2]
  ------------------
  101|      0|        return NULL;
  102|      2|    if (pthread_mutex_init(mutex, NULL) != 0) {
  ------------------
  |  Branch (102:9): [True: 0, False: 2]
  ------------------
  103|      0|        OPENSSL_free(mutex);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  104|      0|        return NULL;
  105|      0|    }
  106|      2|    return (CRYPTO_MUTEX *)mutex;
  107|      2|}
ossl_crypto_mutex_free:
  142|      2|{
  143|      2|    pthread_mutex_t **mutex_p;
  144|       |
  145|      2|    if (mutex == NULL)
  ------------------
  |  Branch (145:9): [True: 0, False: 2]
  ------------------
  146|      0|        return;
  147|       |
  148|      2|    mutex_p = (pthread_mutex_t **)mutex;
  149|      2|    if (*mutex_p != NULL)
  ------------------
  |  Branch (149:9): [True: 2, False: 0]
  ------------------
  150|      2|        pthread_mutex_destroy(*mutex_p);
  151|      2|    OPENSSL_free(*mutex_p);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  152|      2|    *mutex = NULL;
  153|      2|}
ossl_crypto_condvar_new:
  156|      2|{
  157|      2|    pthread_cond_t *cv_p;
  158|       |
  159|      2|    if ((cv_p = OPENSSL_zalloc(sizeof(*cv_p))) == NULL)
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  |  Branch (159:9): [True: 0, False: 2]
  ------------------
  160|      0|        return NULL;
  161|      2|    if (pthread_cond_init(cv_p, NULL) != 0) {
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  162|      0|        OPENSSL_free(cv_p);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  163|      0|        return NULL;
  164|      0|    }
  165|      2|    return (CRYPTO_CONDVAR *) cv_p;
  166|      2|}
ossl_crypto_condvar_free:
  220|      2|{
  221|      2|    pthread_cond_t **cv_p;
  222|       |
  223|      2|    if (cv == NULL)
  ------------------
  |  Branch (223:9): [True: 0, False: 2]
  ------------------
  224|      0|        return;
  225|       |
  226|      2|    cv_p = (pthread_cond_t **)cv;
  227|      2|    if (*cv_p != NULL)
  ------------------
  |  Branch (227:9): [True: 2, False: 0]
  ------------------
  228|      2|        pthread_cond_destroy(*cv_p);
  229|      2|    OPENSSL_free(*cv_p);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  230|      2|    *cv_p = NULL;
  231|      2|}

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

CRYPTO_THREAD_lock_new:
   46|     48|{
   47|     48|# ifdef USE_RWLOCK
   48|     48|    CRYPTO_RWLOCK *lock;
   49|       |
   50|     48|    if ((lock = CRYPTO_zalloc(sizeof(pthread_rwlock_t), NULL, 0)) == NULL)
  ------------------
  |  Branch (50:9): [True: 0, False: 48]
  ------------------
   51|       |        /* Don't set error, to avoid recursion blowup. */
   52|      0|        return NULL;
   53|       |
   54|     48|    if (pthread_rwlock_init(lock, NULL) != 0) {
  ------------------
  |  Branch (54:9): [True: 0, False: 48]
  ------------------
   55|      0|        OPENSSL_free(lock);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   56|      0|        return NULL;
   57|      0|    }
   58|       |# else
   59|       |    pthread_mutexattr_t attr;
   60|       |    CRYPTO_RWLOCK *lock;
   61|       |
   62|       |    if ((lock = CRYPTO_zalloc(sizeof(pthread_mutex_t), NULL, 0)) == NULL)
   63|       |        /* Don't set error, to avoid recursion blowup. */
   64|       |        return NULL;
   65|       |
   66|       |    /*
   67|       |     * We don't use recursive mutexes, but try to catch errors if we do.
   68|       |     */
   69|       |    pthread_mutexattr_init(&attr);
   70|       |#  if !defined (__TANDEM) && !defined (_SPT_MODEL_)
   71|       |#   if !defined(NDEBUG) && !defined(OPENSSL_NO_MUTEX_ERRORCHECK)
   72|       |    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
   73|       |#   endif
   74|       |#  else
   75|       |    /* The SPT Thread Library does not define MUTEX attributes. */
   76|       |#  endif
   77|       |
   78|       |    if (pthread_mutex_init(lock, &attr) != 0) {
   79|       |        pthread_mutexattr_destroy(&attr);
   80|       |        OPENSSL_free(lock);
   81|       |        return NULL;
   82|       |    }
   83|       |
   84|       |    pthread_mutexattr_destroy(&attr);
   85|       |# endif
   86|       |
   87|     48|    return lock;
   88|     48|}
CRYPTO_THREAD_read_lock:
   91|  7.58k|{
   92|  7.58k|# ifdef USE_RWLOCK
   93|  7.58k|    if (pthread_rwlock_rdlock(lock) != 0)
  ------------------
  |  Branch (93:9): [True: 0, False: 7.58k]
  ------------------
   94|      0|        return 0;
   95|       |# else
   96|       |    if (pthread_mutex_lock(lock) != 0) {
   97|       |        assert(errno != EDEADLK && errno != EBUSY);
   98|       |        return 0;
   99|       |    }
  100|       |# endif
  101|       |
  102|  7.58k|    return 1;
  103|  7.58k|}
CRYPTO_THREAD_write_lock:
  106|    236|{
  107|    236|# ifdef USE_RWLOCK
  108|    236|    if (pthread_rwlock_wrlock(lock) != 0)
  ------------------
  |  Branch (108:9): [True: 0, False: 236]
  ------------------
  109|      0|        return 0;
  110|       |# else
  111|       |    if (pthread_mutex_lock(lock) != 0) {
  112|       |        assert(errno != EDEADLK && errno != EBUSY);
  113|       |        return 0;
  114|       |    }
  115|       |# endif
  116|       |
  117|    236|    return 1;
  118|    236|}
CRYPTO_THREAD_unlock:
  121|  7.81k|{
  122|  7.81k|# ifdef USE_RWLOCK
  123|  7.81k|    if (pthread_rwlock_unlock(lock) != 0)
  ------------------
  |  Branch (123:9): [True: 0, False: 7.81k]
  ------------------
  124|      0|        return 0;
  125|       |# else
  126|       |    if (pthread_mutex_unlock(lock) != 0) {
  127|       |        assert(errno != EPERM);
  128|       |        return 0;
  129|       |    }
  130|       |# endif
  131|       |
  132|  7.81k|    return 1;
  133|  7.81k|}
CRYPTO_THREAD_lock_free:
  136|     62|{
  137|     62|    if (lock == NULL)
  ------------------
  |  Branch (137:9): [True: 14, False: 48]
  ------------------
  138|     14|        return;
  139|       |
  140|     48|# ifdef USE_RWLOCK
  141|     48|    pthread_rwlock_destroy(lock);
  142|       |# else
  143|       |    pthread_mutex_destroy(lock);
  144|       |# endif
  145|     48|    OPENSSL_free(lock);
  ------------------
  |  |  107|     48|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|     48|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|     48|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  146|       |
  147|     48|    return;
  148|     62|}
CRYPTO_THREAD_run_once:
  151|  16.4k|{
  152|  16.4k|    if (pthread_once(once, init) != 0)
  ------------------
  |  Branch (152:9): [True: 0, False: 16.4k]
  ------------------
  153|      0|        return 0;
  154|       |
  155|  16.4k|    return 1;
  156|  16.4k|}
CRYPTO_THREAD_init_local:
  159|     12|{
  160|     12|    if (pthread_key_create(key, cleanup) != 0)
  ------------------
  |  Branch (160:9): [True: 0, False: 12]
  ------------------
  161|      0|        return 0;
  162|       |
  163|     12|    return 1;
  164|     12|}
CRYPTO_THREAD_get_local:
  167|  11.8k|{
  168|  11.8k|    return pthread_getspecific(*key);
  169|  11.8k|}
CRYPTO_THREAD_set_local:
  172|     14|{
  173|     14|    if (pthread_setspecific(*key, val) != 0)
  ------------------
  |  Branch (173:9): [True: 0, False: 14]
  ------------------
  174|      0|        return 0;
  175|       |
  176|     14|    return 1;
  177|     14|}
CRYPTO_THREAD_cleanup_local:
  180|     12|{
  181|     12|    if (pthread_key_delete(*key) != 0)
  ------------------
  |  Branch (181:9): [True: 0, False: 12]
  ------------------
  182|      0|        return 0;
  183|       |
  184|     12|    return 1;
  185|     12|}
CRYPTO_atomic_or:
  225|      2|{
  226|      2|# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS)
  227|      2|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (227:9): [Folded - Ignored]
  ------------------
  228|      2|        *ret = __atomic_or_fetch(val, op, __ATOMIC_ACQ_REL);
  229|      2|        return 1;
  230|      2|    }
  231|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  232|       |    /* This will work for all future Solaris versions. */
  233|       |    if (ret != NULL) {
  234|       |        *ret = atomic_or_64_nv(val, op);
  235|       |        return 1;
  236|       |    }
  237|       |# endif
  238|      0|    if (lock == NULL || !CRYPTO_THREAD_write_lock(lock))
  ------------------
  |  Branch (238:9): [True: 0, False: 0]
  |  Branch (238:25): [True: 0, False: 0]
  ------------------
  239|      0|        return 0;
  240|      0|    *val |= op;
  241|      0|    *ret  = *val;
  242|       |
  243|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (243:9): [True: 0, False: 0]
  ------------------
  244|      0|        return 0;
  245|       |
  246|      0|    return 1;
  247|      0|}
CRYPTO_atomic_load:
  250|  4.41k|{
  251|  4.41k|# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS)
  252|  4.41k|    if (__atomic_is_lock_free(sizeof(*val), val)) {
  ------------------
  |  Branch (252:9): [Folded - Ignored]
  ------------------
  253|  4.41k|        __atomic_load(val, ret, __ATOMIC_ACQUIRE);
  254|  4.41k|        return 1;
  255|  4.41k|    }
  256|       |# elif defined(__sun) && (defined(__SunOS_5_10) || defined(__SunOS_5_11))
  257|       |    /* This will work for all future Solaris versions. */
  258|       |    if (ret != NULL) {
  259|       |        *ret = atomic_or_64_nv(val, 0);
  260|       |        return 1;
  261|       |    }
  262|       |# endif
  263|      0|    if (lock == NULL || !CRYPTO_THREAD_read_lock(lock))
  ------------------
  |  Branch (263:9): [True: 0, False: 0]
  |  Branch (263:25): [True: 0, False: 0]
  ------------------
  264|      0|        return 0;
  265|      0|    *ret  = *val;
  266|      0|    if (!CRYPTO_THREAD_unlock(lock))
  ------------------
  |  Branch (266:9): [True: 0, False: 0]
  ------------------
  267|      0|        return 0;
  268|       |
  269|      0|    return 1;
  270|      0|}

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

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

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

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

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

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

FuzzerInitialize:
   16|      2|{
   17|      2|    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
  ------------------
  |  |  450|      2|# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS    0x00000002L
  ------------------
   18|      2|    ERR_clear_error();
   19|      2|    CRYPTO_free_ex_index(0, -1);
   20|      2|    return 1;
   21|      2|}
FuzzerTestOneInput:
   24|  1.24k|{
   25|  1.24k|    BIO *in;
   26|  1.24k|    char *name = NULL, *header = NULL;
   27|  1.24k|    unsigned char *data = NULL;
   28|  1.24k|    long outlen;
   29|       |
   30|  1.24k|    if (len <= 1)
  ------------------
  |  Branch (30:9): [True: 1, False: 1.24k]
  ------------------
   31|      1|        return 0;
   32|       |
   33|  1.24k|    in = BIO_new(BIO_s_mem());
   34|  1.24k|    OPENSSL_assert((size_t)BIO_write(in, buf + 1, len - 1) == len - 1);
  ------------------
  |  |  421|  1.24k|    (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                   (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  |  |  |  Branch (421:12): [True: 1.24k, False: 0]
  |  |  ------------------
  ------------------
   35|  1.24k|    if (PEM_read_bio_ex(in, &name, &header, &data, &outlen, buf[0]) == 1) {
  ------------------
  |  Branch (35:9): [True: 159, False: 1.08k]
  ------------------
   36|       |	/* Try to read all the data we get to see if allocated properly. */
   37|    159|        BIO_write(in, name, strlen(name));
   38|    159|	BIO_write(in, header, strlen(header));
   39|    159|	BIO_write(in, data, outlen);
   40|    159|    }
   41|  1.24k|    if (buf[0] & PEM_FLAG_SECURE) {
  ------------------
  |  |  379|  1.24k|#   define PEM_FLAG_SECURE             0x1
  ------------------
  |  Branch (41:9): [True: 488, False: 752]
  ------------------
   42|    488|        OPENSSL_secure_free(name);
  ------------------
  |  |  119|    488|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    488|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    488|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   43|    488|        OPENSSL_secure_free(header);
  ------------------
  |  |  119|    488|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    488|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    488|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   44|    488|        OPENSSL_secure_free(data);
  ------------------
  |  |  119|    488|        CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    488|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    488|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   45|    752|    } else {
   46|    752|        OPENSSL_free(name);
  ------------------
  |  |  107|    752|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    752|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    752|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   47|    752|        OPENSSL_free(header);
  ------------------
  |  |  107|    752|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    752|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    752|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   48|    752|        OPENSSL_free(data);
  ------------------
  |  |  107|    752|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|    752|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|    752|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
   49|    752|    }
   50|       |
   51|  1.24k|    BIO_free(in);
   52|  1.24k|    ERR_clear_error();
   53|       |
   54|  1.24k|    return 0;
   55|  1.24k|}

property.c:ossl_sa_ALGORITHM_new:
   27|      8|    { \
   28|      8|        return (SPARSE_ARRAY_OF(type) *)ossl_sa_new(); \
   29|      8|    } \
property.c:ossl_sa_ALGORITHM_doall_arg:
   56|      8|    { \
   57|      8|        ossl_sa_doall_arg((OPENSSL_SA *)sa, \
   58|      8|                          (void (*)(ossl_uintmax_t, void *, void *))leaf, arg); \
   59|      8|    } \
property.c:ossl_sa_ALGORITHM_free:
   32|      8|    { \
   33|      8|        ossl_sa_free((OPENSSL_SA *)sa); \
   34|      8|    } \

bio_lib.c:CRYPTO_NEW_REF:
  268|  3.71k|{
  269|  3.71k|    refcnt->val = n;
  270|  3.71k|    return 1;
  271|  3.71k|}
bio_lib.c:CRYPTO_FREE_REF:
  273|  3.71k|static ossl_unused ossl_inline void CRYPTO_FREE_REF(CRYPTO_REF_COUNT *refcnt)                                  \
  274|  3.71k|{
  275|  3.71k|}
bio_lib.c:CRYPTO_DOWN_REF:
   50|  3.71k|{
   51|  3.71k|    *ret = atomic_fetch_sub_explicit(&refcnt->val, 1, memory_order_relaxed) - 1;
   52|  3.71k|    if (*ret == 0)
  ------------------
  |  Branch (52:9): [True: 3.71k, False: 0]
  ------------------
   53|  3.71k|        atomic_thread_fence(memory_order_acquire);
   54|  3.71k|    return 1;
   55|  3.71k|}

stack.c:safe_muldiv_int:
  322|      2|    {                                                                        \
  323|      2|        int e2 = 0;                                                          \
  324|      2|        type q, r, x, y;                                                     \
  325|      2|                                                                             \
  326|      2|        if (c == 0) {                                                        \
  ------------------
  |  Branch (326:13): [True: 0, False: 2]
  ------------------
  327|      0|            *err |= 1;                                                       \
  328|      0|            return a == 0 || b == 0 ? 0 : max;                               \
  ------------------
  |  Branch (328:20): [True: 0, False: 0]
  |  Branch (328:30): [True: 0, False: 0]
  ------------------
  329|      0|        }                                                                    \
  330|      2|        x = safe_mul_ ## type_name(a, b, &e2);                               \
  331|      2|        if (!e2)                                                             \
  ------------------
  |  Branch (331:13): [True: 2, False: 0]
  ------------------
  332|      2|            return safe_div_ ## type_name(x, c, err);                        \
  333|      2|        if (b > a) {                                                         \
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            x = b;                                                           \
  335|      0|            b = a;                                                           \
  336|      0|            a = x;                                                           \
  337|      0|        }                                                                    \
  338|      0|        q = safe_div_ ## type_name(a, c, err);                               \
  339|      0|        r = safe_mod_ ## type_name(a, c, err);                               \
  340|      0|        x = safe_mul_ ## type_name(r, b, err);                               \
  341|      0|        y = safe_mul_ ## type_name(q, b, err);                               \
  342|      0|        q = safe_div_ ## type_name(x, c, err);                               \
  343|      0|        return safe_add_ ## type_name(y, q, err);                            \
  344|      2|    }
stack.c:safe_mul_int:
  136|      2|    {                                                                        \
  137|      2|        type r;                                                              \
  138|      2|                                                                             \
  139|      2|        if (!__builtin_mul_overflow(a, b, &r))                               \
  ------------------
  |  Branch (139:13): [True: 2, False: 0]
  ------------------
  140|      2|            return r;                                                        \
  141|      2|        *err |= 1;                                                           \
  142|      0|        return (a < 0) ^ (b < 0) ? min : max;                                \
  ------------------
  |  Branch (142:16): [True: 0, False: 0]
  ------------------
  143|      2|    }
stack.c:safe_div_int:
  199|      2|    {                                                                        \
  200|      2|        if (b == 0) {                                                        \
  ------------------
  |  Branch (200:13): [True: 0, False: 2]
  ------------------
  201|      0|            *err |= 1;                                                       \
  202|      0|            return a < 0 ? min : max;                                        \
  ------------------
  |  Branch (202:20): [True: 0, False: 0]
  ------------------
  203|      0|        }                                                                    \
  204|      2|        if (b == -1 && a == min) {                                           \
  ------------------
  |  Branch (204:13): [True: 0, False: 2]
  |  Branch (204:24): [True: 0, False: 0]
  ------------------
  205|      0|            *err |= 1;                                                       \
  206|      0|            return max;                                                      \
  207|      0|        }                                                                    \
  208|      2|        return a / b;                                                        \
  209|      2|    }

err.c:do_err_strings_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
err.c:err_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_base_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_register_atexit_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_nodelete_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
init.c:ossl_init_load_crypto_strings_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
initthread.c:create_global_tevent_register_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
conf_mod.c:do_init_module_list_lock_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \
context.c:default_context_do_init_ossl_:
   73|      2|    {                                           \
   74|      2|        init##_ossl_ret_ = init();              \
   75|      2|    }                                           \

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

err.c:ossl_check_ERR_STRING_DATA_lh_type:
  162|  8.63k|    { \
  163|  8.63k|        return (OPENSSL_LHASH *)lh; \
  164|  8.63k|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_hashfunc_type:
  172|      2|    { \
  173|      2|        return (OPENSSL_LH_HASHFUNC)hfn; \
  174|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_compfunc_type:
  167|      2|    { \
  168|      2|        return (OPENSSL_LH_COMPFUNC)cmp; \
  169|      2|    } \
err.c:ossl_check_ERR_STRING_DATA_lh_plain_type:
  147|  8.49k|    { \
  148|  8.49k|        return ptr; \
  149|  8.49k|    } \
err.c:ossl_check_const_ERR_STRING_DATA_lh_plain_type:
  152|    136|    { \
  153|    136|        return ptr; \
  154|    136|    } \
store_register.c:lh_OSSL_STORE_LOADER_free:
  216|      2|    { \
  217|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      2|    } \
core_namemap.c:lh_NAMENUM_ENTRY_new:
  210|      2|    { \
  211|      2|        return (LHASH_OF(type) *) \
  212|      2|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|      2|    } \
core_namemap.c:lh_NAMENUM_ENTRY_doall:
  261|      2|    { \
  262|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|      2|    } \
core_namemap.c:lh_NAMENUM_ENTRY_free:
  216|      2|    { \
  217|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_doall:
  261|      2|    { \
  262|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_free:
  216|      2|    { \
  217|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      2|    } \
defn_cache.c:lh_PROPERTY_DEFN_ELEM_new:
  210|      2|    { \
  211|      2|        return (LHASH_OF(type) *) \
  212|      2|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|      2|    } \
property_string.c:lh_PROPERTY_STRING_doall:
  261|      4|    { \
  262|      4|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|      4|    } \
property_string.c:lh_PROPERTY_STRING_free:
  216|      4|    { \
  217|      4|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      4|    } \
property_string.c:lh_PROPERTY_STRING_new:
  210|      4|    { \
  211|      4|        return (LHASH_OF(type) *) \
  212|      4|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|      4|    } \
property_string.c:lh_PROPERTY_STRING_retrieve:
  236|     32|    { \
  237|     32|        return (type *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d); \
  238|     32|    } \
property_string.c:lh_PROPERTY_STRING_insert:
  226|     16|    { \
  227|     16|        return (type *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d); \
  228|     16|    } \
property_string.c:lh_PROPERTY_STRING_error:
  241|     16|    { \
  242|     16|        return OPENSSL_LH_error((OPENSSL_LHASH *)lh); \
  243|     16|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_new:
  210|      2|    { \
  211|      2|        return (LHASH_OF(type) *) \
  212|      2|            OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn); \
  213|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_doall:
  261|      2|    { \
  262|      2|        OPENSSL_LH_doall((OPENSSL_LHASH *)lh, (OPENSSL_LH_DOALL_FUNC)doall); \
  263|      2|    } \
decoder_pkey.c:lh_DECODER_CACHE_ENTRY_free:
  216|      2|    { \
  217|      2|        OPENSSL_LH_free((OPENSSL_LHASH *)lh); \
  218|      2|    } \

ex_data.c:sk_EX_CALLBACK_pop_free:
  127|     36|    { \
  128|     36|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|     36|    } \
ex_data.c:sk_EX_CALLBACK_num:
   70|  7.42k|    { \
   71|  7.42k|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|  7.42k|    } \
ex_data.c:ossl_check_void_sk_type:
   48|  3.71k|    { \
   49|  3.71k|        return (OPENSSL_STACK *)sk; \
   50|  3.71k|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_push:
  111|      2|    { \
  112|      2|        return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr); \
  113|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_num:
   70|      4|    { \
   71|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      4|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_value:
   74|      2|    { \
   75|      2|        return (t2 *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx); \
   76|      2|    } \
initthread.c:sk_THREAD_EVENT_HANDLER_PTR_delete:
  102|      2|    { \
  103|      2|        return (t2 *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i); \
  104|      2|    } \
conf_mod.c:sk_CONF_MODULE_num:
   70|      4|    { \
   71|      4|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      4|    } \
conf_mod.c:sk_CONF_MODULE_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
conf_mod.c:sk_CONF_IMODULE_num:
   70|      2|    { \
   71|      2|        return OPENSSL_sk_num((const OPENSSL_STACK *)sk); \
   72|      2|    } \
conf_mod.c:sk_CONF_IMODULE_free:
   94|      4|    { \
   95|      4|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      4|    } \
provider_conf.c:sk_OSSL_PROVIDER_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_new:
   78|      2|    { \
   79|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare); \
   80|      2|    } \
provider_core.c:sk_OSSL_PROVIDER_CHILD_CB_new_null:
   82|      2|    { \
   83|      2|        return (STACK_OF(t1) *)OPENSSL_sk_new_null(); \
   84|      2|    } \
obj_xref.c:sk_nid_triple_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \
obj_xref.c:sk_nid_triple_free:
   94|      2|    { \
   95|      2|        OPENSSL_sk_free((OPENSSL_STACK *)sk); \
   96|      2|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_sk_type:
   48|     20|    { \
   49|     20|        return (OPENSSL_STACK *)sk; \
   50|     20|    } \
property_string.c:ossl_check_OPENSSL_CSTRING_type:
   40|     16|    { \
   41|     16|        return ptr; \
   42|     16|    } \
evp_pbe.c:sk_EVP_PBE_CTL_pop_free:
  127|      2|    { \
  128|      2|        OPENSSL_sk_pop_free((OPENSSL_STACK *)sk, (OPENSSL_sk_freefunc)freefunc); \
  129|      2|    } \

ossl_err_load_PROV_strings:
  230|      2|{
  231|      2|#ifndef OPENSSL_NO_ERR
  232|      2|    if (ERR_reason_error_string(PROV_str_reasons[0].error) == NULL)
  ------------------
  |  Branch (232:9): [True: 2, False: 0]
  ------------------
  233|      2|        ERR_load_strings_const(PROV_str_reasons);
  234|      2|#endif
  235|      2|    return 1;
  236|      2|}

ossl_prov_drbg_nonce_ctx_new:
  277|      2|{
  278|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = OPENSSL_zalloc(sizeof(*dngbl));
  ------------------
  |  |   99|      2|        CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  279|       |
  280|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (280:9): [True: 0, False: 2]
  ------------------
  281|      0|        return NULL;
  282|       |
  283|      2|    dngbl->rand_nonce_lock = CRYPTO_THREAD_lock_new();
  284|      2|    if (dngbl->rand_nonce_lock == NULL) {
  ------------------
  |  Branch (284:9): [True: 0, False: 2]
  ------------------
  285|      0|        OPENSSL_free(dngbl);
  ------------------
  |  |  107|      0|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      0|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      0|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  286|      0|        return NULL;
  287|      0|    }
  288|       |
  289|      2|    return dngbl;
  290|      2|}
ossl_prov_drbg_nonce_ctx_free:
  293|      2|{
  294|      2|    PROV_DRBG_NONCE_GLOBAL *dngbl = vdngbl;
  295|       |
  296|      2|    if (dngbl == NULL)
  ------------------
  |  Branch (296:9): [True: 0, False: 2]
  ------------------
  297|      0|        return;
  298|       |
  299|      2|    CRYPTO_THREAD_lock_free(dngbl->rand_nonce_lock);
  300|       |
  301|      2|    OPENSSL_free(dngbl);
  ------------------
  |  |  107|      2|        CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  279|      2|#   define OPENSSL_FILE __FILE__
  |  |  ------------------
  |  |                       CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
  |  |  ------------------
  |  |  |  |  280|      2|#   define OPENSSL_LINE __LINE__
  |  |  ------------------
  ------------------
  302|      2|}

