static int tls1_prf_alg(const EVP_MD *md,
                        const unsigned char *sec, size_t slen,
                        const unsigned char *seed, size_t seed_len,
                        unsigned char *out, size_t olen)
{
    if (EVP_MD_type(md) == NID_md5_sha1) {
        size_t i;
        unsigned char *tmp;
        size_t L_S1 = (slen + 1) / 2;
        size_t L_S2 = L_S1;
        if (!tls1_prf_P_hash(EVP_md5(), sec, L_S1,
                             seed, seed_len, out, olen))
            return 0;
        if ((tmp = OPENSSL_malloc(olen)) == NULL) {
            KDFerr(KDF_F_TLS1_PRF_ALG, ERR_R_MALLOC_FAILURE);
            return 0;
        }
        if (!tls1_prf_P_hash(EVP_sha1(), sec + slen - L_S2, L_S2,
                             seed, seed_len, tmp, olen)) {
            OPENSSL_clear_free(tmp, olen);
            return 0;
        }
        for (i = 0; i < olen; i++)
            out[i] ^= tmp[i];
        OPENSSL_clear_free(tmp, olen);
        return 1;
    }
    if (!tls1_prf_P_hash(md, sec, slen, seed, seed_len, out, olen))
        return 0;
    return 1;
}
['static int tls1_prf_alg(const EVP_MD *md,\n                        const unsigned char *sec, size_t slen,\n                        const unsigned char *seed, size_t seed_len,\n                        unsigned char *out, size_t olen)\n{\n    if (EVP_MD_type(md) == NID_md5_sha1) {\n        size_t i;\n        unsigned char *tmp;\n        size_t L_S1 = (slen + 1) / 2;\n        size_t L_S2 = L_S1;\n        if (!tls1_prf_P_hash(EVP_md5(), sec, L_S1,\n                             seed, seed_len, out, olen))\n            return 0;\n        if ((tmp = OPENSSL_malloc(olen)) == NULL) {\n            KDFerr(KDF_F_TLS1_PRF_ALG, ERR_R_MALLOC_FAILURE);\n            return 0;\n        }\n        if (!tls1_prf_P_hash(EVP_sha1(), sec + slen - L_S2, L_S2,\n                             seed, seed_len, tmp, olen)) {\n            OPENSSL_clear_free(tmp, olen);\n            return 0;\n        }\n        for (i = 0; i < olen; i++)\n            out[i] ^= tmp[i];\n        OPENSSL_clear_free(tmp, olen);\n        return 1;\n    }\n    if (!tls1_prf_P_hash(md, sec, slen, seed, seed_len, out, olen))\n        return 0;\n    return 1;\n}', 'int EVP_MD_type(const EVP_MD *md)\n{\n    return md->type;\n}', 'const EVP_MD *EVP_md5(void)\n{\n    return &md5_md;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    INCREMENT(malloc_count);\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num == 0)\n        return NULL;\n    FAILTEST();\n    if (allow_customize) {\n        allow_customize = 0;\n    }\n#if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE)\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)(file); (void)(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'const EVP_MD *EVP_sha1(void)\n{\n    return &sha1_md;\n}', 'void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)\n{\n    if (str == NULL)\n        return;\n    if (num)\n        OPENSSL_cleanse(str, num);\n    CRYPTO_free(str, file, line);\n}', 'void OPENSSL_cleanse(void *ptr, size_t len)\n{\n    memset_func(ptr, 0, len);\n}', 'void CRYPTO_free(void *str, const char *file, int line)\n{\n    INCREMENT(free_count);\n    if (free_impl != NULL && free_impl != &CRYPTO_free) {\n        free_impl(str, file, line);\n        return;\n    }\n#if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE)\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0, file, line);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1, file, line);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}']