summaryrefslogtreecommitdiffstats
path: root/lasso/Attic
diff options
context:
space:
mode:
authorValery Febvre <vfebvre at easter-eggs.com>2004-08-04 23:02:42 +0000
committerValery Febvre <vfebvre at easter-eggs.com>2004-08-04 23:02:42 +0000
commit73ff9b07dd204c701b863ac5c61fc8b4ec865603 (patch)
treea0b91211edbbc5fdbed6ab90a393e8e3921d331b /lasso/Attic
parent0129cc8b60fcb371f878a5b35080f883d3115ce7 (diff)
downloadlasso-73ff9b07dd204c701b863ac5c61fc8b4ec865603.tar.gz
lasso-73ff9b07dd204c701b863ac5c61fc8b4ec865603.tar.xz
lasso-73ff9b07dd204c701b863ac5c61fc8b4ec865603.zip
Added a new argument 'err' in lasso_artifact_get_* methods
for errors reporting.
Diffstat (limited to 'lasso/Attic')
-rw-r--r--lasso/Attic/protocols/artifact.c75
-rw-r--r--lasso/Attic/protocols/artifact.h15
2 files changed, 70 insertions, 20 deletions
diff --git a/lasso/Attic/protocols/artifact.c b/lasso/Attic/protocols/artifact.c
index 68bdc063..ba8f424a 100644
--- a/lasso/Attic/protocols/artifact.c
+++ b/lasso/Attic/protocols/artifact.c
@@ -69,32 +69,59 @@ lasso_artifact_split_samlArt(gchar *b64_samlArt,
/*****************************************************************************/
xmlChar*
-lasso_artifact_get_assertionHandle(LassoArtifact *artifact)
+lasso_artifact_get_assertionHandle(LassoArtifact *artifact,
+ GError **err)
{
- return (lasso_node_get_child_content(LASSO_NODE(artifact),
- "AssertionHandle", NULL, NULL));
+ xmlChar *assertionHandle;
+ GError *tmp_err = NULL;
+
+ assertionHandle = lasso_node_get_child_content(LASSO_NODE(artifact),
+ "AssertionHandle",
+ NULL, &tmp_err);
+ if (assertionHandle == NULL) {
+ g_propagate_error (err, tmp_err);
+ }
+
+ return (assertionHandle);
}
gint
-lasso_artifact_get_byteCode(LassoArtifact *artifact)
+lasso_artifact_get_byteCode(LassoArtifact *artifact,
+ GError **err)
{
xmlChar *byteCode;
+ gint ret;
+ GError *tmp_err = NULL;
byteCode = lasso_node_get_child_content(LASSO_NODE(artifact),
- "ByteCode", NULL, NULL);
+ "ByteCode", NULL, &tmp_err);
+ if (byteCode == NULL) {
+ g_propagate_error (err, tmp_err);
+ return (-1);
+ }
- return ((gint)g_strtod(byteCode, NULL));
+ ret = (gint)g_strtod(byteCode, NULL);
+ xmlFree(byteCode);
+
+ return (ret);
}
xmlChar*
-lasso_artifact_get_identityProviderSuccinctID(LassoArtifact *artifact)
+lasso_artifact_get_identityProviderSuccinctID(LassoArtifact *artifact,
+ GError **err)
{
xmlChar *b64_identityProviderSuccinctID, *identityProviderSuccinctID;
+ GError *tmp_err = NULL;
- identityProviderSuccinctID = xmlMalloc(20+1);
b64_identityProviderSuccinctID = lasso_node_get_child_content(LASSO_NODE(artifact),
"B64IdentityProviderSuccinctID",
- NULL, NULL);
+ NULL, &tmp_err);
+ if (b64_identityProviderSuccinctID == NULL) {
+ g_propagate_error (err, tmp_err);
+ return(NULL);
+ }
+
+ identityProviderSuccinctID = xmlMalloc(20+1);
xmlSecBase64Decode(b64_identityProviderSuccinctID, identityProviderSuccinctID, 21);
xmlFree(b64_identityProviderSuccinctID);
@@ -102,17 +129,35 @@ lasso_artifact_get_identityProviderSuccinctID(LassoArtifact *artifact)
}
xmlChar*
-lasso_artifact_get_relayState(LassoArtifact *artifact)
+lasso_artifact_get_relayState(LassoArtifact *artifact,
+ GError **err)
{
- return (lasso_node_get_child_content(LASSO_NODE(artifact),
- "RelayState", NULL, NULL));
+ xmlChar *relayState;
+ GError *tmp_err = NULL;
+
+ relayState = lasso_node_get_child_content(LASSO_NODE(artifact),
+ "RelayState", NULL, &tmp_err);
+ if (relayState == NULL) {
+ g_propagate_error (err, tmp_err);
+ }
+
+ return (relayState);
}
xmlChar*
-lasso_artifact_get_samlArt(LassoArtifact *artifact)
+lasso_artifact_get_samlArt(LassoArtifact *artifact,
+ GError **err)
{
- return (lasso_node_get_child_content(LASSO_NODE(artifact),
- "SAMLArt", NULL, NULL));
+ xmlChar *samlArt;
+ GError *tmp_err = NULL;
+
+ samlArt = lasso_node_get_child_content(LASSO_NODE(artifact),
+ "SAMLArt", NULL, &tmp_err);
+ if (samlArt == NULL) {
+ g_propagate_error (err, tmp_err);
+ }
+
+ return (samlArt);
}
/*****************************************************************************/
diff --git a/lasso/Attic/protocols/artifact.h b/lasso/Attic/protocols/artifact.h
index 0efabcd5..c485b746 100644
--- a/lasso/Attic/protocols/artifact.h
+++ b/lasso/Attic/protocols/artifact.h
@@ -65,15 +65,20 @@ LASSO_EXPORT LassoNode* lasso_artifact_new_from_query (const xmlChar *query);
LASSO_EXPORT LassoNode* lasso_artifact_new_from_lares (const xmlChar *lares,
const xmlChar *relayState);
-LASSO_EXPORT xmlChar* lasso_artifact_get_assertionHandle (LassoArtifact *artifact);
+LASSO_EXPORT xmlChar* lasso_artifact_get_assertionHandle (LassoArtifact *artifact,
+ GError **err);
-LASSO_EXPORT gint lasso_artifact_get_byteCode (LassoArtifact *artifact);
+LASSO_EXPORT gint lasso_artifact_get_byteCode (LassoArtifact *artifact,
+ GError **err);
-LASSO_EXPORT xmlChar* lasso_artifact_get_identityProviderSuccinctID (LassoArtifact *artifact);
+LASSO_EXPORT xmlChar* lasso_artifact_get_identityProviderSuccinctID (LassoArtifact *artifact,
+ GError **err);
-LASSO_EXPORT xmlChar* lasso_artifact_get_relayState (LassoArtifact *artifact);
+LASSO_EXPORT xmlChar* lasso_artifact_get_relayState (LassoArtifact *artifact,
+ GError **err);
-LASSO_EXPORT xmlChar* lasso_artifact_get_samlArt (LassoArtifact *artifact);
+LASSO_EXPORT xmlChar* lasso_artifact_get_samlArt (LassoArtifact *artifact,
+ GError **err);
#ifdef __cplusplus
}