static X509_STORE *create_cert_store(char *ca_path, char *ca_file)
	{
	X509_STORE *cert_ctx = NULL;
	X509_LOOKUP *lookup = NULL;
	int i;
	cert_ctx = X509_STORE_new();
	X509_STORE_set_verify_cb(cert_ctx, verify_cb);
	if (ca_path)
		{
		lookup = X509_STORE_add_lookup(cert_ctx,
					       X509_LOOKUP_hash_dir());
		if (lookup == NULL)
			{
			BIO_printf(bio_err, "memory allocation failure\n");
			goto err;
			}
		i = X509_LOOKUP_add_dir(lookup, ca_path, X509_FILETYPE_PEM);
		if (!i)
			{
			BIO_printf(bio_err, "Error loading directory %s\n",
				   ca_path);
			goto err;
			}
		}
	if (ca_file)
		{
		lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_file());
		if (lookup == NULL)
			{
			BIO_printf(bio_err, "memory allocation failure\n");
			goto err;
			}
		i = X509_LOOKUP_load_file(lookup, ca_file, X509_FILETYPE_PEM);
		if (!i)
			{
			BIO_printf(bio_err, "Error loading file %s\n", ca_file);
			goto err;
			}
		}
	return cert_ctx;
 err:
	X509_STORE_free(cert_ctx);
	return NULL;
	}
['static X509_STORE *create_cert_store(char *ca_path, char *ca_file)\n\t{\n\tX509_STORE *cert_ctx = NULL;\n\tX509_LOOKUP *lookup = NULL;\n\tint i;\n\tcert_ctx = X509_STORE_new();\n\tX509_STORE_set_verify_cb(cert_ctx, verify_cb);\n\tif (ca_path)\n\t\t{\n\t\tlookup = X509_STORE_add_lookup(cert_ctx,\n\t\t\t\t\t       X509_LOOKUP_hash_dir());\n\t\tif (lookup == NULL)\n\t\t\t{\n\t\t\tBIO_printf(bio_err, "memory allocation failure\\n");\n\t\t\tgoto err;\n\t\t\t}\n\t\ti = X509_LOOKUP_add_dir(lookup, ca_path, X509_FILETYPE_PEM);\n\t\tif (!i)\n\t\t\t{\n\t\t\tBIO_printf(bio_err, "Error loading directory %s\\n",\n\t\t\t\t   ca_path);\n\t\t\tgoto err;\n\t\t\t}\n\t\t}\n\tif (ca_file)\n\t\t{\n\t\tlookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_file());\n\t\tif (lookup == NULL)\n\t\t\t{\n\t\t\tBIO_printf(bio_err, "memory allocation failure\\n");\n\t\t\tgoto err;\n\t\t\t}\n\t\ti = X509_LOOKUP_load_file(lookup, ca_file, X509_FILETYPE_PEM);\n\t\tif (!i)\n\t\t\t{\n\t\t\tBIO_printf(bio_err, "Error loading file %s\\n", ca_file);\n\t\t\tgoto err;\n\t\t\t}\n\t\t}\n\treturn cert_ctx;\n err:\n\tX509_STORE_free(cert_ctx);\n\treturn NULL;\n\t}', 'X509_STORE *X509_STORE_new(void)\n\t{\n\tX509_STORE *ret;\n\tif ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL)\n\t\treturn NULL;\n\tret->objs = sk_X509_OBJECT_new(x509_object_cmp);\n\tret->cache=1;\n\tret->get_cert_methods=sk_X509_LOOKUP_new_null();\n\tret->verify=0;\n\tret->verify_cb=0;\n\tif ((ret->param = X509_VERIFY_PARAM_new()) == NULL)\n\t\treturn NULL;\n\tret->get_issuer = 0;\n\tret->check_issued = 0;\n\tret->check_revocation = 0;\n\tret->get_crl = 0;\n\tret->check_crl = 0;\n\tret->cert_crl = 0;\n\tret->lookup_certs = 0;\n\tret->lookup_crls = 0;\n\tret->cleanup = 0;\n\tif (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE, ret, &ret->ex_data))\n\t\t{\n\t\tsk_X509_OBJECT_free(ret->objs);\n\t\tOPENSSL_free(ret);\n\t\treturn NULL;\n\t\t}\n\tret->references=1;\n\treturn ret;\n\t}', 'void *CRYPTO_malloc(int num, const char *file, int line)\n\t{\n\tvoid *ret = NULL;\n\tif (num <= 0) return NULL;\n\tallow_customize = 0;\n\tif (malloc_debug_func != NULL)\n\t\t{\n\t\tallow_customize_debug = 0;\n\t\tmalloc_debug_func(NULL, num, file, line, 0);\n\t\t}\n\tret = malloc_ex_func(num,file,line);\n#ifdef LEVITTE_DEBUG_MEM\n\tfprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\\n", ret, num);\n#endif\n\tif (malloc_debug_func != NULL)\n\t\tmalloc_debug_func(ret, num, file, line, 1);\n#ifndef OPENSSL_CPUID_OBJ\n        if(ret && (num > 2048))\n\t{\textern unsigned char cleanse_ctr;\n                ((unsigned char *)ret)[0] = cleanse_ctr;\n\t}\n#endif\n\treturn ret;\n\t}', 'void X509_STORE_set_verify_cb(X509_STORE *ctx,\n\t\t\t\t  int (*verify_cb)(int, X509_STORE_CTX *))\n\t{\n\tctx->verify_cb = verify_cb;\n\t}']