diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2006-12-28 17:46:32 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2006-12-28 17:46:32 +0000 |
| commit | 58477d96d883c1fd824912d85aa6f5464b986ca1 (patch) | |
| tree | 5050673a33f799f8807bf40412972e946eb94c82 | |
| parent | 1e77c84d5dccc4326995ca923c03f1ae5dce0256 (diff) | |
harmonized LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ and
LASSO_PARAM_ERROR_INVALID_VALUE usage
| -rw-r--r-- | lasso/id-ff/defederation.c | 2 | ||||
| -rw-r--r-- | lasso/id-ff/identity.c | 5 | ||||
| -rw-r--r-- | lasso/id-ff/lecp.c | 18 | ||||
| -rw-r--r-- | lasso/id-ff/logout.c | 6 | ||||
| -rw-r--r-- | lasso/id-ff/name_identifier_mapping.c | 8 | ||||
| -rw-r--r-- | lasso/id-wsf/authentication.c | 17 | ||||
| -rw-r--r-- | lasso/id-wsf/data_service.c | 3 |
7 files changed, 30 insertions, 29 deletions
diff --git a/lasso/id-ff/defederation.c b/lasso/id-ff/defederation.c index cf125a0c..9d9ddef5 100644 --- a/lasso/id-ff/defederation.c +++ b/lasso/id-ff/defederation.c @@ -285,7 +285,7 @@ lasso_defederation_process_notification_msg(LassoDefederation *defederation, cha g_return_val_if_fail(LASSO_IS_DEFEDERATION(defederation), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(request_msg != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(request_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); profile = LASSO_PROFILE(defederation); diff --git a/lasso/id-ff/identity.c b/lasso/id-ff/identity.c index 8419ab5e..155853da 100644 --- a/lasso/id-ff/identity.c +++ b/lasso/id-ff/identity.c @@ -50,8 +50,9 @@ struct _LassoIdentityPrivate gint lasso_identity_add_federation(LassoIdentity *identity, LassoFederation *federation) { - g_return_val_if_fail(LASSO_IS_IDENTITY(identity), LASSO_PARAM_ERROR_INVALID_VALUE); - g_return_val_if_fail(LASSO_IS_FEDERATION(federation), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_IDENTITY(identity), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(LASSO_IS_FEDERATION(federation), + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); /* add the federation, replace if one already exists */ g_hash_table_insert(identity->federations, diff --git a/lasso/id-ff/lecp.c b/lasso/id-ff/lecp.c index 7850015e..ec1db584 100644 --- a/lasso/id-ff/lecp.c +++ b/lasso/id-ff/lecp.c @@ -50,7 +50,7 @@ lasso_lecp_build_authn_request_envelope_msg(LassoLecp *lecp) xmlOutputBuffer *buf; xmlCharEncodingHandler *handler; - g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); profile = LASSO_PROFILE(lecp); @@ -111,7 +111,7 @@ lasso_lecp_build_authn_request_msg(LassoLecp *lecp) LassoProfile *profile; LassoProvider *remote_provider; - g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); profile = LASSO_PROFILE(lecp); @@ -148,7 +148,7 @@ lasso_lecp_build_authn_response_msg(LassoLecp *lecp) { LassoProfile *profile; - g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); profile = LASSO_PROFILE(lecp); profile->msg_url = g_strdup(lecp->assertionConsumerServiceURL); @@ -180,7 +180,7 @@ lasso_lecp_build_authn_response_envelope_msg(LassoLecp *lecp) LassoProvider *provider; gchar *assertionConsumerServiceURL; - g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); profile = LASSO_PROFILE(lecp); @@ -240,7 +240,7 @@ lasso_lecp_init_authn_request(LassoLecp *lecp, const char *remote_providerID) { gint res; - g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); /* FIXME : BAD usage of http_method using POST method so that the lib:AuthnRequest is initialize with @@ -265,7 +265,7 @@ lasso_lecp_init_authn_request(LassoLecp *lecp, const char *remote_providerID) int lasso_lecp_process_authn_request_msg(LassoLecp *lecp, const char *authn_request_msg) { - g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(authn_request_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); return lasso_login_process_authn_request_msg(LASSO_LOGIN(lecp), authn_request_msg); @@ -293,7 +293,7 @@ lasso_lecp_process_authn_request_envelope_msg(LassoLecp *lecp, const char *reque xmlCharEncodingHandler *handler; g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(request_msg != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(request_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); doc = xmlParseMemory(request_msg, strlen(request_msg)); xpathCtx = xmlXPathNewContext(doc); @@ -349,7 +349,7 @@ lasso_lecp_process_authn_response_envelope_msg(LassoLecp *lecp, const char *resp LassoProfile *profile; LassoMessageFormat format; - g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_LECP(lecp), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(response_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); profile = LASSO_PROFILE(lecp); @@ -385,7 +385,7 @@ lasso_lecp_process_authn_response_envelope_msg(LassoLecp *lecp, const char *resp void lasso_lecp_destroy(LassoLecp *lecp) { - g_object_unref(G_OBJECT(lecp)); + lasso_node_destroy(LASSO_NODE(lecp)); } /*****************************************************************************/ diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c index 8aeb467a..199ca931 100644 --- a/lasso/id-ff/logout.c +++ b/lasso/id-ff/logout.c @@ -487,7 +487,7 @@ lasso_logout_process_request_msg(LassoLogout *logout, char *request_msg) LassoProvider *remote_provider; LassoMessageFormat format; - g_return_val_if_fail(LASSO_IS_LOGOUT(logout), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_LOGOUT(logout), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(request_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); profile = LASSO_PROFILE(logout); @@ -564,7 +564,7 @@ lasso_logout_process_response_msg(LassoLogout *logout, gchar *response_msg) int rc; g_return_val_if_fail(LASSO_IS_LOGOUT(logout), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(response_msg != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(response_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); profile = LASSO_PROFILE(logout); @@ -742,7 +742,7 @@ lasso_logout_process_response_msg(LassoLogout *logout, gchar *response_msg) **/ gint lasso_logout_reset_providerID_index(LassoLogout *logout) { - g_return_val_if_fail(LASSO_IS_LOGOUT(logout), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_LOGOUT(logout), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); lasso_session_init_provider_ids(LASSO_PROFILE(logout)->session); logout->providerID_index = 0; return 0; diff --git a/lasso/id-ff/name_identifier_mapping.c b/lasso/id-ff/name_identifier_mapping.c index 55ad69b2..60560f1e 100644 --- a/lasso/id-ff/name_identifier_mapping.c +++ b/lasso/id-ff/name_identifier_mapping.c @@ -199,8 +199,8 @@ lasso_name_identifier_mapping_init_request(LassoNameIdentifierMapping *mapping, g_return_val_if_fail(LASSO_IS_NAME_IDENTIFIER_MAPPING(mapping), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(targetNamespace != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(remote_providerID != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(targetNamespace != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(remote_providerID != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); profile = LASSO_PROFILE(mapping); @@ -289,7 +289,7 @@ lasso_name_identifier_mapping_process_request_msg(LassoNameIdentifierMapping *ma g_return_val_if_fail(LASSO_IS_NAME_IDENTIFIER_MAPPING(mapping), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(request_msg != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(request_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); profile = LASSO_PROFILE(mapping); @@ -353,7 +353,7 @@ lasso_name_identifier_mapping_process_response_msg(LassoNameIdentifierMapping *m g_return_val_if_fail(LASSO_IS_NAME_IDENTIFIER_MAPPING(mapping), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(response_msg != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(response_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); profile = LASSO_PROFILE(mapping); diff --git a/lasso/id-wsf/authentication.c b/lasso/id-wsf/authentication.c index 84c83d49..4363d23a 100644 --- a/lasso/id-wsf/authentication.c +++ b/lasso/id-wsf/authentication.c @@ -206,10 +206,10 @@ lasso_authentication_init_request(LassoAuthentication *authentication, static sasl_callback_t global_callbacks[2]; g_return_val_if_fail(LASSO_IS_AUTHENTICATION(authentication), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(LASSO_IS_DISCO_DESCRIPTION(description), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(mechanisms != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(mechanisms != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); if (description->Endpoint != NULL) { @@ -298,11 +298,10 @@ lasso_authentication_process_request_msg(LassoAuthentication *authentication, int res = 0; g_return_val_if_fail(LASSO_IS_AUTHENTICATION(authentication), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(LASSO_IS_AUTHENTICATION(authentication), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(soap_msg != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(soap_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); /* if a previous request and response, then remove */ if (LASSO_IS_SOAP_ENVELOPE(LASSO_WSF_PROFILE(authentication)->soap_envelope_response) \ @@ -362,8 +361,8 @@ lasso_authentication_process_response_msg(LassoAuthentication *authentication, gchar *messageId; g_return_val_if_fail(LASSO_IS_AUTHENTICATION(authentication), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); - g_return_val_if_fail(soap_msg != NULL, LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(soap_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); /* if a previous request or response, remove */ if (LASSO_IS_SOAP_ENVELOPE(LASSO_WSF_PROFILE(authentication)->soap_envelope_request) \ diff --git a/lasso/id-wsf/data_service.c b/lasso/id-wsf/data_service.c index cb1c9ff6..93b05264 100644 --- a/lasso/id-wsf/data_service.c +++ b/lasso/id-wsf/data_service.c @@ -720,7 +720,8 @@ lasso_data_service_process_modify_response_msg(LassoDataService *service, const LassoDstModifyResponse *response; LassoSoapEnvelope *envelope; - g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), LASSO_PARAM_ERROR_INVALID_VALUE); + g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(soap_msg != NULL, LASSO_PARAM_ERROR_INVALID_VALUE); envelope = LASSO_SOAP_ENVELOPE(lasso_node_new_from_dump(soap_msg)); |
