[core] set the xmlSec log handler globally
The log handler is not set in lasso_init().
This commit is contained in:
parent
0c45b252dc
commit
2a63167627
|
@ -127,6 +127,16 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||||
|
|
||||||
#include "types.c"
|
#include "types.c"
|
||||||
|
|
||||||
|
static void
|
||||||
|
lasso_xml_generic_error_func(G_GNUC_UNUSED void *ctx, const char *msg, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
va_start(args, msg);
|
||||||
|
g_logv(LASSO_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, msg, args);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lasso_init:
|
* lasso_init:
|
||||||
*
|
*
|
||||||
|
@ -183,6 +193,7 @@ int lasso_init()
|
||||||
return LASSO_ERROR_UNDEFINED;
|
return LASSO_ERROR_UNDEFINED;
|
||||||
}
|
}
|
||||||
lasso_flag_parse_environment_variable();
|
lasso_flag_parse_environment_variable();
|
||||||
|
xmlSetGenericErrorFunc(NULL, lasso_xml_generic_error_func);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1230,16 +1230,6 @@ lasso_saml_constrain_dsigctxt(xmlSecDSigCtxPtr dsigCtx) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
lasso_xml_generic_error_func(G_GNUC_UNUSED void *ctx, const char *msg, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
va_start(args, msg);
|
|
||||||
g_logv(LASSO_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, msg, args);
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lasso_verify_signature:
|
* lasso_verify_signature:
|
||||||
* @signed_node: an #xmlNode containing an enveloped xmlDSig signature
|
* @signed_node: an #xmlNode containing an enveloped xmlDSig signature
|
||||||
|
@ -1324,8 +1314,6 @@ lasso_verify_signature(xmlNode *signed_node, xmlDoc *doc, const char *id_attr_na
|
||||||
dsigCtx->signKey = xmlSecKeyDuplicate(public_key);
|
dsigCtx->signKey = xmlSecKeyDuplicate(public_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlSetGenericErrorFunc(NULL, lasso_xml_generic_error_func);
|
|
||||||
|
|
||||||
/* Verify signature */
|
/* Verify signature */
|
||||||
goto_cleanup_if_fail_with_rc(xmlSecDSigCtxVerify(dsigCtx, signature) >= 0,
|
goto_cleanup_if_fail_with_rc(xmlSecDSigCtxVerify(dsigCtx, signature) >= 0,
|
||||||
LASSO_DS_ERROR_SIGNATURE_VERIFICATION_FAILED);
|
LASSO_DS_ERROR_SIGNATURE_VERIFICATION_FAILED);
|
||||||
|
@ -1546,8 +1534,6 @@ lasso_node_decrypt_xmlnode(xmlNode* encrypted_element,
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlSetGenericErrorFunc(NULL, lasso_xml_generic_error_func);
|
|
||||||
|
|
||||||
/* Need to duplicate it because xmlSecEncCtxDestroy(encCtx); will destroy it */
|
/* Need to duplicate it because xmlSecEncCtxDestroy(encCtx); will destroy it */
|
||||||
encryption_private_key = xmlSecKeyDuplicate(encryption_private_key);
|
encryption_private_key = xmlSecKeyDuplicate(encryption_private_key);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue