diff options
| author | Damien Laniel <dlaniel@entrouvert.com> | 2006-11-02 10:51:13 +0000 |
|---|---|---|
| committer | Damien Laniel <dlaniel@entrouvert.com> | 2006-11-02 10:51:13 +0000 |
| commit | ee093042ad591ca4ee1591bf7d8bb633a4f0e973 (patch) | |
| tree | 77a3dcb0173bc0d9e9537bdff1ab9b7239f276a1 | |
| parent | a3f603c8bd603be57dbc4c817f7aaf904ee3ad87 (diff) | |
| download | lasso-ee093042ad591ca4ee1591bf7d8bb633a4f0e973.tar.gz lasso-ee093042ad591ca4ee1591bf7d8bb633a4f0e973.tar.xz lasso-ee093042ad591ca4ee1591bf7d8bb633a4f0e973.zip | |
Replaced return -1 with return LASSO_ERROR_UNDEFINED
| -rw-r--r-- | lasso/id-ff/defederation.c | 2 | ||||
| -rw-r--r-- | lasso/id-wsf/wsf_profile.c | 38 | ||||
| -rw-r--r-- | lasso/lasso.c | 10 | ||||
| -rw-r--r-- | lasso/xml/tools.c | 2 | ||||
| -rw-r--r-- | lasso/xml/xml.c | 6 |
5 files changed, 29 insertions, 29 deletions
diff --git a/lasso/id-ff/defederation.c b/lasso/id-ff/defederation.c index b73feac6..ec770135 100644 --- a/lasso/id-ff/defederation.c +++ b/lasso/id-ff/defederation.c @@ -70,7 +70,7 @@ lasso_defederation_build_notification_msg(LassoDefederation *defederation) profile = LASSO_PROFILE(defederation); if (profile->remote_providerID == NULL) { - /* this means lasso_logout_init_request was not called before */ + /* this means lasso_defederation_init_notification was not called before */ return critical_error(LASSO_PROFILE_ERROR_MISSING_REMOTE_PROVIDERID); } diff --git a/lasso/id-wsf/wsf_profile.c b/lasso/id-wsf/wsf_profile.c index 06480fb9..5cffe583 100644 --- a/lasso/id-wsf/wsf_profile.c +++ b/lasso/id-wsf/wsf_profile.c @@ -205,10 +205,10 @@ lasso_wsf_profile_verify_credential_signature(LassoWsfProfile *profile, /* Retrieve provider id of credential signer . Issuer could be the right place */ issuer = xmlGetProp(credential, "Issuer"); if (!issuer) - return -1; + return LASSO_ERROR_UNDEFINED; lasso_provider = lasso_server_get_provider(profile->server, issuer); if (!lasso_provider) - return -1; + return LASSO_ERROR_UNDEFINED; /* Set credential reference */ id_attr = xmlHasProp(credential, (xmlChar *)"AssertionID"); @@ -311,26 +311,26 @@ lasso_wsf_profile_add_credential_signature(LassoWsfProfile *profile, /* Sign SOAP message */ sign_tmpl = xmlSecFindNode(credential, xmlSecNodeSignature, xmlSecDSigNs); if (sign_tmpl == NULL) - return -1; + return LASSO_ERROR_UNDEFINED; dsigCtx = xmlSecDSigCtxCreate(NULL); dsigCtx->signKey = xmlSecCryptoAppKeyLoad(profile->server->private_key, xmlSecKeyDataFormatPem, NULL, NULL, NULL); if (dsigCtx->signKey == NULL) { xmlSecDSigCtxDestroy(dsigCtx); - return -1; + return LASSO_ERROR_UNDEFINED; } if (profile->server->certificate != NULL && profile->server->certificate[0] != 0) { if (xmlSecCryptoAppKeyCertLoad(dsigCtx->signKey, profile->server->certificate, xmlSecKeyDataFormatPem) < 0) { xmlSecDSigCtxDestroy(dsigCtx); - return -1; + return LASSO_ERROR_UNDEFINED; } } if (xmlSecDSigCtxSign(dsigCtx, sign_tmpl) < 0) { xmlSecDSigCtxDestroy(dsigCtx); - return -1; + return LASSO_ERROR_UNDEFINED; } xmlSecDSigCtxDestroy(dsigCtx); @@ -470,7 +470,7 @@ lasso_wsf_profile_verify_saml_authentication(LassoWsfProfile *profile, xmlDoc *d if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr) printf("OK ca a l'air bon ...\n"); else - return -1; + return LASSO_ERROR_UNDEFINED; credential = xpathObj->nodesetval->nodeTab[0]; @@ -481,7 +481,7 @@ lasso_wsf_profile_verify_saml_authentication(LassoWsfProfile *profile, xmlDoc *d public_key = lasso_wsf_profile_get_public_key_from_credential(profile, credential); if (!public_key) - return -1; + return LASSO_ERROR_UNDEFINED; printf("Xml sec public key found\n"); res = lasso_wsf_profile_verify_x509_authentication(profile, doc, public_key); @@ -517,9 +517,9 @@ lasso_wsf_profile_add_soap_signature(LassoWsfProfile *profile, xmlDoc *doc, xmlN t = t->next; } if (header == NULL) - return -1; + return LASSO_ERROR_UNDEFINED; if (body == NULL) - return -1; + return LASSO_ERROR_UNDEFINED; t = header->children; while (t) { @@ -532,9 +532,9 @@ lasso_wsf_profile_add_soap_signature(LassoWsfProfile *profile, xmlDoc *doc, xmlN t = t->next; } if (correlation == NULL) - return -1; + return LASSO_ERROR_UNDEFINED; if (security == NULL) - return -1; + return LASSO_ERROR_UNDEFINED; /* Add signature template */ if (sign_method == LASSO_SIGNATURE_METHOD_RSA_SHA1) { @@ -593,7 +593,7 @@ lasso_wsf_profile_add_soap_signature(LassoWsfProfile *profile, xmlDoc *doc, xmlN /* Sign SOAP message */ /*sign_tmpl = xmlSecFindNode(security, xmlSecNodeSignature, xmlSecDSigNs); if (sign_tmpl == NULL) - return -1;*/ + return LASSO_ERROR_UNDEFINED;*/ sign_tmpl = signature; dsigCtx = xmlSecDSigCtxCreate(NULL); @@ -601,18 +601,18 @@ lasso_wsf_profile_add_soap_signature(LassoWsfProfile *profile, xmlDoc *doc, xmlN xmlSecKeyDataFormatPem, NULL, NULL, NULL); if (dsigCtx->signKey == NULL) { xmlSecDSigCtxDestroy(dsigCtx); - return -1; + return LASSO_ERROR_UNDEFINED; } if (profile->server->certificate != NULL && profile->server->certificate[0] != 0) { if (xmlSecCryptoAppKeyCertLoad(dsigCtx->signKey, profile->server->certificate, xmlSecKeyDataFormatPem) < 0) { xmlSecDSigCtxDestroy(dsigCtx); - return -1; + return LASSO_ERROR_UNDEFINED; } } if (xmlSecDSigCtxSign(dsigCtx, sign_tmpl) < 0) { xmlSecDSigCtxDestroy(dsigCtx); - return -1; + return LASSO_ERROR_UNDEFINED; } xmlSecDSigCtxDestroy(dsigCtx); @@ -645,7 +645,7 @@ lasso_wsf_profile_verify_x509_authentication(LassoWsfProfile *profile, correlation = xpathObj->nodesetval->nodeTab[0]; } if (!correlation) - return -1; + return LASSO_ERROR_UNDEFINED; id_attr = xmlHasProp(correlation, (xmlChar *)"id"); id = xmlGetProp(correlation, (xmlChar *) "id"); xmlAddID(NULL, doc, id, id_attr); @@ -658,7 +658,7 @@ lasso_wsf_profile_verify_x509_authentication(LassoWsfProfile *profile, body = xpathObj->nodesetval->nodeTab[0]; } if (!body) - return -1; + return LASSO_ERROR_UNDEFINED; id_attr = xmlHasProp(body, (xmlChar *)"id"); id = xmlGetProp(body, (xmlChar *) "id"); xmlAddID(NULL, doc, id, id_attr); @@ -1216,7 +1216,7 @@ lasso_wsf_profile_process_soap_request_msg(LassoWsfProfile *profile, const gchar profile->private_data->description = NULL; } else if (!si) - return -1; + return LASSO_ERROR_UNDEFINED; else lasso_wsf_profile_get_description_auto(si, security_mech_id); diff --git a/lasso/lasso.c b/lasso/lasso.c index d50a30c2..0bf0551a 100644 --- a/lasso/lasso.c +++ b/lasso/lasso.c @@ -82,7 +82,7 @@ int lasso_init() /* Init xmlsec library */ if (xmlSecInit() < 0) { message(G_LOG_LEVEL_CRITICAL, "XMLSec initialization failed."); - return -1; + return LASSO_ERROR_UNDEFINED; } /* Load default crypto engine if we are supporting dynamic @@ -96,20 +96,20 @@ int lasso_init() "Unable to load default xmlsec-crypto library. Make sure" "that you have it installed and check shared libraries path" "(LD_LIBRARY_PATH) environment variable."); - return -1; + return LASSO_ERROR_UNDEFINED; } #endif /* XMLSEC_CRYPTO_DYNAMIC_LOADING */ /* Init crypto library */ if (xmlSecCryptoAppInit(NULL) < 0) { message(G_LOG_LEVEL_CRITICAL, "Crypto initialization failed."); - return -1; + return LASSO_ERROR_UNDEFINED; } /* Init xmlsec-crypto library */ if (xmlSecCryptoInit() < 0) { message(G_LOG_LEVEL_CRITICAL, "xmlsec-crypto initialization failed."); - return -1; + return LASSO_ERROR_UNDEFINED; } return 0; } @@ -197,7 +197,7 @@ lasso_check_version(int major, int minor, int subminor, LassoCheckVersionMode mo } if (mode > LASSO_CHECK_VERSION_NUMERIC) - return -1; + return LASSO_ERROR_UNDEFINED; return 1; } diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c index 29b2b041..56c89438 100644 --- a/lasso/xml/tools.c +++ b/lasso/xml/tools.c @@ -142,7 +142,7 @@ lasso_get_pem_file_type(const char *pem_file) bio = BIO_new_file(pem_file, "rb"); if (bio == NULL) { message(G_LOG_LEVEL_CRITICAL, "Failed to open %s pem file", pem_file); - return -1; + return LASSO_ERROR_UNDEFINED; } pkey = PEM_read_bio_PUBKEY(bio, NULL, NULL, NULL); diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index fce0f063..4196bf4f 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -1249,13 +1249,13 @@ find_path(LassoNode *node, char *path, LassoNode **value_node, struct XmlSnippet if (t) { tnode = G_STRUCT_MEMBER(LassoNode*, tnode, tsnippet->offset); if (tnode == NULL) - return -1; + return LASSO_ERROR_UNDEFINED; } s = t+1; } if (tsnippet == NULL) - return -1; + return LASSO_ERROR_UNDEFINED; *snippet = tsnippet; *value_node = tnode; @@ -1366,7 +1366,7 @@ set_value_at_path(LassoNode *node, char *path, char *query_value) void *value; if (find_path(node, path, &value_node, &snippet) != 0) - return -1; + return LASSO_ERROR_UNDEFINED; value = G_STRUCT_MEMBER_P(value_node, snippet->offset); |
