X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath)
{
	X509_STORE *store;
	X509_LOOKUP *lookup;
	if(!(store = X509_STORE_new())) goto end;
	lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file());
	if (lookup == NULL) goto end;
	if (CAfile) {
		if(!X509_LOOKUP_load_file(lookup,CAfile,X509_FILETYPE_PEM)) {
			BIO_printf(bp, "Error loading file %s\n", CAfile);
			goto end;
		}
	} else X509_LOOKUP_load_file(lookup,NULL,X509_FILETYPE_DEFAULT);
	lookup=X509_STORE_add_lookup(store,X509_LOOKUP_hash_dir());
	if (lookup == NULL) goto end;
	if (CApath) {
		if(!X509_LOOKUP_add_dir(lookup,CApath,X509_FILETYPE_PEM)) {
			BIO_printf(bp, "Error loading directory %s\n", CApath);
			goto end;
		}
	} else X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);
	ERR_clear_error();
	return store;
	end:
	X509_STORE_free(store);
	return NULL;
}
['X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath)\n{\n\tX509_STORE *store;\n\tX509_LOOKUP *lookup;\n\tif(!(store = X509_STORE_new())) goto end;\n\tlookup=X509_STORE_add_lookup(store,X509_LOOKUP_file());\n\tif (lookup == NULL) goto end;\n\tif (CAfile) {\n\t\tif(!X509_LOOKUP_load_file(lookup,CAfile,X509_FILETYPE_PEM)) {\n\t\t\tBIO_printf(bp, "Error loading file %s\\n", CAfile);\n\t\t\tgoto end;\n\t\t}\n\t} else X509_LOOKUP_load_file(lookup,NULL,X509_FILETYPE_DEFAULT);\n\tlookup=X509_STORE_add_lookup(store,X509_LOOKUP_hash_dir());\n\tif (lookup == NULL) goto end;\n\tif (CApath) {\n\t\tif(!X509_LOOKUP_add_dir(lookup,CApath,X509_FILETYPE_PEM)) {\n\t\t\tBIO_printf(bp, "Error loading directory %s\\n", CApath);\n\t\t\tgoto end;\n\t\t}\n\t} else X509_LOOKUP_add_dir(lookup,NULL,X509_FILETYPE_DEFAULT);\n\tERR_clear_error();\n\treturn store;\n\tend:\n\tX509_STORE_free(store);\n\treturn NULL;\n}', '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}']