diff options
96 files changed, 549 insertions, 508 deletions
diff --git a/bindings/bindings.py b/bindings/bindings.py index 458c5ff3..bdfd6417 100644 --- a/bindings/bindings.py +++ b/bindings/bindings.py @@ -102,7 +102,7 @@ class BindingData: arg_type = f.args[0][0] if arg_type[-1] == '*': arg_type = arg_type[:-1] - arg_type = arg_type.replace('const ','') + arg_type = arg_type.replace('const ','') c = self.struct_dict.get(arg_type) if not c: continue diff --git a/bindings/java/lang.py b/bindings/java/lang.py index e517ed21..b4249052 100644 --- a/bindings/java/lang.py +++ b/bindings/java/lang.py @@ -106,7 +106,7 @@ def is_const_type(type): class Binding: def __init__(self, binding_data): self.binding_data = binding_data - self.src_dir = os.path.dirname(__file__) + self.src_dir = os.path.dirname(__file__) def print_list_of_files(self): l = ['GObject.java','LassoConstants.java','LassoJNI.java','LassoException.java', 'LassoUndefinedException.java', 'LassoUnimplementedException.java'] @@ -168,13 +168,13 @@ public abstract interface LassoConstants { # Declaration for c in self.binding_data.constants: print >> fd, 'static final ', - if c[0] == 'i': - print >> fd, 'int ', - elif c[0] == 's': - print >> fd, 'String ', + if c[0] == 'i': + print >> fd, 'int ', + elif c[0] == 's': + print >> fd, 'String ', elif c[0] == 'b': print >> fd, 'boolean ', - print >> fd, '%s = LassoJNI.%s_get();' % (c[1][6:], c[1]) + print >> fd, '%s = LassoJNI.%s_get();' % (c[1][6:], c[1]) def generate_Constants_footer(self, fd): print >> fd, '}' @@ -235,9 +235,9 @@ protected static native void destroy(long cptr); return 'GObject' def JNI_return_type(self, vtype): - if vtype: - m = re.match(r'(?:const\s*)?(.*)',vtype) - vtype = m.group(1) + if vtype: + m = re.match(r'(?:const\s*)?(.*)',vtype) + vtype = m.group(1) if vtype == 'gboolean': return 'boolean' elif vtype in ['int','gint'] + self.binding_data.enums: diff --git a/bindings/php5/wrapper_source.py b/bindings/php5/wrapper_source.py index 8279d3db..319b9671 100644 --- a/bindings/php5/wrapper_source.py +++ b/bindings/php5/wrapper_source.py @@ -29,7 +29,7 @@ class WrapperSource: self.binding_data = binding_data self.fd = fd self.functions_list = [] - self.src_dir = os.path.dirname(__file__) + self.src_dir = os.path.dirname(__file__) def is_object(self, t): return t not in ['char*', 'const char*', 'gchar*', 'const gchar*', 'GList*', 'GHashTable*', diff --git a/bindings/python/tests/Makefile.am b/bindings/python/tests/Makefile.am index 8b3791b3..64dfc090 100644 --- a/bindings/python/tests/Makefile.am +++ b/bindings/python/tests/Makefile.am @@ -1,7 +1,8 @@ MAINTAINERCLEANFILES = Makefile.in +TESTS = # if PYTHON_ENABLED -TESTS = profiles_tests.py binding_tests.py +TESTS += profiles_tests.py binding_tests.py endif if WSF_ENABLED diff --git a/bindings/python/tests/idwsf1_tests.py b/bindings/python/tests/idwsf1_tests.py index 1867b19b..3dc5cf86 100755 --- a/bindings/python/tests/idwsf1_tests.py +++ b/bindings/python/tests/idwsf1_tests.py @@ -187,7 +187,7 @@ class DiscoveryModifyTestCase(IdWsf1TestCase): idp_disco.processModifyMsg(wsp_disco.msgBody) idp_disco.setIdentityFromDump(idp_identity_dump) idp_disco.buildModifyResponseMsg() - offerings = idp_disco.identity.getOfferings() + offerings = idp_disco.identity.getOfferings() self.failUnless('<disco:Status code="OK"/>' in idp_disco.msgBody) self.failUnless('<disco:ModifyResponse newEntryIDs="%s"' % offerings[0].entryId in idp_disco.msgBody) self.failUnless('<disco:ServiceType>urn:liberty:id-sis-pp:2003-08</disco:ServiceType>' in @@ -220,7 +220,7 @@ class DiscoveryRemoveTestCase(IdWsf1TestCase): idp_disco = lasso.Discovery(self.idp) idp_disco.processModifyMsg(wsp_disco.msgBody) idp_disco.setIdentityFromDump(idp_identity_dump) - offering = self.get_resource_offering() + offering = self.get_resource_offering() idp_disco.getIdentity().addResourceOffering(offering) self.failUnless('<disco:ServiceType>urn:liberty:id-sis-pp:2003-08</disco:ServiceType>' in idp_disco.identity.dump()) diff --git a/lasso/build_strerror.py b/lasso/build_strerror.py index 7461d3b4..ac9215b2 100644 --- a/lasso/build_strerror.py +++ b/lasso/build_strerror.py @@ -12,19 +12,19 @@ hlines = file('%s/errors.h' % srcdir,'r').readlines() messages = dict() for line in hlines: - m = re.match(r'#define (LASSO_\w+).*\/\*\s*(.*?)\s*\*\/', line) - if m: - messages[m.group(1)] = m.group(2) - else: - m = re.match(r'#define (LASSO_\w+)',line) - if m: - messages[m.group(1)] = m.group(1) + m = re.match(r'#define (LASSO_\w+).*\/\*\s*(.*?)\s*\*\/', line) + if m: + messages[m.group(1)] = m.group(2) + else: + m = re.match(r'#define (LASSO_\w+)',line) + if m: + messages[m.group(1)] = m.group(1) clines = file('%s/errors.c.in' % srcdir,'r').readlines() for line in clines: - if '@ERROR_CASES@' in line: - for k in messages: - print """ case %s: + if '@ERROR_CASES@' in line: + for k in messages: + print """ case %s: return "%s";""" % (k,messages[k]) - else: - print line, + else: + print line, diff --git a/lasso/id-ff/defederation.h b/lasso/id-ff/defederation.h index d4acf375..97ca0ac4 100644 --- a/lasso/id-ff/defederation.h +++ b/lasso/id-ff/defederation.h @@ -59,7 +59,6 @@ struct _LassoDefederationClass { LASSO_EXPORT GType lasso_defederation_get_type(void); LASSO_EXPORT LassoDefederation *lasso_defederation_new(LassoServer *server); - LASSO_EXPORT gint lasso_defederation_build_notification_msg(LassoDefederation *defederation); @@ -70,7 +69,7 @@ LASSO_EXPORT gint lasso_defederation_init_notification(LassoDefederation *defede LASSO_EXPORT gint lasso_defederation_process_notification_msg( LassoDefederation *defederation, gchar *notification_msg); - + LASSO_EXPORT gint lasso_defederation_validate_notification(LassoDefederation *defederation); diff --git a/lasso/id-ff/federation.c b/lasso/id-ff/federation.c index f4b0ca3e..b2ee6b5b 100644 --- a/lasso/id-ff/federation.c +++ b/lasso/id-ff/federation.c @@ -75,9 +75,9 @@ lasso_federation_build_name_identifier(const gchar *nameQualifier, **/ void lasso_federation_build_local_name_identifier(LassoFederation *federation, - const gchar *nameQualifier, - const gchar *format, - const gchar *content) + const gchar *nameQualifier, + const gchar *format, + const gchar *content) { federation->local_nameIdentifier = lasso_federation_build_name_identifier( nameQualifier, format, content); diff --git a/lasso/id-ff/identity.c b/lasso/id-ff/identity.c index 77a89f27..d1c4f567 100644 --- a/lasso/id-ff/identity.c +++ b/lasso/id-ff/identity.c @@ -163,7 +163,8 @@ lasso_identity_add_resource_offering(LassoIdentity *identity, identity->private_data->last_entry_id++; } while (g_hash_table_lookup(identity->private_data->resource_offerings_map, entry_id_s)); lasso_assign_string(offering->entryID, entry_id_s); - g_hash_table_insert(identity->private_data->resource_offerings_map, g_strdup(offering->entryID), g_object_ref(offering)); + g_hash_table_insert(identity->private_data->resource_offerings_map, + g_strdup(offering->entryID), g_object_ref(offering)); identity->is_dirty = TRUE; return 0; @@ -320,8 +321,6 @@ get_xmlNode(LassoNode *node, gboolean lasso_dump) (GHFunc)add_childnode_from_hashtable, xmlnode); #ifdef LASSO_WSF_ENABLED /* Resource Offerings */ - //g_list_foreach(identity->private_data->resource_offerings, - // (GFunc)add_childnode_from_list, xmlnode); g_hash_table_foreach(identity->private_data->resource_offerings_map, (GHFunc)add_childnode_from_hashtable, xmlnode); diff --git a/lasso/id-ff/login.c b/lasso/id-ff/login.c index 7950f004..b94b8d50 100644 --- a/lasso/id-ff/login.c +++ b/lasso/id-ff/login.c @@ -857,12 +857,12 @@ lasso_login_build_artifact_msg(LassoLogin *login, LassoHttpMethod http_method) if (ss->Subject != NULL && ss->Subject->SubjectConfirmation != NULL) { if (assertion->MajorVersion == 1 && assertion->MinorVersion == 0) { ss->Subject->SubjectConfirmation->ConfirmationMethod = - g_list_append(NULL, - g_strdup(LASSO_SAML_CONFIRMATION_METHOD_ARTIFACT01)); + g_list_append(NULL, + g_strdup(LASSO_SAML_CONFIRMATION_METHOD_ARTIFACT01)); } else { ss->Subject->SubjectConfirmation->ConfirmationMethod = - g_list_append(NULL, - g_strdup(LASSO_SAML_CONFIRMATION_METHOD_ARTIFACT)); + g_list_append(NULL, + g_strdup(LASSO_SAML_CONFIRMATION_METHOD_ARTIFACT)); } } } @@ -1923,12 +1923,12 @@ lasso_login_process_response_msg(LassoLogin *login, gchar *response_msg) **/ int lasso_login_set_encryptedResourceId(LassoLogin *login, - LassoDiscoEncryptedResourceID *encryptedResourceId) + LassoDiscoEncryptedResourceID *encryptedResourceId) { #ifdef LASSO_WSF_ENABLED g_return_val_if_fail(LASSO_IS_LOGIN(login), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(LASSO_IS_DISCO_ENCRYPTED_RESOURCE_ID(encryptedResourceId), - LASSO_PARAM_ERROR_INVALID_VALUE); + LASSO_PARAM_ERROR_INVALID_VALUE); login->private_data->encryptedResourceId = g_object_ref(encryptedResourceId); #endif diff --git a/lasso/id-ff/name_registration.h b/lasso/id-ff/name_registration.h index d033d48b..b8bf8980 100644 --- a/lasso/id-ff/name_registration.h +++ b/lasso/id-ff/name_registration.h @@ -92,7 +92,7 @@ LASSO_EXPORT gint lasso_name_registration_process_response_msg( LASSO_EXPORT gint lasso_name_registration_validate_request( LassoNameRegistration *name_registration); - + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/lasso/id-ff/provider.c b/lasso/id-ff/provider.c index ec89c15e..79655b5d 100644 --- a/lasso/id-ff/provider.c +++ b/lasso/id-ff/provider.c @@ -83,7 +83,7 @@ lasso_provider_get_assertion_consumer_service_url(LassoProvider *provider, const char *sid = (char*)service_id; char *name; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); if (sid == NULL) sid = provider->private_data->default_assertion_consumer; @@ -116,7 +116,7 @@ lasso_provider_get_metadata_one(LassoProvider *provider, const char *name) GList *l; GHashTable *descriptor; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); descriptor = provider->private_data->SPDescriptor; /* default to SP */ if (provider->role == LASSO_PROVIDER_ROLE_IDP) descriptor = provider->private_data->IDPDescriptor; @@ -147,7 +147,7 @@ lasso_provider_get_metadata_list(LassoProvider *provider, const char *name) { GHashTable *descriptor; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); descriptor = provider->private_data->SPDescriptor; /* default to SP */ if (provider->role == LASSO_PROVIDER_ROLE_IDP) descriptor = provider->private_data->IDPDescriptor; @@ -177,7 +177,7 @@ lasso_provider_get_first_http_method(LassoProvider *provider, GList *t1, *t2 = NULL; gboolean found; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), LASSO_HTTP_METHOD_NONE); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), LASSO_HTTP_METHOD_NONE); if (provider->private_data->conformance == LASSO_PROTOCOL_SAML_2_0) { return lasso_saml20_provider_get_first_http_method( provider, remote_provider, protocol_type); @@ -245,7 +245,7 @@ lasso_provider_accept_http_method(LassoProvider *provider, LassoProvider *remote LassoProviderRole initiating_role; char *protocol_profile; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), FALSE); // Be conservative + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), FALSE); /* Be conservative */ if (provider->private_data->conformance == LASSO_PROTOCOL_SAML_2_0) { return lasso_saml20_provider_accept_http_method( provider, remote_provider, protocol_type, @@ -300,7 +300,7 @@ lasso_provider_has_protocol_profile(LassoProvider *provider, { GList *supported; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), FALSE); // Be conservative + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), FALSE); /* Be conservative */ supported = lasso_provider_get_metadata_list( provider, protocol_md_nodename[protocol_type]); @@ -323,7 +323,7 @@ lasso_provider_get_base64_succinct_id(LassoProvider *provider) { char *succinct_id, *base64_succinct_id; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); succinct_id = lasso_sha1(provider->ProviderID); base64_succinct_id = (char*)xmlSecBase64Encode((xmlChar*)succinct_id, 20, 0); xmlFree(succinct_id); @@ -343,7 +343,7 @@ lasso_provider_get_base64_succinct_id(LassoProvider *provider) xmlNode* lasso_provider_get_organization(LassoProvider *provider) { - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); if (provider->private_data->organization) { return xmlCopyNode(provider->private_data->organization, 1); } else { @@ -353,7 +353,7 @@ lasso_provider_get_organization(LassoProvider *provider) /*****************************************************************************/ -/* private methods */ +/* private methods */ /*****************************************************************************/ static struct XmlSnippet schema_snippets[] = { @@ -369,7 +369,7 @@ static LassoNodeClass *parent_class = NULL; xmlSecKey* lasso_provider_get_public_key(LassoProvider *provider) { - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), NULL); return provider->private_data->public_key; } @@ -420,6 +420,7 @@ load_descriptor(xmlNode *xmlnode, GHashTable *descriptor, LassoProvider *provide elements = g_hash_table_lookup(descriptor, name); value = xmlNodeGetContent(t); elements = g_list_append(elements, g_strdup((char*)value)); + // Do not mix g_free strings with xmlFree strings xmlFree(value); g_hash_table_insert(descriptor, name, elements); t = t->next; @@ -500,7 +501,7 @@ init_from_xml(LassoNode *node, xmlNode *xmlnode) } /*****************************************************************************/ -/* overridden parent class methods */ +/* overridden parent class methods */ /*****************************************************************************/ static void @@ -566,12 +567,12 @@ dispose(GObject *object) } if (provider->private_data->encryption_public_key_str) { - g_free(provider->private_data->encryption_public_key_str); - provider->private_data->encryption_public_key_str = NULL; + g_free(provider->private_data->encryption_public_key_str); + provider->private_data->encryption_public_key_str = NULL; } if (provider->private_data->encryption_public_key) { - xmlSecKeyDestroy(provider->private_data->encryption_public_key); + xmlSecKeyDestroy(provider->private_data->encryption_public_key); provider->private_data->encryption_public_key = NULL; } @@ -671,7 +672,7 @@ lasso_provider_get_type() LassoProtocolConformance lasso_provider_get_protocol_conformance(LassoProvider *provider) { - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), LASSO_PROTOCOL_NONE); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), LASSO_PROTOCOL_NONE); return provider->private_data->conformance; } @@ -686,7 +687,7 @@ lasso_provider_load_metadata(LassoProvider *provider, const gchar *metadata) const char *xpath_sp = "/md:EntityDescriptor/md:SPDescriptor"; const char *xpath_organization = "/md:EntityDescriptor/md:Organization"; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), FALSE); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), FALSE); doc = xmlParseFile(metadata); if (doc == NULL) return FALSE; @@ -843,7 +844,7 @@ lasso_provider_load_public_key(LassoProvider *provider, LassoPublicKeyType publi }; int i; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), FALSE); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), FALSE); if (public_key_type == LASSO_PUBLIC_KEY_SIGNING) { public_key = provider->public_key; key_descriptor = provider->private_data->signing_key_descriptor; @@ -983,7 +984,7 @@ lasso_provider_verify_signature(LassoProvider *provider, xmlXPathContext *xpathCtx = NULL; xmlXPathObject *xpathObj = NULL; - g_return_val_if_fail(LASSO_IS_PROVIDER(provider), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + g_return_val_if_fail(LASSO_IS_PROVIDER(provider), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); msg = (char*)message; if (message == NULL) @@ -1132,7 +1133,7 @@ lasso_provider_verify_signature(LassoProvider *provider, void lasso_provider_set_encryption_mode(LassoProvider *provider, LassoEncryptionMode encryption_mode) { - g_return_if_fail(LASSO_IS_PROVIDER(provider)); + g_return_if_fail(LASSO_IS_PROVIDER(provider)); provider->private_data->encryption_mode = encryption_mode; } @@ -1147,6 +1148,6 @@ void lasso_provider_set_encryption_sym_key_type(LassoProvider *provider, LassoEncryptionSymKeyType encryption_sym_key_type) { - g_return_if_fail(LASSO_IS_PROVIDER(provider)); + g_return_if_fail(LASSO_IS_PROVIDER(provider)); provider->private_data->encryption_sym_key_type = encryption_sym_key_type; } diff --git a/lasso/id-ff/provider.h b/lasso/id-ff/provider.h index bbe6d7d6..527cd571 100644 --- a/lasso/id-ff/provider.h +++ b/lasso/id-ff/provider.h @@ -124,7 +124,7 @@ typedef enum { * Provider protocol conformance. **/ typedef enum { - LASSO_PROTOCOL_NONE = -1, + LASSO_PROTOCOL_NONE = -1, LASSO_PROTOCOL_LIBERTY_1_0, LASSO_PROTOCOL_LIBERTY_1_1, LASSO_PROTOCOL_LIBERTY_1_2, diff --git a/lasso/id-ff/server.c b/lasso/id-ff/server.c index a6568a7f..cca8a579 100644 --- a/lasso/id-ff/server.c +++ b/lasso/id-ff/server.c @@ -699,9 +699,9 @@ lasso_server_get_type() **/ LassoServer* lasso_server_new(const gchar *metadata, - const gchar *private_key, - const gchar *private_key_password, - const gchar *certificate) + const gchar *private_key, + const gchar *private_key_password, + const gchar *certificate) { LassoServer *server; diff --git a/lasso/id-ff/session.c b/lasso/id-ff/session.c index 0e7c8942..83bd55ca 100644 --- a/lasso/id-ff/session.c +++ b/lasso/id-ff/session.c @@ -49,7 +49,7 @@ #include <xmlsec/base64.h> /*****************************************************************************/ -/* public methods */ +/* public methods */ /*****************************************************************************/ static gint @@ -468,7 +468,7 @@ lasso_session_get_assertion_identity_token(LassoSession *session, const gchar *s #endif /*****************************************************************************/ -/* private methods */ +/* private methods */ /*****************************************************************************/ static LassoNodeClass *parent_class = NULL; @@ -612,9 +612,9 @@ base64_to_xmlNode(xmlChar *buffer) { if (doc == NULL) goto exit; ret = xmlDocGetRootElement(doc); - if (ret) { - ret = xmlCopyNode(ret, 1); - } + if (ret) { + ret = xmlCopyNode(ret, 1); + } exit: lasso_release(decoded); lasso_release_doc(doc); @@ -640,40 +640,40 @@ init_from_xml(LassoNode *node, xmlNode *xmlnode) } if (strcmp((char*)t->name, "Assertion") == 0) { - xmlChar* value; + xmlChar* value; n = t->children; while (n && n->type != XML_ELEMENT_NODE) n = n->next; - + if (n) { LassoNode *assertion; - + if ((value = xmlGetProp(t, (xmlChar*)"RemoteProviderID"))) { assertion = lasso_node_new_from_xmlNode(n); lasso_session_add_assertion_simple(session, (char*)value, assertion); xmlFree(value); } - } else if ((value = xmlGetProp(t, (xmlChar*)"ID"))) { - xmlChar *content; - xmlNode *assertion; - - content = xmlNodeGetContent(t); - if (content) { - assertion = base64_to_xmlNode(content); - if (assertion) { - lasso_session_add_assertion_with_id(session, - (char*)value, assertion); - xmlFreeNode(assertion); - } - xmlFree(content); - } - xmlFree(value); + } else if ((value = xmlGetProp(t, (xmlChar*)"ID"))) { + xmlChar *content; + xmlNode *assertion; + + content = xmlNodeGetContent(t); + if (content) { + assertion = base64_to_xmlNode(content); + if (assertion) { + lasso_session_add_assertion_with_id(session, + (char*)value, assertion); + xmlFreeNode(assertion); + } + xmlFree(content); + } + xmlFree(value); } } if (strcmp((char*)t->name, "Status") == 0) { n = t->children; while (n && n->type != XML_ELEMENT_NODE) n = n->next; - + if (n) { LassoNode *status; status = lasso_node_new_from_xmlNode(n); @@ -694,7 +694,7 @@ init_from_xml(LassoNode *node, xmlNode *xmlnode) continue; } epr = LASSO_WSA_ENDPOINT_REFERENCE( - lasso_wsa_endpoint_reference_new()); + lasso_wsa_endpoint_reference_new()); LASSO_NODE_GET_CLASS(epr)->init_from_xml(LASSO_NODE(epr), t2); lasso_session_add_endpoint_reference(session, epr); g_object_unref(epr); @@ -712,7 +712,7 @@ init_from_xml(LassoNode *node, xmlNode *xmlnode) /*****************************************************************************/ -/* overridden parent class methods */ +/* overridden parent class methods */ /*****************************************************************************/ static void @@ -756,7 +756,7 @@ finalize(GObject *object) } /*****************************************************************************/ -/* instance and class init functions */ +/* instance and class init functions */ /*****************************************************************************/ static void diff --git a/lasso/id-wsf-2.0/data_service.c b/lasso/id-wsf-2.0/data_service.c index 83095b7f..468389b2 100644 --- a/lasso/id-wsf-2.0/data_service.c +++ b/lasso/id-wsf-2.0/data_service.c @@ -380,7 +380,8 @@ lasso_idwsf2_data_service_process_query_response_msg(LassoIdWsf2DataService *ser GList* -lasso_idwsf2_data_service_get_attribute_nodes(LassoIdWsf2DataService *service, const gchar *item_id) +lasso_idwsf2_data_service_get_attribute_nodes(LassoIdWsf2DataService *service, + const gchar *item_id) { LassoIdWsf2Profile *profile = LASSO_IDWSF2_PROFILE(service); LassoIdWsf2DstRefQueryResponse *response; diff --git a/lasso/id-wsf-2.0/data_service.h b/lasso/id-wsf-2.0/data_service.h index 509cb8a2..aedce8b1 100644 --- a/lasso/id-wsf-2.0/data_service.h +++ b/lasso/id-wsf-2.0/data_service.h @@ -38,15 +38,15 @@ extern "C" { #define LASSO_TYPE_IDWSF2_DATA_SERVICE (lasso_idwsf2_data_service_get_type()) #define LASSO_IDWSF2_DATA_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - LASSO_TYPE_IDWSF2_DATA_SERVICE, LassoIdWsf2DataService)) + LASSO_TYPE_IDWSF2_DATA_SERVICE, LassoIdWsf2DataService)) #define LASSO_IDWSF2_DATA_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - LASSO_TYPE_IDWSF2_DATA_SERVICE, LassoIdWsf2DataServiceClass)) + LASSO_TYPE_IDWSF2_DATA_SERVICE, LassoIdWsf2DataServiceClass)) #define LASSO_IS_IDWSF2_DATA_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - LASSO_TYPE_IDWSF2_DATA_SERVICE)) + LASSO_TYPE_IDWSF2_DATA_SERVICE)) #define LASSO_IS_IDWSF2_DATA_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_IDWSF2_DATA_SERVICE)) + LASSO_TYPE_IDWSF2_DATA_SERVICE)) #define LASSO_IDWSF2_DATA_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_IDWSF2_DATA_SERVICE, LassoIdWsf2DataServiceClass)) + LASSO_TYPE_IDWSF2_DATA_SERVICE, LassoIdWsf2DataServiceClass)) typedef struct _LassoIdWsf2DataService LassoIdWsf2DataService; typedef struct _LassoIdWsf2DataServiceClass LassoIdWsf2DataServiceClass; diff --git a/lasso/id-wsf-2.0/discovery.c b/lasso/id-wsf-2.0/discovery.c index 9932e8d8..76373374 100644 --- a/lasso/id-wsf-2.0/discovery.c +++ b/lasso/id-wsf-2.0/discovery.c @@ -543,18 +543,18 @@ lasso_idwsf2_discovery_build_epr(LassoIdWsf2DiscoRequestedService *service, /* Abstract */ metadata->any = g_list_append(metadata->any, - lasso_idwsf2_disco_abstract_new_with_string(svcMD->Abstract)); - /* ProviderID */ + lasso_idwsf2_disco_abstract_new_with_string(svcMD->Abstract)); + /* ProviderID */ metadata->any = g_list_append(metadata->any, - lasso_idwsf2_disco_provider_id_new_with_string(svcMD->ProviderID)); - /* ServiceType */ + lasso_idwsf2_disco_provider_id_new_with_string(svcMD->ProviderID)); + /* ServiceType */ metadata->any = g_list_append(metadata->any, - lasso_idwsf2_disco_service_type_new_with_string( - (char*)service_context->ServiceType->data)); + lasso_idwsf2_disco_service_type_new_with_string( + (char*)service_context->ServiceType->data)); /* Framework */ if (endpoint_context->Framework != NULL) { metadata->any = g_list_append(metadata->any, - g_object_ref((GObject*)endpoint_context->Framework->data)); + g_object_ref((GObject*)endpoint_context->Framework->data)); } /* Identity token */ @@ -759,7 +759,7 @@ lasso_idwsf2_discovery_get_service(LassoIdWsf2Discovery *discovery, const gchar } /*****************************************************************************/ -/* private methods */ +/* private methods */ /*****************************************************************************/ static LassoNodeClass *parent_class = NULL; @@ -856,7 +856,7 @@ lasso_idwsf2_discovery_get_type() }; this_type = g_type_register_static(LASSO_TYPE_IDWSF2_PROFILE, - "LassoIdWsf2Discovery", &this_info, 0); + "LassoIdWsf2Discovery", &this_info, 0); } return this_type; } diff --git a/lasso/id-wsf-2.0/profile.c b/lasso/id-wsf-2.0/profile.c index f49fa5da..eb376a11 100644 --- a/lasso/id-wsf-2.0/profile.c +++ b/lasso/id-wsf-2.0/profile.c @@ -116,7 +116,7 @@ gint lasso_idwsf2_profile_build_request_msg(LassoIdWsf2Profile *profile) { g_return_val_if_fail(LASSO_IS_IDWSF2_PROFILE(profile), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); LASSO_PROFILE(profile)->msg_body = lasso_node_export_to_xml( LASSO_NODE(profile->soap_envelope_request)); diff --git a/lasso/id-wsf-2.0/profile.h b/lasso/id-wsf-2.0/profile.h index 26b29ba8..c0d9f3f6 100644 --- a/lasso/id-wsf-2.0/profile.h +++ b/lasso/id-wsf-2.0/profile.h @@ -34,15 +34,15 @@ extern "C" { #define LASSO_TYPE_IDWSF2_PROFILE (lasso_idwsf2_profile_get_type()) #define LASSO_IDWSF2_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - LASSO_TYPE_IDWSF2_PROFILE, LassoIdWsf2Profile)) + LASSO_TYPE_IDWSF2_PROFILE, LassoIdWsf2Profile)) #define LASSO_IDWSF2_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - LASSO_TYPE_IDWSF2_PROFILE, LassoIdWsf2ProfileClass)) + LASSO_TYPE_IDWSF2_PROFILE, LassoIdWsf2ProfileClass)) #define LASSO_IS_IDWSF2_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - LASSO_TYPE_IDWSF2_PROFILE)) + LASSO_TYPE_IDWSF2_PROFILE)) #define LASSO_IS_IDWSF2_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_IDWSF2_PROFILE)) + LASSO_TYPE_IDWSF2_PROFILE)) #define LASSO_IDWSF2_PROFILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_IDWSF2_PROFILE, LassoIdWsf2ProfileClass)) + LASSO_TYPE_IDWSF2_PROFILE, LassoIdWsf2ProfileClass)) typedef struct _LassoIdWsf2Profile LassoIdWsf2Profile; diff --git a/lasso/id-wsf-2.0/server.h b/lasso/id-wsf-2.0/server.h index 2649a6bd..0e3476f8 100644 --- a/lasso/id-wsf-2.0/server.h +++ b/lasso/id-wsf-2.0/server.h @@ -34,12 +34,13 @@ extern "C" { #include <lasso/xml/id-wsf-2.0/disco_svc_metadata.h> LASSO_EXPORT gint lasso_server_add_svc_metadata(LassoServer *server, - LassoIdWsf2DiscoSvcMetadata *metadata); - -LASSO_EXPORT const GList OFTYPE(LassoIdWsf2DiscoSvcMetadata) *lasso_server_get_svc_metadatas(LassoServer *server); + LassoIdWsf2DiscoSvcMetadata *metadata); + +LASSO_EXPORT const GList OFTYPE(LassoIdWsf2DiscoSvcMetadata) *lasso_server_get_svc_metadatas( + LassoServer *server); LASSO_EXPORT GList *lasso_server_get_svc_metadatas_with_id_and_type(LassoServer *server, - GList *svcMDIDs, const gchar *service_type); + GList *svcMDIDs, const gchar *service_type); #ifdef __cplusplus } diff --git a/lasso/id-wsf-2.0/session.h b/lasso/id-wsf-2.0/session.h index 7d0fc35c..c072b172 100644 --- a/lasso/id-wsf-2.0/session.h +++ b/lasso/id-wsf-2.0/session.h @@ -34,13 +34,13 @@ extern "C" { #include <lasso/xml/ws/wsa_endpoint_reference.h> LASSO_EXPORT gint lasso_session_add_endpoint_reference(LassoSession *session, - LassoWsAddrEndpointReference *epr); + LassoWsAddrEndpointReference *epr); LASSO_EXPORT LassoWsAddrEndpointReference* lasso_session_get_endpoint_reference( - LassoSession *session, const gchar *service_type); + LassoSession *session, const gchar *service_type); LASSO_EXPORT LassoSaml2Assertion* lasso_session_get_assertion_identity_token( - LassoSession *session, const gchar *service_type); + LassoSession *session, const gchar *service_type); #ifdef __cplusplus } diff --git a/lasso/id-wsf/authentication.c b/lasso/id-wsf/authentication.c index a620c194..b59d8e3e 100644 --- a/lasso/id-wsf/authentication.c +++ b/lasso/id-wsf/authentication.c @@ -84,7 +84,8 @@ struct _LassoAuthenticationPrivate }; static LassoSoapEnvelope* -lasso_authentication_build_soap_envelope_internal(const char *refToMessageId, const char *providerId) +lasso_authentication_build_soap_envelope_internal(const char *refToMessageId, + const char *providerId) { LassoSoapEnvelope *envelope; LassoSoapHeader *header; @@ -181,11 +182,11 @@ lasso_authentication_client_step(LassoAuthentication *authentication) inlen = xmlSecBase64Decode(inbase64, in, strlen((char*)inbase64)); res = sasl_client_step(authentication->connection, /* our context */ - (char*)in, /* the data from the server */ - inlen, /* its length */ - NULL, /* prompt_need */ - &out, /* client response */ - &outlen); /* its length */ + (char*)in, /* the data from the server */ + inlen, /* its length */ + NULL, /* prompt_need */ + &out, /* client response */ + &outlen); /* its length */ if (outlen > 0) { outbase64 = xmlSecBase64Encode((xmlChar*)out, outlen, 0); request->Data = g_list_append(request->Data, g_strdup((char*)outbase64)); @@ -215,14 +216,14 @@ lasso_authentication_get_mechanism_list(LassoAuthentication *authentication) } res = sasl_listmech(authentication->connection, /* The context for this connection */ - NULL, /* not supported */ - "", /* What to prepend the string with */ - " ", /* What to separate mechanisms with */ - "", /* What to append to the string */ - &result_string, /* The produced string. */ - &string_length, /* length of the string */ - &number_of_mechanisms); /* Number of mechanisms in - the string */ + NULL, /* not supported */ + "", /* What to prepend the string with */ + " ", /* What to separate mechanisms with */ + "", /* What to append to the string */ + &result_string, /* The produced string. */ + &string_length, /* length of the string */ + &number_of_mechanisms); /* Number of mechanisms in + the string */ if (result_string == NULL) return NULL; @@ -231,9 +232,9 @@ lasso_authentication_get_mechanism_list(LassoAuthentication *authentication) gint lasso_authentication_init_request(LassoAuthentication *authentication, - LassoDiscoDescription *description, - const gchar *mechanisms, - LassoUserAccount *account) + LassoDiscoDescription *description, + const gchar *mechanisms, + LassoUserAccount *account) { LassoSoapEnvelope *envelope; LassoSaSASLRequest *request; @@ -312,12 +313,12 @@ lasso_authentication_init_request(LassoAuthentication *authentication, } res = sasl_client_new(LASSO_SA_SASL_SERVICE_NAME, - NULL, - NULL, - NULL, - lasso_sasl_callbacks, /* new connection callbacks (log, ...) */ - 0, - &authentication->connection); + NULL, + NULL, + NULL, + lasso_sasl_callbacks, /* new connection callbacks (log, ...) */ + 0, + &authentication->connection); return res; } @@ -325,7 +326,7 @@ lasso_authentication_init_request(LassoAuthentication *authentication, gint lasso_authentication_process_request_msg(LassoAuthentication *authentication, - const gchar *soap_msg) + const gchar *soap_msg) { LassoSoapEnvelope *envelope; LassoSaSASLResponse *response; @@ -342,17 +343,17 @@ lasso_authentication_process_request_msg(LassoAuthentication *authentication, /* if a previous request and response, then remove */ if (LASSO_IS_SOAP_ENVELOPE(LASSO_WSF_PROFILE(authentication)->soap_envelope_response) \ - == TRUE) { + == TRUE) { lasso_node_destroy(LASSO_NODE(LASSO_WSF_PROFILE(authentication)->\ - soap_envelope_response)); + soap_envelope_response)); LASSO_WSF_PROFILE(authentication)->soap_envelope_response = NULL; LASSO_WSF_PROFILE(authentication)->response = NULL; } if (LASSO_IS_SOAP_ENVELOPE(LASSO_WSF_PROFILE(authentication)->soap_envelope_request) \ - == TRUE) { + == TRUE) { lasso_node_destroy(LASSO_NODE(LASSO_WSF_PROFILE(authentication)->\ - soap_envelope_request)); + soap_envelope_request)); LASSO_WSF_PROFILE(authentication)->soap_envelope_request = NULL; LASSO_WSF_PROFILE(authentication)->request = NULL; } @@ -381,15 +382,14 @@ lasso_authentication_process_request_msg(LassoAuthentication *authentication, /* liberty-idwsf-authn-svc-1.1.pdf - page 13 - lignes 380 / 384 : A NULL string ("") in mechanism list SASLRequest indicates to the authentication server - that the client wishes to abort the authentication exchange. - */ + that the client wishes to abort the authentication exchange. */ return res; } gint lasso_authentication_process_response_msg(LassoAuthentication *authentication, - const gchar *soap_msg) + const gchar *soap_msg) { LassoSoapEnvelope *envelope; LassoSaSASLRequest *request; @@ -403,17 +403,17 @@ lasso_authentication_process_response_msg(LassoAuthentication *authentication, /* if a previous request or response, remove */ if (LASSO_IS_SOAP_ENVELOPE(LASSO_WSF_PROFILE(authentication)->soap_envelope_request) \ - == TRUE) { + == TRUE) { lasso_node_destroy(LASSO_NODE(LASSO_WSF_PROFILE(authentication)->\ - soap_envelope_request)); + soap_envelope_request)); LASSO_WSF_PROFILE(authentication)->soap_envelope_request = NULL; LASSO_WSF_PROFILE(authentication)->request = NULL; } if (LASSO_IS_SOAP_ENVELOPE(LASSO_WSF_PROFILE(authentication)->soap_envelope_response) \ - == TRUE) { + == TRUE) { lasso_node_destroy(LASSO_NODE(LASSO_WSF_PROFILE(authentication)->\ - soap_envelope_response)); + soap_envelope_response)); LASSO_WSF_PROFILE(authentication)->soap_envelope_response = NULL; LASSO_WSF_PROFILE(authentication)->response = NULL; } @@ -473,17 +473,17 @@ lasso_authentication_server_start(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); res = sasl_server_init(NULL, "Lasso"); /* FIXME : should be a param */ res = sasl_server_new(LASSO_SA_SASL_SERVICE_NAME, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - &authentication->connection); + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + &authentication->connection); /* Liberty part */ request = LASSO_SA_SASL_REQUEST(LASSO_WSF_PROFILE(authentication)->request); @@ -584,7 +584,7 @@ lasso_authentication_server_step(LassoAuthentication *authentication) xmlChar *outbase64, *inbase64; 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); /* Liberty part */ request = LASSO_SA_SASL_REQUEST(LASSO_WSF_PROFILE(authentication)->request); @@ -605,10 +605,10 @@ lasso_authentication_server_step(LassoAuthentication *authentication) } res = sasl_server_step(authentication->connection, - in, /* what the client gave */ - inlen, /* it's length */ - &out, /* Might not be NULL terminated */ - &outlen); + in, /* what the client gave */ + inlen, /* it's length */ + &out, /* Might not be NULL terminated */ + &outlen); if (res != SASL_OK) { g_free(response->Status->code); @@ -731,7 +731,7 @@ lasso_authentication_get_type() }; this_type = g_type_register_static(LASSO_TYPE_WSF_PROFILE, - "LassoAuthentication", &this_info, 0); + "LassoAuthentication", &this_info, 0); } return this_type; } diff --git a/lasso/id-wsf/data_service.c b/lasso/id-wsf/data_service.c index f27aa5ff..63a1ee81 100644 --- a/lasso/id-wsf/data_service.c +++ b/lasso/id-wsf/data_service.c @@ -187,8 +187,8 @@ lasso_data_service_init_query(LassoDataService *service, const char *select, while (iter) { LassoSamlAssertion *credential = LASSO_SAML_ASSERTION(iter->data); if (strcmp(credentialRef, credential->AssertionID) == 0) { - //lasso_wsf_profile_add_saml_authentication( - // LASSO_WSF_PROFILE(service), credential); + /* lasso_wsf_profile_add_saml_authentication( + LASSO_WSF_PROFILE(service), credential); */ iter = iter->next; } } @@ -271,7 +271,7 @@ lasso_data_service_process_query_msg(LassoDataService *service, const char *mess } xmlnode = xmlSecFindNode(xmlDocGetRootElement(doc), xmlSecNodeSignature, - xmlSecDSigNs); + xmlSecDSigNs); if (xmlnode) { xmlUnlinkNode(xmlnode); xmlFreeNode(xmlnode); @@ -667,7 +667,7 @@ lasso_data_service_init_modify(LassoDataService *service, const gchar *select, if (offering->ResourceID) { modify->ResourceID = offering->ResourceID; } else if (offering->EncryptedResourceID) { - modify->EncryptedResourceID = offering->EncryptedResourceID; + modify->EncryptedResourceID = offering->EncryptedResourceID; } else { /* XXX: no resource id, implied:resource, etc. */ return LASSO_ERROR_UNIMPLEMENTED; @@ -772,8 +772,8 @@ lasso_data_service_build_modify_response_msg(LassoDataService *service) cur_data = NULL; } else { xmlReplaceNode(node, xmlCopyNode(newNode,1)); - // Node is a free node now but is still reference by the xpath nodeset - // we must wait for the deallocation of the nodeset to free it. + /* Node is a free node now but is still reference by the xpath nodeset + we must wait for the deallocation of the nodeset to free it. */ lasso_list_add(node_to_free, node); } } diff --git a/lasso/id-wsf/data_service.h b/lasso/id-wsf/data_service.h index cabb81a5..d976fb2e 100644 --- a/lasso/id-wsf/data_service.h +++ b/lasso/id-wsf/data_service.h @@ -42,15 +42,15 @@ extern "C" { #define LASSO_TYPE_DATA_SERVICE (lasso_data_service_get_type()) #define LASSO_DATA_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - LASSO_TYPE_DATA_SERVICE, LassoDataService)) + LASSO_TYPE_DATA_SERVICE, LassoDataService)) #define LASSO_DATA_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - LASSO_TYPE_DATA_SERVICE, LassoDataServiceClass)) + LASSO_TYPE_DATA_SERVICE, LassoDataServiceClass)) #define LASSO_IS_DATA_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - LASSO_TYPE_DATA_SERVICE)) + LASSO_TYPE_DATA_SERVICE)) #define LASSO_IS_DATA_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_DATA_SERVICE)) + LASSO_TYPE_DATA_SERVICE)) #define LASSO_DATA_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_DATA_SERVICE, LassoDataServiceClass)) + LASSO_TYPE_DATA_SERVICE, LassoDataServiceClass)) typedef struct _LassoDataService LassoDataService; typedef struct _LassoDataServiceClass LassoDataServiceClass; diff --git a/lasso/id-wsf/discovery.c b/lasso/id-wsf/discovery.c index 8b8dccfc..0ad232a9 100644 --- a/lasso/id-wsf/discovery.c +++ b/lasso/id-wsf/discovery.c @@ -98,11 +98,13 @@ struct _LassoDiscoveryPrivate /*****************************************************************************/ static gchar* lasso_discovery_build_credential(LassoDiscovery *discovery, const gchar *providerId); -static LassoWsfProfile *lasso_discovery_build_wsf_profile(LassoDiscovery *discovery, LassoDiscoResourceOffering *offering); +static LassoWsfProfile *lasso_discovery_build_wsf_profile(LassoDiscovery *discovery, + LassoDiscoResourceOffering *offering); static LassoWsfProfileConstructor lookup_registry(gchar const *service_type); static void remove_registry(gchar const *service_type); static void set_registry(gchar const *service_type, LassoWsfProfileConstructor constructor); -static LassoDsKeyInfo* lasso_discovery_build_key_info_node(LassoDiscovery *discovery, const gchar *providerID); +static LassoDsKeyInfo* lasso_discovery_build_key_info_node(LassoDiscovery *discovery, + const gchar *providerID); /* Needs REVIEW */ static gchar* @@ -122,7 +124,6 @@ lasso_discovery_build_credential(LassoDiscovery *discovery, const gchar *provide LassoSamlSubjectConfirmation *subject_confirmation = NULL; LassoDsKeyInfo *key_info = NULL; GList *iter = NULL; - LassoSamlSubjectConfirmation *subject_confirmation; LassoProvider *our_provider = LASSO_PROVIDER(LASSO_WSF_PROFILE(discovery)->server); @@ -134,8 +135,7 @@ lasso_discovery_build_credential(LassoDiscovery *discovery, const gchar *provide assertion->MajorVersion = LASSO_SAML_MAJOR_VERSION_N; assertion->MinorVersion = LASSO_SAML_MINOR_VERSION_N; assertion->IssueInstant = lasso_get_current_time(); - assertion->Issuer = - g_strdup(our_provider->ProviderID); + assertion->Issuer = g_strdup(our_provider->ProviderID); /* Add AuthenticationStatement */ authentication_statement = LASSO_SAML_AUTHENTICATION_STATEMENT( @@ -166,7 +166,8 @@ lasso_discovery_build_credential(LassoDiscovery *discovery, const gchar *provide /* SubjectConfirmation */ subject_confirmation = lasso_saml_subject_confirmation_new(); - lasso_list_add(subject_confirmation->ConfirmationMethod, g_strdup(LASSO_SAML_CONFIRMATION_METHOD_HOLDER_OF_KEY)); + lasso_list_add(subject_confirmation->ConfirmationMethod, + g_strdup(LASSO_SAML_CONFIRMATION_METHOD_HOLDER_OF_KEY)); /* Add public key value in credential */ key_info = lasso_discovery_build_key_info_node(discovery, provider->providerID); @@ -202,8 +203,8 @@ lasso_discovery_build_credential(LassoDiscovery *discovery, const gchar *provide */ LassoDiscoInsertEntry* lasso_discovery_add_insert_entry(LassoDiscovery *discovery, - LassoDiscoServiceInstance *serviceInstance, - LassoDiscoResourceID *resourceId) + LassoDiscoServiceInstance *serviceInstance, + LassoDiscoResourceID *resourceId) { LassoDiscoModify *modify = NULL; LassoDiscoInsertEntry *insertEntry = NULL; @@ -240,7 +241,7 @@ lasso_discovery_add_insert_entry(LassoDiscovery *discovery, */ gint lasso_discovery_add_remove_entry(LassoDiscovery *discovery, - const gchar *entryID) + const gchar *entryID) { LassoDiscoModify *modify = NULL; @@ -269,8 +270,8 @@ lasso_discovery_add_remove_entry(LassoDiscovery *discovery, **/ LassoDiscoRequestedServiceType* lasso_discovery_add_requested_service_type(LassoDiscovery *discovery, - const gchar *service_type, - const gchar *option) + const gchar *service_type, + const gchar *option) { LassoWsfProfile *profile = NULL; LassoDiscoQuery *query = NULL; @@ -305,12 +306,12 @@ lasso_discovery_add_requested_service_type(LassoDiscovery *discovery, /** lasso_discovery_init_modify: * - * Do not use, it is DEPRECATED ! + * @Deprecated: Since 2.2.1, use lasso_discovery_init_insert() instead. */ gint lasso_discovery_init_modify(LassoDiscovery *discovery, - LassoDiscoResourceOffering *resourceOffering, - LassoDiscoDescription *description) + LassoDiscoResourceOffering *resourceOffering, + LassoDiscoDescription *description) { return 0; } @@ -393,7 +394,7 @@ end: **/ LassoDiscoDescription* lasso_discovery_get_description_auto(const LassoDiscoResourceOffering *offering, - const gchar *security_mech_id) + const gchar *security_mech_id) { g_return_val_if_fail(LASSO_IS_DISCO_RESOURCE_OFFERING(offering), NULL); g_return_val_if_fail(security_mech_id != NULL, NULL); @@ -414,7 +415,7 @@ lasso_discovery_get_description_auto(const LassoDiscoResourceOffering *offering, rc = LASSO_WSF_PROFILE_ERROR_MISSING_RESOURCE_ID;\ } - + /** * lasso_discovery_init_query @@ -443,7 +444,8 @@ lasso_discovery_init_query(LassoDiscovery *discovery, const gchar *security_mech * object with get getted resource offering. get discovery service * resource id from principal assertion */ offering = lasso_discovery_get_resource_offering_auto(discovery, LASSO_DISCO_HREF); - goto_exit_if_fail(LASSO_IS_DISCO_RESOURCE_OFFERING(offering), LASSO_PROFILE_ERROR_MISSING_RESOURCE_OFFERING); + goto_exit_if_fail(LASSO_IS_DISCO_RESOURCE_OFFERING(offering), + LASSO_PROFILE_ERROR_MISSING_RESOURCE_OFFERING); lasso_wsf_profile_set_resource_offering(&discovery->parent, offering); rc = lasso_wsf_profile_set_security_mech_id(&discovery->parent, security_mech_id); if (rc) @@ -475,7 +477,7 @@ exit: **/ gint lasso_discovery_init_insert(LassoDiscovery *discovery, LassoDiscoResourceOffering *new_offering, - const char *security_mech_id) + const char *security_mech_id) { LassoWsfProfile *profile = NULL; LassoDiscoModify *modify = NULL; @@ -485,7 +487,7 @@ lasso_discovery_init_insert(LassoDiscovery *discovery, LassoDiscoResourceOfferin g_return_val_if_fail(LASSO_IS_DISCOVERY(discovery), LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(LASSO_IS_DISCO_RESOURCE_OFFERING(new_offering), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); profile = LASSO_WSF_PROFILE(discovery); modify = lasso_disco_modify_new(); @@ -577,7 +579,7 @@ lasso_discovery_init_remove(LassoDiscovery *discovery, const char *entry_id) **/ gint lasso_discovery_process_modify_msg(LassoDiscovery *discovery, const gchar *message, - const gchar *security_mech_id) + const gchar *security_mech_id) { LassoWsfProfile *profile = NULL; LassoDiscoModify *request = NULL; @@ -589,7 +591,7 @@ lasso_discovery_process_modify_msg(LassoDiscovery *discovery, const gchar *messa profile = LASSO_WSF_PROFILE(discovery); res = lasso_wsf_profile_process_soap_request_msg(profile, message, - LASSO_DISCO_HREF, security_mech_id); + LASSO_DISCO_HREF, security_mech_id); if (res != 0) { return res; } @@ -622,8 +624,8 @@ gint lasso_discovery_build_modify_response_msg(LassoDiscovery *discovery) { /* FIXME: Check all error cases, set the right status code, - and don't return without building a response, and - ensure atomicity, everythin fails or everythig succeed. */ + and don't return without building a response, and + ensure atomicity, everythin fails or everythig succeed. */ LassoWsfProfile *profile = NULL; LassoDiscoModify *request = NULL; @@ -646,7 +648,7 @@ lasso_discovery_build_modify_response_msg(LassoDiscovery *discovery) if (lasso_wsf_profile_get_fault(profile)) { return lasso_wsf_profile_build_soap_response_msg(profile); } - + if (profile->identity == NULL) { return LASSO_PROFILE_ERROR_IDENTITY_NOT_FOUND; } @@ -666,7 +668,7 @@ lasso_discovery_build_modify_response_msg(LassoDiscovery *discovery) remove_entry = LASSO_DISCO_REMOVE_ENTRY(iter->data); if (! lasso_identity_get_resource_offering(profile->identity, - remove_entry->entryID)) { + remove_entry->entryID)) { res = LASSO_PROFILE_ERROR_MISSING_RESOURCE_OFFERING; break; } @@ -677,7 +679,7 @@ lasso_discovery_build_modify_response_msg(LassoDiscovery *discovery) for (iter = request->RemoveEntry; iter != NULL; iter = g_list_next(iter)) { remove_entry = LASSO_DISCO_REMOVE_ENTRY(iter->data); if (! lasso_identity_remove_resource_offering(profile->identity, - remove_entry->entryID)) { + remove_entry->entryID)) { /* Set the right error code */ res = -1; break; @@ -700,7 +702,7 @@ lasso_discovery_build_modify_response_msg(LassoDiscovery *discovery) insert_entry->ResourceOffering); t_new_entry_ids = g_stpcpy(t_new_entry_ids, - insert_entry->ResourceOffering->entryID); + insert_entry->ResourceOffering->entryID); t_new_entry_ids = g_stpcpy(t_new_entry_ids, " "); } if (t_new_entry_ids) { @@ -772,7 +774,7 @@ lasso_discovery_process_modify_response_msg(LassoDiscovery *discovery, const gch **/ gint lasso_discovery_process_query_msg(LassoDiscovery *discovery, const gchar *message, - const char *security_mech_id) + const char *security_mech_id) { LassoWsfProfile *profile = NULL; LassoDiscoQuery *request = NULL; @@ -784,7 +786,7 @@ lasso_discovery_process_query_msg(LassoDiscovery *discovery, const gchar *messag profile = LASSO_WSF_PROFILE(discovery); lasso_wsf_profile_process_soap_request_msg(profile, message, LASSO_DISCO_HREF, - security_mech_id); + security_mech_id); envelope = profile->soap_envelope_response; request = LASSO_DISCO_QUERY(profile->request); @@ -858,7 +860,7 @@ lasso_discovery_build_response_msg(LassoDiscovery *discovery) profile->response = LASSO_NODE(response); envelope = profile->soap_envelope_response; lasso_list_add_gobject(envelope->Body->any, response); - + /* Add needed credentials for offerings */ iter = offerings; while (iter) { @@ -870,9 +872,9 @@ lasso_discovery_build_response_msg(LassoDiscovery *discovery) iter3 = description->SecurityMechID; while (iter3) { if (lasso_security_mech_id_is_saml_authentication( - iter3->data) == TRUE) { + iter3->data) == TRUE) { credentialRef = lasso_discovery_build_credential( - discovery, NULL); + discovery, NULL); lasso_list_add(description->CredentialRef, credentialRef); } iter3 = g_list_next(iter3); @@ -882,7 +884,7 @@ lasso_discovery_build_response_msg(LassoDiscovery *discovery) } res = lasso_wsf_profile_build_soap_response_msg(profile); - + return res; } @@ -929,7 +931,7 @@ lasso_discovery_process_query_response_msg(LassoDiscovery *discovery, const gcha for (; assertions; assertions = g_list_next(assertions)) { xmlNode *assertion = (xmlNode*)assertions->data; if (! (assertion->type == XML_ELEMENT_NODE && - strcmp((char*)assertion->name, "Assertion") == 0)) { + strcmp((char*)assertion->name, "Assertion") == 0)) { continue; } if (profile->session) { @@ -1060,7 +1062,7 @@ lasso_discovery_register_constructor_for_service_type(const gchar *service_type, LassoWsfProfileConstructor constructor) { LassoWsfProfileConstructor old_constructor; - + g_return_if_fail(service_type); g_return_if_fail(constructor); old_constructor = lookup_registry(service_type); @@ -1085,12 +1087,14 @@ lasso_discovery_unregister_constructor_for_service_type( gchar const *service_type, LassoWsfProfileConstructor constructor) { LassoWsfProfileConstructor old_constructor; - + g_return_if_fail(service_type); g_return_if_fail(constructor); old_constructor = lookup_registry(service_type); if (old_constructor != constructor) { - message(G_LOG_LEVEL_WARNING, "Mismatch of constructors when unregistering service type: %s", service_type); + message(G_LOG_LEVEL_WARNING, + "Mismatch of constructors when unregistering service type: %s", + service_type); return; } remove_registry(service_type); @@ -1232,7 +1236,7 @@ lasso_discovery_build_wsf_profile(LassoDiscovery *discovery, LassoDiscoResourceO g_return_val_if_fail(offering, NULL); g_return_val_if_fail(offering->ServiceInstance, NULL); g_return_val_if_fail(offering->ServiceInstance->ServiceType, NULL); - + service_type = offering->ServiceInstance->ServiceType; a_constructor = lookup_registry(service_type); server = LASSO_WSF_PROFILE(discovery)->server; @@ -1338,7 +1342,7 @@ lasso_discovery_get_type() }; this_type = g_type_register_static(LASSO_TYPE_WSF_PROFILE, - "LassoDiscovery", &this_info, 0); + "LassoDiscovery", &this_info, 0); } return this_type; } diff --git a/lasso/id-wsf/interaction_profile_service.c b/lasso/id-wsf/interaction_profile_service.c index 9c52a290..3bfc9e12 100644 --- a/lasso/id-wsf/interaction_profile_service.c +++ b/lasso/id-wsf/interaction_profile_service.c @@ -51,7 +51,7 @@ lasso_interaction_profile_service_init_request(LassoInteractionProfileService *s gint lasso_interaction_profile_service_process_request_msg(LassoInteractionProfileService *service, - const gchar *msg) + const gchar *msg) { LassoIsInteractionRequest *request; @@ -63,7 +63,7 @@ lasso_interaction_profile_service_process_request_msg(LassoInteractionProfileSer gint lasso_interaction_profile_service_process_response_msg(LassoInteractionProfileService *service, - const gchar *msg) + const gchar *msg) { LassoIsInteractionResponse *response; diff --git a/lasso/id-wsf/interaction_profile_service.h b/lasso/id-wsf/interaction_profile_service.h index 35398170..1ca0b27f 100644 --- a/lasso/id-wsf/interaction_profile_service.h +++ b/lasso/id-wsf/interaction_profile_service.h @@ -36,15 +36,15 @@ extern "C" { #define LASSO_TYPE_INTERACTION_PROFILE_SERVICE (lasso_interaction_profile_service_get_type()) #define LASSO_INTERACTION_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - LASSO_TYPE_INTERACTION_PROFILE_SERVICE, LassoInteractionProfileService)) + LASSO_TYPE_INTERACTION_PROFILE_SERVICE, LassoInteractionProfileService)) #define LASSO_INTERACTION_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - LASSO_TYPE_INTERACTION_PROFILE_SERVICE, LassoInteractionProfileServiceClass)) + LASSO_TYPE_INTERACTION_PROFILE_SERVICE, LassoInteractionProfileServiceClass)) #define LASSO_IS_INTERACTION_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - LASSO_TYPE_INTERACTION_PROFILE_SERVICE)) + LASSO_TYPE_INTERACTION_PROFILE_SERVICE)) #define LASSO_IS_INTERACTION_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_INTERACTION_PROFILE_SERVICE)) + LASSO_TYPE_INTERACTION_PROFILE_SERVICE)) #define LASSO_INTERACTION_PROFILE_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_INTERACTION_PROFILE_SERVICE, LassoInteractionProfileServiceClass)) + LASSO_TYPE_INTERACTION_PROFILE_SERVICE, LassoInteractionProfileServiceClass)) typedef struct _LassoInteractionProfileService LassoInteractionProfileService; typedef struct _LassoInteractionProfileServiceClass LassoInteractionProfileServiceClass; diff --git a/lasso/id-wsf/personal_profile_service.c b/lasso/id-wsf/personal_profile_service.c index 4598d9ec..24743f47 100644 --- a/lasso/id-wsf/personal_profile_service.c +++ b/lasso/id-wsf/personal_profile_service.c @@ -97,7 +97,8 @@ lasso_personal_profile_service_get_type() static GType this_type = 0; if (!this_type) { - lasso_discovery_register_constructor_for_service_type(LASSO_PP_HREF, (LassoWsfProfileConstructor)lasso_personal_profile_service_new_full); + lasso_discovery_register_constructor_for_service_type(LASSO_PP_HREF, + (LassoWsfProfileConstructor)lasso_personal_profile_service_new_full); static const GTypeInfo this_info = { sizeof(LassoPersonalProfileServiceClass), NULL, diff --git a/lasso/id-wsf/personal_profile_service.h b/lasso/id-wsf/personal_profile_service.h index b408c204..ede2c450 100644 --- a/lasso/id-wsf/personal_profile_service.h +++ b/lasso/id-wsf/personal_profile_service.h @@ -40,15 +40,15 @@ extern "C" { #define LASSO_TYPE_PERSONAL_PROFILE_SERVICE (lasso_personal_profile_service_get_type()) #define LASSO_PERSONAL_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - LASSO_TYPE_PERSONAL_PROFILE_SERVICE, LassoPersonalProfileService)) + LASSO_TYPE_PERSONAL_PROFILE_SERVICE, LassoPersonalProfileService)) #define LASSO_PERSONAL_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - LASSO_TYPE_PERSONAL_PROFILE_SERVICE, LassoPersonalProfileServiceClass)) + LASSO_TYPE_PERSONAL_PROFILE_SERVICE, LassoPersonalProfileServiceClass)) #define LASSO_IS_PERSONAL_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - LASSO_TYPE_PERSONAL_PROFILE_SERVICE)) + LASSO_TYPE_PERSONAL_PROFILE_SERVICE)) #define LASSO_IS_PERSONAL_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_PERSONAL_PROFILE_SERVICE)) + LASSO_TYPE_PERSONAL_PROFILE_SERVICE)) #define LASSO_PERSONAL_PROFILE_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_PERSONAL_PROFILE_SERVICE, LassoPersonalProfileServiceClass)) + LASSO_TYPE_PERSONAL_PROFILE_SERVICE, LassoPersonalProfileServiceClass)) typedef struct _LassoPersonalProfileService LassoPersonalProfileService; typedef struct _LassoPersonalProfileServiceClass LassoPersonalProfileServiceClass; diff --git a/lasso/id-wsf/soap_binding.c b/lasso/id-wsf/soap_binding.c index 6e78da95..4ff1d76e 100644 --- a/lasso/id-wsf/soap_binding.c +++ b/lasso/id-wsf/soap_binding.c @@ -25,8 +25,10 @@ #include <lasso/id-wsf/soap_binding.h> #define find_node_type_in_list(iter, check) \ - { while (iter && ! check(iter->data)) \ - iter = iter->next; } + {\ + while (iter && ! check(iter->data)) \ + iter = iter->next;\ + } /** * lasso_soap_binding_get_provider: diff --git a/lasso/id-wsf/wsf_profile.c b/lasso/id-wsf/wsf_profile.c index 83696bbd..dfeb26a9 100644 --- a/lasso/id-wsf/wsf_profile.c +++ b/lasso/id-wsf/wsf_profile.c @@ -69,8 +69,10 @@ static struct XmlSnippet schema_snippets[] = { { "Server", SNIPPET_NODE_IN_CHILD, G_STRUCT_OFFSET(LassoWsfProfile, server) }, { "Request", SNIPPET_NODE_IN_CHILD, G_STRUCT_OFFSET(LassoWsfProfile, request) }, { "Response", SNIPPET_NODE_IN_CHILD, G_STRUCT_OFFSET(LassoWsfProfile, response) }, - { "SOAP-Request", SNIPPET_NODE_IN_CHILD, G_STRUCT_OFFSET(LassoWsfProfile, soap_envelope_request) }, - { "SOAP-Response", SNIPPET_NODE_IN_CHILD, G_STRUCT_OFFSET(LassoWsfProfile, soap_envelope_response) }, + { "SOAP-Request", SNIPPET_NODE_IN_CHILD, + G_STRUCT_OFFSET(LassoWsfProfile, soap_envelope_request) }, + { "SOAP-Response", SNIPPET_NODE_IN_CHILD, + G_STRUCT_OFFSET(LassoWsfProfile, soap_envelope_response) }, { "MsgUrl", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoWsfProfile, msg_url) }, { "MsgBody", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoWsfProfile, msg_body) }, { "Identity", SNIPPET_NODE_IN_CHILD, G_STRUCT_OFFSET(LassoWsfProfile, identity) }, @@ -247,7 +249,8 @@ lasso_wsf_profile_add_credential(LassoWsfProfile *profile, xmlNode *credential) * otherwise. */ LassoDiscoDescription* -lasso_wsf_profile_get_description_auto(const LassoDiscoServiceInstance *si, const gchar *security_mech_id) +lasso_wsf_profile_get_description_auto(const LassoDiscoServiceInstance *si, + const gchar *security_mech_id) { GList *iter, *iter2; LassoDiscoDescription *description; @@ -274,7 +277,8 @@ lasso_wsf_profile_get_description_auto(const LassoDiscoServiceInstance *si, cons * lasso_wsf_profile_set_description_from_offering: * @profile: a #LassoWsfProfile * @offering: a #LassoDiscoResourceOffering containing descriptions - * @security_mech_id: an URL representing the wished security mechanism, if NULL take the first descriptions + * @security_mech_id: an URL representing the wished security mechanism, + * if NULL take the first descriptions * * Setup the LassoWsfProfile for a given security mechanism. * @@ -423,7 +427,8 @@ lasso_wsf_profile_get_resource_offering(LassoWsfProfile *profile) * */ void -lasso_wsf_profile_set_resource_offering(LassoWsfProfile *profile, LassoDiscoResourceOffering *offering) +lasso_wsf_profile_set_resource_offering(LassoWsfProfile *profile, + LassoDiscoResourceOffering *offering) { lasso_assign_gobject(profile->private_data->offering, offering); } @@ -776,7 +781,8 @@ lasso_wsf_profile_process_soap_request_msg(LassoWsfProfile *profile, const gchar if (iter) { correlation = LASSO_SOAP_BINDING_CORRELATION(iter->data); } - goto_exit_if_fail (correlation != NULL && correlation->messageID != NULL, LASSO_WSF_PROFILE_ERROR_MISSING_CORRELATION); + goto_exit_if_fail (correlation != NULL && correlation->messageID != NULL, + LASSO_WSF_PROFILE_ERROR_MISSING_CORRELATION); messageId = correlation->messageID; /* Comply with security mechanism */ if (security_mech_id == NULL @@ -1149,16 +1155,19 @@ add_key_info_security_token_reference(xmlDocPtr doc, xmlNode *signature, xmlChar xmlFreeNodeList(key_info->children); key_info->children = NULL; /* Create sec:SecurityTokenReferenceNode */ - security_token_reference = xmlSecAddChild(key_info, (xmlChar*) "SecurityTokenReference", (xmlChar*)LASSO_WSSE1_HREF); + security_token_reference = xmlSecAddChild(key_info, (xmlChar*) "SecurityTokenReference", + (xmlChar*)LASSO_WSSE1_HREF); nsPtr = xmlSearchNsByHref(doc, security_token_reference, (xmlChar*) LASSO_SEC_HREF); if (nsPtr == NULL) { - nsPtr = xmlNewNs(security_token_reference, (xmlChar*) LASSO_SEC_HREF, (xmlChar*) LASSO_SEC_PREFIX); + nsPtr = xmlNewNs(security_token_reference, (xmlChar*) LASSO_SEC_HREF, + (xmlChar*) LASSO_SEC_PREFIX); } value = (xmlChar*) g_strdup_printf("%s:MessageAuthentication", nsPtr->prefix); xmlSetProp(security_token_reference, (xmlChar*) "Usage", value); lasso_release(value); /* Create Reference */ - reference = xmlSecAddChild(security_token_reference, (xmlChar*) "Reference", (xmlChar*) LASSO_WSSE1_HREF); + reference = xmlSecAddChild(security_token_reference, (xmlChar*) "Reference", + (xmlChar*) LASSO_WSSE1_HREF); value = make_id_ref(assertion_id); xmlSetProp(reference, (xmlChar*) "URI", value); lasso_release(value); @@ -1197,9 +1206,13 @@ lasso_wsf_profile_add_saml_signature(LassoWsfProfile *wsf_profile, xmlDoc *doc) /* Lookup all referenced node and their Ids */ envelope = xmlDocGetRootElement(doc); header = xmlSecSoap11GetHeader(envelope); - provider = xmlSecFindNode(header, (xmlChar*) "Provider", (xmlChar*) LASSO_SOAP_BINDING_HREF); - correlation = xmlSecFindNode(header, (xmlChar*) "Correlation", (xmlChar*) LASSO_SOAP_BINDING_HREF); - interaction = xmlSecFindNode(header, (xmlChar*) "UserInteraction", (xmlChar*) LASSO_IS_HREF); + + provider = xmlSecFindNode(header, (xmlChar*) "Provider", + (xmlChar*) LASSO_SOAP_BINDING_HREF); + correlation = xmlSecFindNode(header, (xmlChar*) "Correlation", + (xmlChar*) LASSO_SOAP_BINDING_HREF); + interaction = xmlSecFindNode(header, (xmlChar*) "UserInteraction", + (xmlChar*) LASSO_IS_HREF); body = xmlSecSoap11GetBody(envelope); xmlSecAddIDs(doc, envelope, ids); goto_exit_if_fail(header != NULL, LASSO_XML_ERROR_NODE_NOT_FOUND); @@ -1216,7 +1229,8 @@ lasso_wsf_profile_add_saml_signature(LassoWsfProfile *wsf_profile, xmlDoc *doc) goto_exit_if_fail(provider_id != NULL, LASSO_XML_ERROR_ATTR_NOT_FOUND); goto_exit_if_fail(correlation_id != NULL, LASSO_XML_ERROR_ATTR_NOT_FOUND); goto_exit_if_fail(body_id != NULL, LASSO_XML_ERROR_ATTR_NOT_FOUND); - goto_exit_if_fail(interaction == NULL || interaction_id != NULL, LASSO_XML_ERROR_ATTR_NOT_FOUND); + goto_exit_if_fail(interaction == NULL || interaction_id != NULL, + LASSO_XML_ERROR_ATTR_NOT_FOUND); /* Lookup the assertion Id for the KeyInfo node generation */ security = xmlSecFindNode(header, (xmlChar*) "Security", (xmlChar*) LASSO_WSSE1_HREF); diff --git a/lasso/id-wsf/wsf_profile.h b/lasso/id-wsf/wsf_profile.h index 97aeb407..e25d591a 100644 --- a/lasso/id-wsf/wsf_profile.h +++ b/lasso/id-wsf/wsf_profile.h @@ -42,12 +42,12 @@ extern "C" { #define LASSO_TYPE_WSF_PROFILE (lasso_wsf_profile_get_type()) #define LASSO_WSF_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - LASSO_TYPE_WSF_PROFILE, LassoWsfProfile)) + LASSO_TYPE_WSF_PROFILE, LassoWsfProfile)) #define LASSO_WSF_PROFILE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_WSF_PROFILE, LassoWsfProfileClass)) #define LASSO_IS_WSF_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_WSF_PROFILE)) #define LASSO_IS_WSF_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_WSF_PROFILE)) + LASSO_TYPE_WSF_PROFILE)) #define LASSO_WSF_PROFILE_GET_CLASS(o) \ (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_WSF_PROFILE, LassoWsfProfileClass)) @@ -82,7 +82,8 @@ struct _LassoWsfProfileClass { LASSO_EXPORT GType lasso_wsf_profile_get_type(void); -G_GNUC_DEPRECATED LASSO_EXPORT gint lasso_wsf_profile_move_credentials(LassoWsfProfile *src, LassoWsfProfile *dest); +G_GNUC_DEPRECATED LASSO_EXPORT gint lasso_wsf_profile_move_credentials(LassoWsfProfile *src, + LassoWsfProfile *dest); LASSO_EXPORT LassoIdentity* lasso_wsf_profile_get_identity(const LassoWsfProfile *profile); LASSO_EXPORT LassoSession* lasso_wsf_profile_get_session(const LassoWsfProfile *profile); @@ -93,7 +94,8 @@ LASSO_EXPORT gint lasso_wsf_profile_set_identity_from_dump(LassoWsfProfile *prof LASSO_EXPORT gint lasso_wsf_profile_set_session_from_dump(LassoWsfProfile *profile, const gchar *dump); -G_GNUC_DEPRECATED LASSO_EXPORT LassoSoapEnvelope* lasso_wsf_profile_build_soap_envelope(const char *refToMessageId, +G_GNUC_DEPRECATED LASSO_EXPORT LassoSoapEnvelope* lasso_wsf_profile_build_soap_envelope( + const char *refToMessageId, const char *providerId); LASSO_EXPORT gint lasso_wsf_profile_build_soap_request_msg(LassoWsfProfile *profile); @@ -114,11 +116,14 @@ G_GNUC_DEPRECATED LASSO_EXPORT LassoSoapBindingProvider* lasso_wsf_profile_set_p LASSO_EXPORT LassoWsfProfile* lasso_wsf_profile_new(LassoServer *server); -LASSO_EXPORT LassoWsfProfile* lasso_wsf_profile_new_full(LassoServer *server, LassoDiscoResourceOffering *offering); +LASSO_EXPORT LassoWsfProfile* lasso_wsf_profile_new_full(LassoServer *server, + LassoDiscoResourceOffering *offering); -G_GNUC_DEPRECATED LASSO_EXPORT gboolean lasso_wsf_profile_principal_is_online(LassoWsfProfile *profile); +G_GNUC_DEPRECATED LASSO_EXPORT gboolean lasso_wsf_profile_principal_is_online( + LassoWsfProfile *profile); -G_GNUC_DEPRECATED LASSO_EXPORT gint lasso_wsf_profile_add_credential(LassoWsfProfile *profile, xmlNode *credential); +G_GNUC_DEPRECATED LASSO_EXPORT gint lasso_wsf_profile_add_credential(LassoWsfProfile *profile, + xmlNode *credential); LASSO_EXPORT gint lasso_wsf_profile_set_description_from_offering( LassoWsfProfile *profile, @@ -128,20 +133,25 @@ LASSO_EXPORT gint lasso_wsf_profile_set_description_from_offering( LASSO_EXPORT void lasso_wsf_profile_set_description(LassoWsfProfile *profile, LassoDiscoDescription *description); -LASSO_EXPORT LassoDiscoDescription *lasso_wsf_profile_get_description(const LassoWsfProfile *profile); +LASSO_EXPORT LassoDiscoDescription *lasso_wsf_profile_get_description( + const LassoWsfProfile *profile); -LASSO_EXPORT LassoDiscoResourceOffering *lasso_wsf_profile_get_resource_offering(LassoWsfProfile *profile); +LASSO_EXPORT LassoDiscoResourceOffering *lasso_wsf_profile_get_resource_offering( + LassoWsfProfile *profile); -LASSO_EXPORT gint lasso_wsf_profile_set_security_mech_id(LassoWsfProfile *profile, const char *security_mech_id); +LASSO_EXPORT gint lasso_wsf_profile_set_security_mech_id(LassoWsfProfile *profile, + const char *security_mech_id); LASSO_EXPORT const char *lasso_wsf_profile_get_security_mech_id(LassoWsfProfile *profile); G_GNUC_DEPRECATED LASSO_EXPORT void lasso_wsf_profile_set_principal_status(LassoWsfProfile *profile, const char *status); -G_GNUC_DEPRECATED LASSO_EXPORT void lasso_wsf_profile_set_principal_online(LassoWsfProfile *profile); +G_GNUC_DEPRECATED LASSO_EXPORT void lasso_wsf_profile_set_principal_online( + LassoWsfProfile *profile); -G_GNUC_DEPRECATED LASSO_EXPORT void lasso_wsf_profile_set_principal_offline(LassoWsfProfile *profile); +G_GNUC_DEPRECATED LASSO_EXPORT void lasso_wsf_profile_set_principal_offline( + LassoWsfProfile *profile); LASSO_EXPORT gint lasso_wsf_profile_init(LassoWsfProfile *profile, LassoServer *server, LassoDiscoResourceOffering *offering); diff --git a/lasso/id-wsf/wsf_profile_private.h b/lasso/id-wsf/wsf_profile_private.h index 8392df9a..e82a4f1a 100644 --- a/lasso/id-wsf/wsf_profile_private.h +++ b/lasso/id-wsf/wsf_profile_private.h @@ -46,7 +46,8 @@ LassoSoapFault* lasso_wsf_profile_get_fault(const LassoWsfProfile *profile); LassoDiscoDescription* lasso_wsf_profile_get_description_auto(const LassoDiscoServiceInstance *si, const gchar *security_mech_id); -void lasso_wsf_profile_set_resource_offering(LassoWsfProfile *profile, LassoDiscoResourceOffering *offering); +void lasso_wsf_profile_set_resource_offering(LassoWsfProfile *profile, + LassoDiscoResourceOffering *offering); #ifdef __cplusplus } diff --git a/lasso/saml-2.0/assertion_query.c b/lasso/saml-2.0/assertion_query.c index e5c5d93f..cbdde0a4 100644 --- a/lasso/saml-2.0/assertion_query.c +++ b/lasso/saml-2.0/assertion_query.c @@ -176,7 +176,7 @@ lasso_assertion_query_build_request_msg(LassoAssertionQuery *assertion_query) profile->msg_url = lasso_provider_get_metadata_one(remote_provider, "AttributeService SOAP"); } - /* XXX set private key so message is signed */ + /* XXX set private key so message is signed */ profile->msg_body = lasso_node_export_to_soap(profile->request); return 0; } diff --git a/lasso/saml-2.0/login.c b/lasso/saml-2.0/login.c index e91c3c6d..a71df97f 100644 --- a/lasso/saml-2.0/login.c +++ b/lasso/saml-2.0/login.c @@ -177,7 +177,7 @@ lasso_saml20_login_build_authn_request_msg(LassoLogin *login, LassoProvider *rem issuer = LASSO_PROVIDER(LASSO_PROFILE(login)->server)->ProviderID; responseConsumerURL = \ lasso_saml20_login_get_assertion_consumer_service_url( - login, LASSO_PROVIDER(profile->server)); + login, LASSO_PROVIDER(profile->server)); profile->msg_url = NULL; profile->msg_body = lasso_node_export_to_paos_request(profile->request, issuer, responseConsumerURL, @@ -678,14 +678,14 @@ lasso_saml20_login_assertion_add_discovery(LassoLogin *login, LassoSaml2Assertio /* Abstract */ metadata->any = g_list_append(metadata->any, - lasso_idwsf2_disco_abstract_new_with_string(svcMD->Abstract)); - /* ProviderID */ + lasso_idwsf2_disco_abstract_new_with_string(svcMD->Abstract)); + /* ProviderID */ metadata->any = g_list_append(metadata->any, - lasso_idwsf2_disco_provider_id_new_with_string(svcMD->ProviderID)); - /* ServiceType */ + lasso_idwsf2_disco_provider_id_new_with_string(svcMD->ProviderID)); + /* ServiceType */ metadata->any = g_list_append(metadata->any, - lasso_idwsf2_disco_service_type_new_with_string( - (char*)service_context->ServiceType->data)); + lasso_idwsf2_disco_service_type_new_with_string( + (char*)service_context->ServiceType->data)); /* Framework */ if (endpoint_context->Framework != NULL) { metadata->any = g_list_append(metadata->any, diff --git a/lasso/saml-2.0/name_id_management.c b/lasso/saml-2.0/name_id_management.c index 69d06f6d..8779ca3f 100644 --- a/lasso/saml-2.0/name_id_management.c +++ b/lasso/saml-2.0/name_id_management.c @@ -171,7 +171,7 @@ lasso_name_id_management_build_request_msg(LassoNameIdManagement *name_id_manage if (profile->http_request_method == LASSO_HTTP_METHOD_SOAP) { profile->msg_url = lasso_provider_get_metadata_one(remote_provider, "ManageNameIDService SOAP"); - /* XXX set private key so message is signed */ + /* XXX set private key so message is signed */ profile->msg_body = lasso_node_export_to_soap(profile->request); return 0; } diff --git a/lasso/saml-2.0/name_id_management.h b/lasso/saml-2.0/name_id_management.h index 0bb06d73..5490988f 100644 --- a/lasso/saml-2.0/name_id_management.h +++ b/lasso/saml-2.0/name_id_management.h @@ -66,7 +66,7 @@ LASSO_EXPORT LassoNameIdManagement *lasso_name_id_management_new(LassoServer *se LASSO_EXPORT LassoNameIdManagement *lasso_name_id_management_new_from_dump( LassoServer *server, const char *dump); LASSO_EXPORT char* lasso_name_id_management_dump(LassoNameIdManagement *name_id_management); - + LASSO_EXPORT void lasso_name_id_management_destroy(LassoNameIdManagement *name_id_management); LASSO_EXPORT gint lasso_name_id_management_init_request( diff --git a/lasso/soap_binding.c b/lasso/soap_binding.c index 6e110171..998e3494 100644 --- a/lasso/soap_binding.c +++ b/lasso/soap_binding.c @@ -25,8 +25,10 @@ #include <lasso/soap_binding.h> #define find_node_type_in_list(iter, check) \ - { while (iter && ! check(iter->data)) \ - iter = iter->next; } + { + while (iter && ! check(iter->data)) \ + iter = iter->next;\ + } /** * lasso_soap_binding_get_provider: @@ -34,7 +36,8 @@ * * Look up the sb:Provider header in the SOAP message envelope. * - * @return NULL if no Provider element is present in the header of the SOAP envelope. If found it returns a reference you do not own. + * Return value: NULL if no Provider element is present in the header of the SOAP envelope. If + * found it returns a reference you do not own. */ LassoSoapBindingProvider* lasso_soap_binding_get_provider(LassoSoapEnvelope *envelope) { diff --git a/lasso/soap_binding.h b/lasso/soap_binding.h index 529edc50..cccfa44e 100644 --- a/lasso/soap_binding.h +++ b/lasso/soap_binding.h @@ -33,9 +33,11 @@ extern "C" { #endif /* __cplusplus */ -LASSO_EXPORT LassoSoapBindingProvider* lasso_soap_binding_get_provider(LassoSoapEnvelope *envelope); +LASSO_EXPORT LassoSoapBindingProvider* lasso_soap_binding_get_provider( + LassoSoapEnvelope *envelope); -LASSO_EXPORT LassoSoapBindingCorrelation* lasso_soap_binding_get_correlation(LassoSoapEnvelope *evelope); +LASSO_EXPORT LassoSoapBindingCorrelation* lasso_soap_binding_get_correlation( + LassoSoapEnvelope *evelope); #ifdef __cplusplus } diff --git a/lasso/xml/disco_authenticate_requester.c b/lasso/xml/disco_authenticate_requester.c index 5f33fc60..7b6ce58a 100644 --- a/lasso/xml/disco_authenticate_requester.c +++ b/lasso/xml/disco_authenticate_requester.c @@ -46,7 +46,7 @@ static struct XmlSnippet schema_snippets[] = { { "descriptionIDRefs",SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoDiscoAuthenticateRequester, descriptionIDRefs) }, + G_STRUCT_OFFSET(LassoDiscoAuthenticateRequester, descriptionIDRefs) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_authenticate_session_context.c b/lasso/xml/disco_authenticate_session_context.c index afd93333..6af00568 100644 --- a/lasso/xml/disco_authenticate_session_context.c +++ b/lasso/xml/disco_authenticate_session_context.c @@ -46,7 +46,7 @@ static struct XmlSnippet schema_snippets[] = { { "descriptionIDRefs",SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoDiscoAuthenticateSessionContext, descriptionIDRefs) }, + G_STRUCT_OFFSET(LassoDiscoAuthenticateSessionContext, descriptionIDRefs) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_authenticate_session_context.h b/lasso/xml/disco_authenticate_session_context.h index 3edca583..d79627e4 100644 --- a/lasso/xml/disco_authenticate_session_context.h +++ b/lasso/xml/disco_authenticate_session_context.h @@ -48,7 +48,8 @@ extern "C" { LASSO_TYPE_DISCO_AUTHENTICATE_SESSION_CONTEXT, LassoDiscoAuthenticateSessionContextClass)) typedef struct _LassoDiscoAuthenticateSessionContext LassoDiscoAuthenticateSessionContext; -typedef struct _LassoDiscoAuthenticateSessionContextClass LassoDiscoAuthenticateSessionContextClass; +typedef struct _LassoDiscoAuthenticateSessionContextClass + LassoDiscoAuthenticateSessionContextClass; struct _LassoDiscoAuthenticateSessionContext { LassoNode parent; diff --git a/lasso/xml/disco_authorize_requester.c b/lasso/xml/disco_authorize_requester.c index 357631c3..a0e775e4 100644 --- a/lasso/xml/disco_authorize_requester.c +++ b/lasso/xml/disco_authorize_requester.c @@ -46,7 +46,7 @@ static struct XmlSnippet schema_snippets[] = { { "descriptionIDRefs",SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoDiscoAuthorizeRequester, descriptionIDRefs) }, + G_STRUCT_OFFSET(LassoDiscoAuthorizeRequester, descriptionIDRefs) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_description.c b/lasso/xml/disco_description.c index dc919b1a..34bc47f2 100644 --- a/lasso/xml/disco_description.c +++ b/lasso/xml/disco_description.c @@ -68,12 +68,12 @@ static struct XmlSnippet schema_snippets[] = { { "SecurityMechID", SNIPPET_LIST_CONTENT, - G_STRUCT_OFFSET(LassoDiscoDescription, SecurityMechID) }, + G_STRUCT_OFFSET(LassoDiscoDescription, SecurityMechID) }, { "CredentialRef", SNIPPET_LIST_CONTENT, - G_STRUCT_OFFSET(LassoDiscoDescription, CredentialRef) }, + G_STRUCT_OFFSET(LassoDiscoDescription, CredentialRef) }, { "WsdlURI", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoDiscoDescription, WsdlURI) }, { "ServiceNameRef", SNIPPET_CONTENT, - G_STRUCT_OFFSET(LassoDiscoDescription, ServiceNameRef) }, + G_STRUCT_OFFSET(LassoDiscoDescription, ServiceNameRef) }, { "Endpoint", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoDiscoDescription, Endpoint) }, { "SoapAction", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoDiscoDescription, SoapAction) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDiscoDescription, id) }, @@ -129,7 +129,7 @@ lasso_disco_description_get_type() }; this_type = g_type_register_static(LASSO_TYPE_NODE, - "LassoDiscoDescription", &this_info, 0); + "LassoDiscoDescription", &this_info, 0); } return this_type; } @@ -146,8 +146,8 @@ lasso_disco_description_new() LassoDiscoDescription* lasso_disco_description_new_with_WsdlRef(const gchar *securityMechID, - const gchar *wsdlURI, - const gchar *serviceNameRef) + const gchar *wsdlURI, + const gchar *serviceNameRef) { LassoDiscoDescription *description; @@ -158,7 +158,7 @@ lasso_disco_description_new_with_WsdlRef(const gchar *securityMechID, description = g_object_new(LASSO_TYPE_DISCO_DESCRIPTION, NULL); description->SecurityMechID = g_list_append(description->SecurityMechID, - g_strdup(securityMechID)); + g_strdup(securityMechID)); description->WsdlURI = g_strdup(wsdlURI); description->ServiceNameRef = g_strdup(serviceNameRef); @@ -167,8 +167,8 @@ lasso_disco_description_new_with_WsdlRef(const gchar *securityMechID, LassoDiscoDescription* lasso_disco_description_new_with_BriefSoapHttpDescription(const gchar *securityMechID, - const gchar *endpoint, - const gchar *soapAction) + const gchar *endpoint, + const gchar *soapAction) { LassoDiscoDescription *description; @@ -178,7 +178,7 @@ lasso_disco_description_new_with_BriefSoapHttpDescription(const gchar *securityM description = g_object_new(LASSO_TYPE_DISCO_DESCRIPTION, NULL); description->SecurityMechID = g_list_append(description->SecurityMechID, - g_strdup(securityMechID)); + g_strdup(securityMechID)); description->Endpoint = g_strdup(endpoint); if (soapAction != NULL) { description->SoapAction = g_strdup(soapAction); @@ -198,14 +198,14 @@ lasso_disco_description_copy(LassoDiscoDescription *description) securityMechIds = description->SecurityMechID; while (securityMechIds) { newDescription->SecurityMechID = g_list_append(newDescription->SecurityMechID, - g_strdup(securityMechIds->data)); + g_strdup(securityMechIds->data)); securityMechIds = securityMechIds->next; } credentialRefs = description->CredentialRef; while (credentialRefs) { newDescription->CredentialRef = g_list_append(newDescription->CredentialRef, - g_strdup(credentialRefs->data)); + g_strdup(credentialRefs->data)); credentialRefs = credentialRefs->next; } diff --git a/lasso/xml/disco_encrypt_resource_id.c b/lasso/xml/disco_encrypt_resource_id.c index 6e494eaa..08ca03ea 100644 --- a/lasso/xml/disco_encrypt_resource_id.c +++ b/lasso/xml/disco_encrypt_resource_id.c @@ -46,7 +46,7 @@ static struct XmlSnippet schema_snippets[] = { { "descriptionIDRefs",SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoDiscoEncryptResourceID, descriptionIDRefs) }, + G_STRUCT_OFFSET(LassoDiscoEncryptResourceID, descriptionIDRefs) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_encrypted_resource_id.c b/lasso/xml/disco_encrypted_resource_id.c index 5bc07d8d..4d3581ce 100644 --- a/lasso/xml/disco_encrypted_resource_id.c +++ b/lasso/xml/disco_encrypted_resource_id.c @@ -43,28 +43,28 @@ */ /*****************************************************************************/ -/* private methods */ +/* private methods */ /*****************************************************************************/ static struct XmlSnippet schema_snippets[] = { #if 0 { "EncryptedData", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoEncryptedResourceID, EncryptedData) }, + G_STRUCT_OFFSET(LassoDiscoEncryptedResourceID, EncryptedData) }, { "EncryptedKey", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoEncryptedResourceID, EncryptedKey) }, + G_STRUCT_OFFSET(LassoDiscoEncryptedResourceID, EncryptedKey) }, #endif - { "", SNIPPET_LIST_XMLNODES, G_STRUCT_OFFSET(LassoDiscoEncryptedResourceID, any) }, + { "", SNIPPET_LIST_XMLNODES, G_STRUCT_OFFSET(LassoDiscoEncryptedResourceID, any) }, { NULL, 0, 0} }; /*****************************************************************************/ -/* instance and class init functions */ +/* instance and class init functions */ /*****************************************************************************/ static void instance_init(LassoDiscoEncryptedResourceID *node) { - node->any = NULL; + node->any = NULL; #if 0 node->EncryptedData = NULL; node->EncryptedKey = NULL; @@ -101,8 +101,8 @@ lasso_disco_encrypted_resource_id_get_type() }; this_type = g_type_register_static(LASSO_TYPE_NODE, - "LassoDiscoEncryptedResourceID", - &this_info, 0); + "LassoDiscoEncryptedResourceID", + &this_info, 0); } return this_type; } diff --git a/lasso/xml/disco_encrypted_resource_id.h b/lasso/xml/disco_encrypted_resource_id.h index db4e8f4f..b9f0cf9c 100644 --- a/lasso/xml/disco_encrypted_resource_id.h +++ b/lasso/xml/disco_encrypted_resource_id.h @@ -55,7 +55,7 @@ struct _LassoDiscoEncryptedResourceID { LassoXencEncryptedData *EncryptedData; LassoXencEncryptedKey *EncryptedKey; #endif - GList *any; /* of xmlNode */ + GList *any; /* of xmlNode */ }; struct _LassoDiscoEncryptedResourceIDClass { diff --git a/lasso/xml/disco_generate_bearer_token.c b/lasso/xml/disco_generate_bearer_token.c index 91308e83..8d95be50 100644 --- a/lasso/xml/disco_generate_bearer_token.c +++ b/lasso/xml/disco_generate_bearer_token.c @@ -46,7 +46,7 @@ static struct XmlSnippet schema_snippets[] = { { "descriptionIDRefs",SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoDiscoGenerateBearerToken, descriptionIDRefs) }, + G_STRUCT_OFFSET(LassoDiscoGenerateBearerToken, descriptionIDRefs) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_insert_entry.c b/lasso/xml/disco_insert_entry.c index c7b54335..df2798b7 100644 --- a/lasso/xml/disco_insert_entry.c +++ b/lasso/xml/disco_insert_entry.c @@ -47,7 +47,7 @@ static struct XmlSnippet schema_snippets[] = { { "ResourceOffering", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoInsertEntry, ResourceOffering) }, + G_STRUCT_OFFSET(LassoDiscoInsertEntry, ResourceOffering) }, { "", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoDiscoInsertEntry, any) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_modify.c b/lasso/xml/disco_modify.c index 854bc205..ab47057b 100644 --- a/lasso/xml/disco_modify.c +++ b/lasso/xml/disco_modify.c @@ -60,7 +60,7 @@ static struct XmlSnippet schema_snippets[] = { { "ResourceID", SNIPPET_NODE, G_STRUCT_OFFSET(LassoDiscoModify, ResourceID) }, { "EncryptedResourceID", SNIPPET_NODE, \ - G_STRUCT_OFFSET(LassoDiscoModify, EncryptedResourceID) }, + G_STRUCT_OFFSET(LassoDiscoModify, EncryptedResourceID) }, { "InsertEntry", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoDiscoModify, InsertEntry) }, { "RemoveEntry", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoDiscoModify, RemoveEntry) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDiscoModify, id) }, @@ -111,7 +111,7 @@ lasso_disco_modify_get_type() }; this_type = g_type_register_static(LASSO_TYPE_NODE, - "LassoDiscoModify", &this_info, 0); + "LassoDiscoModify", &this_info, 0); } return this_type; } diff --git a/lasso/xml/disco_modify_response.c b/lasso/xml/disco_modify_response.c index 2a7c18ea..a535ea9f 100644 --- a/lasso/xml/disco_modify_response.c +++ b/lasso/xml/disco_modify_response.c @@ -66,7 +66,7 @@ static struct XmlSnippet schema_snippets[] = { { "Status", SNIPPET_NODE, G_STRUCT_OFFSET(LassoDiscoModifyResponse, Status) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDiscoModifyResponse, id) }, { "newEntryIDs", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoDiscoModifyResponse, newEntryIDs) }, + G_STRUCT_OFFSET(LassoDiscoModifyResponse, newEntryIDs) }, { NULL, 0, 0} }; @@ -141,8 +141,8 @@ lasso_disco_modify_response_get_type() }; this_type = g_type_register_static(LASSO_TYPE_NODE, - "LassoDiscoModifyResponse", - &this_info, 0); + "LassoDiscoModifyResponse", + &this_info, 0); } return this_type; } diff --git a/lasso/xml/disco_options.c b/lasso/xml/disco_options.c index a3d3f98a..055f495e 100644 --- a/lasso/xml/disco_options.c +++ b/lasso/xml/disco_options.c @@ -90,7 +90,7 @@ lasso_disco_options_get_type() }; this_type = g_type_register_static(LASSO_TYPE_NODE, - "LassoDiscoOptions", &this_info, 0); + "LassoDiscoOptions", &this_info, 0); } return this_type; } diff --git a/lasso/xml/disco_query.c b/lasso/xml/disco_query.c index 50629986..89abfdf5 100644 --- a/lasso/xml/disco_query.c +++ b/lasso/xml/disco_query.c @@ -66,9 +66,9 @@ static struct XmlSnippet schema_snippets[] = { { "ResourceID", SNIPPET_NODE, G_STRUCT_OFFSET(LassoDiscoQuery, ResourceID) }, { "EncryptedResourceID", - SNIPPET_NODE, G_STRUCT_OFFSET(LassoDiscoQuery, EncryptedResourceID) }, + SNIPPET_NODE, G_STRUCT_OFFSET(LassoDiscoQuery, EncryptedResourceID) }, { "RequestedServiceType", SNIPPET_LIST_NODES, - G_STRUCT_OFFSET(LassoDiscoQuery, RequestedServiceType) }, + G_STRUCT_OFFSET(LassoDiscoQuery, RequestedServiceType) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDiscoQuery, id) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_query_response.c b/lasso/xml/disco_query_response.c index bd21bf81..f3c7e071 100644 --- a/lasso/xml/disco_query_response.c +++ b/lasso/xml/disco_query_response.c @@ -56,13 +56,13 @@ static struct XmlSnippet schema_snippets[] = { { "Status", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoQueryResponse, Status) }, + G_STRUCT_OFFSET(LassoDiscoQueryResponse, Status) }, { "ResourceOffering", SNIPPET_LIST_NODES, - G_STRUCT_OFFSET(LassoDiscoQueryResponse, ResourceOffering) }, + G_STRUCT_OFFSET(LassoDiscoQueryResponse, ResourceOffering) }, { "Credentials", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoQueryResponse, Credentials) }, + G_STRUCT_OFFSET(LassoDiscoQueryResponse, Credentials) }, { "id", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoDiscoQueryResponse, id) }, + G_STRUCT_OFFSET(LassoDiscoQueryResponse, id) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_requested_service_type.c b/lasso/xml/disco_requested_service_type.c index 6036938f..2902ab01 100644 --- a/lasso/xml/disco_requested_service_type.c +++ b/lasso/xml/disco_requested_service_type.c @@ -51,9 +51,9 @@ static struct XmlSnippet schema_snippets[] = { { "ServiceType", SNIPPET_CONTENT, - G_STRUCT_OFFSET(LassoDiscoRequestedServiceType, ServiceType) }, + G_STRUCT_OFFSET(LassoDiscoRequestedServiceType, ServiceType) }, { "Options", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoRequestedServiceType, Options) }, + G_STRUCT_OFFSET(LassoDiscoRequestedServiceType, Options) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_resource_offering.c b/lasso/xml/disco_resource_offering.c index cda1d721..3bf506be 100644 --- a/lasso/xml/disco_resource_offering.c +++ b/lasso/xml/disco_resource_offering.c @@ -57,17 +57,17 @@ static struct XmlSnippet schema_snippets[] = { { "ResourceID", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoResourceOffering, ResourceID) }, + G_STRUCT_OFFSET(LassoDiscoResourceOffering, ResourceID) }, { "EncryptedResourceID", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoResourceOffering, EncryptedResourceID) }, + G_STRUCT_OFFSET(LassoDiscoResourceOffering, EncryptedResourceID) }, { "ServiceInstance", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoResourceOffering, ServiceInstance) }, + G_STRUCT_OFFSET(LassoDiscoResourceOffering, ServiceInstance) }, { "Options", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoDiscoResourceOffering, Options) }, + G_STRUCT_OFFSET(LassoDiscoResourceOffering, Options) }, { "Abstract", SNIPPET_CONTENT, - G_STRUCT_OFFSET(LassoDiscoResourceOffering, Abstract) }, + G_STRUCT_OFFSET(LassoDiscoResourceOffering, Abstract) }, { "entryID", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoDiscoResourceOffering, entryID) }, + G_STRUCT_OFFSET(LassoDiscoResourceOffering, entryID) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_send_single_logout.c b/lasso/xml/disco_send_single_logout.c index 1879e4ee..cfad4ed1 100644 --- a/lasso/xml/disco_send_single_logout.c +++ b/lasso/xml/disco_send_single_logout.c @@ -46,7 +46,7 @@ static struct XmlSnippet schema_snippets[] = { { "descriptionIDRefs",SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoDiscoSendSingleLogout, descriptionIDRefs) }, + G_STRUCT_OFFSET(LassoDiscoSendSingleLogout, descriptionIDRefs) }, { NULL, 0, 0} }; diff --git a/lasso/xml/disco_service_instance.c b/lasso/xml/disco_service_instance.c index 4f8dd3a2..7be3c620 100644 --- a/lasso/xml/disco_service_instance.c +++ b/lasso/xml/disco_service_instance.c @@ -50,11 +50,11 @@ static struct XmlSnippet schema_snippets[] = { { "ServiceType", SNIPPET_CONTENT, - G_STRUCT_OFFSET(LassoDiscoServiceInstance, ServiceType) }, + G_STRUCT_OFFSET(LassoDiscoServiceInstance, ServiceType) }, { "ProviderID", SNIPPET_CONTENT, - G_STRUCT_OFFSET(LassoDiscoServiceInstance, ProviderID) }, + G_STRUCT_OFFSET(LassoDiscoServiceInstance, ProviderID) }, { "Description", SNIPPET_LIST_NODES, - G_STRUCT_OFFSET(LassoDiscoServiceInstance, Description) }, + G_STRUCT_OFFSET(LassoDiscoServiceInstance, Description) }, { NULL, 0, 0} }; @@ -107,8 +107,8 @@ lasso_disco_service_instance_get_type() LassoDiscoServiceInstance* lasso_disco_service_instance_new(const gchar *serviceType, - const gchar *providerID, - LassoDiscoDescription *description) + const gchar *providerID, + LassoDiscoDescription *description) { LassoDiscoServiceInstance *service_instance; @@ -124,7 +124,7 @@ lasso_disco_service_instance_new(const gchar *serviceType, service_instance->ProviderID = g_strdup(providerID); service_instance->Description = g_list_append(service_instance->Description, - description); + description); return service_instance; } diff --git a/lasso/xml/dst_modification.h b/lasso/xml/dst_modification.h index 6847fb86..f37366e5 100644 --- a/lasso/xml/dst_modification.h +++ b/lasso/xml/dst_modification.h @@ -38,11 +38,11 @@ extern "C" { #define LASSO_DST_MODIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ LASSO_TYPE_DST_MODIFICATION, LassoDstModificationClass)) #define LASSO_IS_DST_MODIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - LASSO_TYPE_DST_MODIFICATION)) + LASSO_TYPE_DST_MODIFICATION)) #define LASSO_IS_DST_MODIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_DST_MODIFICATION)) + LASSO_TYPE_DST_MODIFICATION)) #define LASSO_DST_MODIFICATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_DST_MODIFICATION, LassoDstModificationClass)) + LASSO_TYPE_DST_MODIFICATION, LassoDstModificationClass)) typedef struct _LassoDstModification LassoDstModification; typedef struct _LassoDstModificationClass LassoDstModificationClass; diff --git a/lasso/xml/dst_modify.h b/lasso/xml/dst_modify.h index 9a0f2054..d78b75a8 100644 --- a/lasso/xml/dst_modify.h +++ b/lasso/xml/dst_modify.h @@ -42,7 +42,7 @@ extern "C" { #define LASSO_IS_DST_MODIFY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_DST_MODIFY)) #define LASSO_IS_DST_MODIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_DST_MODIFY)) #define LASSO_DST_MODIFY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_DST_MODIFY, LassoDstModifyClass)) + LASSO_TYPE_DST_MODIFY, LassoDstModifyClass)) typedef struct _LassoDstModify LassoDstModify; typedef struct _LassoDstModifyClass LassoDstModifyClass; diff --git a/lasso/xml/dst_modify_response.h b/lasso/xml/dst_modify_response.h index 00f97270..a384cd11 100644 --- a/lasso/xml/dst_modify_response.h +++ b/lasso/xml/dst_modify_response.h @@ -38,11 +38,11 @@ extern "C" { #define LASSO_DST_MODIFY_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ LASSO_TYPE_DST_MODIFY_RESPONSE, LassoDstModifyResponseClass)) #define LASSO_IS_DST_MODIFY_RESPONSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - LASSO_TYPE_DST_MODIFY_RESPONSE)) + LASSO_TYPE_DST_MODIFY_RESPONSE)) #define LASSO_IS_DST_MODIFY_RESPONSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_DST_MODIFY_RESPONSE)) + LASSO_TYPE_DST_MODIFY_RESPONSE)) #define LASSO_DST_MODIFY_RESPONSE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_DST_MODIFY_RESPONSE, LassoDstModifyResponseClass)) + LASSO_TYPE_DST_MODIFY_RESPONSE, LassoDstModifyResponseClass)) typedef struct _LassoDstModifyResponse LassoDstModifyResponse; typedef struct _LassoDstModifyResponseClass LassoDstModifyResponseClass; diff --git a/lasso/xml/dst_new_data.h b/lasso/xml/dst_new_data.h index 36e70938..2b137813 100644 --- a/lasso/xml/dst_new_data.h +++ b/lasso/xml/dst_new_data.h @@ -38,9 +38,9 @@ extern "C" { LASSO_TYPE_DST_NEW_DATA, LassoDstNewDataClass)) #define LASSO_IS_DST_NEW_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_DST_NEW_DATA)) #define LASSO_IS_DST_NEW_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_DST_NEW_DATA)) + LASSO_TYPE_DST_NEW_DATA)) #define LASSO_DST_NEW_DATA_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_DST_NEW_DATA, LassoDstNewDataClass)) + LASSO_TYPE_DST_NEW_DATA, LassoDstNewDataClass)) typedef struct _LassoDstNewData LassoDstNewData; typedef struct _LassoDstNewDataClass LassoDstNewDataClass; diff --git a/lasso/xml/dst_query.c b/lasso/xml/dst_query.c index 2fb2d08f..d1fc3903 100644 --- a/lasso/xml/dst_query.c +++ b/lasso/xml/dst_query.c @@ -60,7 +60,7 @@ static struct XmlSnippet schema_snippets[] = { { "ResourceID", SNIPPET_NODE, G_STRUCT_OFFSET(LassoDstQuery, ResourceID) }, { "EncryptedResourceID", SNIPPET_NODE, G_STRUCT_OFFSET(LassoDstQuery, - EncryptedResourceID) }, + EncryptedResourceID) }, { "QueryItem", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoDstQuery, QueryItem) }, { "Extension", SNIPPET_EXTENSION, G_STRUCT_OFFSET(LassoDstQuery, Extension) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDstQuery, id) }, @@ -106,7 +106,7 @@ init_from_xml(LassoNode *node, xmlNode *xmlnode) rc = parent_class->init_from_xml(node, xmlnode); if (rc) { - return rc; + return rc; } query->hrefServiceType = g_strdup((char*)xmlnode->ns->href); diff --git a/lasso/xml/dst_query.h b/lasso/xml/dst_query.h index 2e9626ea..c8da65e9 100644 --- a/lasso/xml/dst_query.h +++ b/lasso/xml/dst_query.h @@ -42,7 +42,7 @@ extern "C" { #define LASSO_IS_DST_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_DST_QUERY)) #define LASSO_IS_DST_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_DST_QUERY)) #define LASSO_DST_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_DST_QUERY, LassoDstQueryClass)) + LASSO_TYPE_DST_QUERY, LassoDstQueryClass)) typedef struct _LassoDstQuery LassoDstQuery; typedef struct _LassoDstQueryClass LassoDstQueryClass; diff --git a/lasso/xml/dst_query_item.c b/lasso/xml/dst_query_item.c index 6adc59f4..1212fa05 100644 --- a/lasso/xml/dst_query_item.c +++ b/lasso/xml/dst_query_item.c @@ -66,7 +66,7 @@ static struct XmlSnippet schema_snippets[] = { { "Select", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoDstQueryItem, Select) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDstQueryItem, id) }, { "includeCommonAttributes", SNIPPET_ATTRIBUTE | SNIPPET_BOOLEAN, \ - G_STRUCT_OFFSET(LassoDstQueryItem, includeCommonAttributes) }, + G_STRUCT_OFFSET(LassoDstQueryItem, includeCommonAttributes) }, { "itemID", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDstQueryItem, itemID) }, { "changedSince", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoDstQueryItem, changedSince) }, {NULL, 0, 0} diff --git a/lasso/xml/id-wsf-2.0/disco_svc_md_query_response.h b/lasso/xml/id-wsf-2.0/disco_svc_md_query_response.h index eaca1ca1..c9082494 100644 --- a/lasso/xml/id-wsf-2.0/disco_svc_md_query_response.h +++ b/lasso/xml/id-wsf-2.0/disco_svc_md_query_response.h @@ -75,7 +75,8 @@ struct _LassoIdWsf2DiscoSvcMDQueryResponseClass { }; LASSO_EXPORT GType lasso_idwsf2_disco_svc_md_query_response_get_type(void); -LASSO_EXPORT LassoIdWsf2DiscoSvcMDQueryResponse* lasso_idwsf2_disco_svc_md_query_response_new(void); +LASSO_EXPORT LassoIdWsf2DiscoSvcMDQueryResponse* lasso_idwsf2_disco_svc_md_query_response_new( + void); diff --git a/lasso/xml/id-wsf-2.0/ps_add_known_entity_request.h b/lasso/xml/id-wsf-2.0/ps_add_known_entity_request.h index 1f184c73..e91c8fb1 100644 --- a/lasso/xml/id-wsf-2.0/ps_add_known_entity_request.h +++ b/lasso/xml/id-wsf-2.0/ps_add_known_entity_request.h @@ -80,7 +80,8 @@ struct _LassoIdWsf2PsAddKnownEntityRequestClass { }; LASSO_EXPORT GType lasso_idwsf2_ps_add_known_entity_request_get_type(void); -LASSO_EXPORT LassoIdWsf2PsAddKnownEntityRequest* lasso_idwsf2_ps_add_known_entity_request_new(void); +LASSO_EXPORT LassoIdWsf2PsAddKnownEntityRequest* lasso_idwsf2_ps_add_known_entity_request_new( + void); diff --git a/lasso/xml/id-wsf-2.0/ps_get_object_info_response.h b/lasso/xml/id-wsf-2.0/ps_get_object_info_response.h index 3b0b042f..b8aaf258 100644 --- a/lasso/xml/id-wsf-2.0/ps_get_object_info_response.h +++ b/lasso/xml/id-wsf-2.0/ps_get_object_info_response.h @@ -73,7 +73,8 @@ struct _LassoIdWsf2PsGetObjectInfoResponseClass { }; LASSO_EXPORT GType lasso_idwsf2_ps_get_object_info_response_get_type(void); -LASSO_EXPORT LassoIdWsf2PsGetObjectInfoResponse* lasso_idwsf2_ps_get_object_info_response_new(void); +LASSO_EXPORT LassoIdWsf2PsGetObjectInfoResponse* lasso_idwsf2_ps_get_object_info_response_new( + void); diff --git a/lasso/xml/is_interaction_response.c b/lasso/xml/is_interaction_response.c index e60c9ecf..6e446b9b 100644 --- a/lasso/xml/is_interaction_response.c +++ b/lasso/xml/is_interaction_response.c @@ -54,9 +54,9 @@ static struct XmlSnippet schema_snippets[] = { { "Status", SNIPPET_NODE, G_STRUCT_OFFSET(LassoIsInteractionResponse, Status) }, { "InteractionStatement", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsInteractionResponse, - InteractionStatement) }, + InteractionStatement) }, { "Parameter", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsInteractionResponse, - Parameter) }, + Parameter) }, { NULL, 0, 0} }; diff --git a/lasso/xml/is_select.c b/lasso/xml/is_select.c index a5d89fee..2cfa7a4d 100644 --- a/lasso/xml/is_select.c +++ b/lasso/xml/is_select.c @@ -53,7 +53,7 @@ static struct XmlSnippet schema_snippets[] = { { "Item", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoIsSelect, Item) }, { "multiple", SNIPPET_ATTRIBUTE | SNIPPET_BOOLEAN, - G_STRUCT_OFFSET(LassoIsSelect, multiple) }, + G_STRUCT_OFFSET(LassoIsSelect, multiple) }, { NULL, 0, 0} }; diff --git a/lasso/xml/is_user_interaction.c b/lasso/xml/is_user_interaction.c index ae84d748..ccaaeccf 100644 --- a/lasso/xml/is_user_interaction.c +++ b/lasso/xml/is_user_interaction.c @@ -54,14 +54,14 @@ static struct XmlSnippet schema_snippets[] = { { "InteractionService", SNIPPET_LIST_NODES, - G_STRUCT_OFFSET(LassoIsUserInteraction, InteractionService) }, + G_STRUCT_OFFSET(LassoIsUserInteraction, InteractionService) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsUserInteraction, id) }, { "interact", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsUserInteraction, interact) }, { "language", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoIsUserInteraction, language) }, { "redirect", SNIPPET_ATTRIBUTE | SNIPPET_BOOLEAN, - G_STRUCT_OFFSET(LassoIsUserInteraction, redirect) }, - { "maxInteractTime", SNIPPET_ATTRIBUTE | SNIPPET_INTEGER, - G_STRUCT_OFFSET(LassoIsUserInteraction, maxInteractTime) }, + G_STRUCT_OFFSET(LassoIsUserInteraction, redirect) }, + { "maxInteractTime", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoIsUserInteraction, maxInteractTime) }, { NULL, 0, 0} }; diff --git a/lasso/xml/private.h b/lasso/xml/private.h index cbaa70e7..4d5abe28 100644 --- a/lasso/xml/private.h +++ b/lasso/xml/private.h @@ -108,7 +108,8 @@ xmlSecKeyPtr lasso_load_private_key_file(const char *file); xmlSecKeyPtr lasso_get_public_key_from_pem_cert_file(const char *file); xmlSecKeysMngr* lasso_load_certs_from_pem_certs_chain_file (const char *file); -char* lasso_query_sign(char *query, LassoSignatureMethod sign_method, const char *private_key_file); +char* lasso_query_sign(char *query, LassoSignatureMethod sign_method, + const char *private_key_file); int lasso_query_verify_signature(const char *query, const xmlSecKey *public_key); diff --git a/lasso/xml/sa_credentials.c b/lasso/xml/sa_credentials.c index 7d78f991..9221d9de 100644 --- a/lasso/xml/sa_credentials.c +++ b/lasso/xml/sa_credentials.c @@ -120,12 +120,12 @@ lasso_sa_credentials_new_from_message(const gchar *message) gint lasso_sa_credentials_add_assertion(LassoSaCredentials *credentials, - LassoSamlAssertion *assertion) + LassoSamlAssertion *assertion) { g_return_val_if_fail(LASSO_IS_SA_CREDENTIALS(credentials), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(LASSO_IS_SAML_ASSERTION(assertion), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_object_ref(assertion); credentials->any = g_list_append(credentials->any, assertion); diff --git a/lasso/xml/sa_sasl_request.c b/lasso/xml/sa_sasl_request.c index a2c81dea..90ed9960 100644 --- a/lasso/xml/sa_sasl_request.c +++ b/lasso/xml/sa_sasl_request.c @@ -59,17 +59,17 @@ static struct XmlSnippet schema_snippets[] = { { "Data", SNIPPET_LIST_CONTENT, - G_STRUCT_OFFSET(LassoSaSASLRequest, Data) }, + G_STRUCT_OFFSET(LassoSaSASLRequest, Data) }, { "RequestAuthnContext", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoSaSASLRequest, RequestAuthnContext) }, + G_STRUCT_OFFSET(LassoSaSASLRequest, RequestAuthnContext) }, { "mechanism", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSaSASLRequest, mechanism) }, + G_STRUCT_OFFSET(LassoSaSASLRequest, mechanism) }, { "authzID", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSaSASLRequest, authzID) }, + G_STRUCT_OFFSET(LassoSaSASLRequest, authzID) }, { "advisoryAuthnID", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSaSASLRequest, advisoryAuthnID) }, + G_STRUCT_OFFSET(LassoSaSASLRequest, advisoryAuthnID) }, { "id", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSaSASLRequest, id) }, + G_STRUCT_OFFSET(LassoSaSASLRequest, id) }, { NULL, 0, 0} }; diff --git a/lasso/xml/sa_sasl_response.c b/lasso/xml/sa_sasl_response.c index cbf87c20..6757f6f8 100644 --- a/lasso/xml/sa_sasl_response.c +++ b/lasso/xml/sa_sasl_response.c @@ -68,16 +68,16 @@ static struct XmlSnippet schema_snippets[] = { { "Status", SNIPPET_NODE, G_STRUCT_OFFSET(LassoSaSASLResponse, Status) }, { "PasswordTransforms", SNIPPET_LIST_NODES, - G_STRUCT_OFFSET(LassoSaSASLResponse, PasswordTransforms) }, + G_STRUCT_OFFSET(LassoSaSASLResponse, PasswordTransforms) }, { "Data", SNIPPET_LIST_CONTENT, - G_STRUCT_OFFSET(LassoSaSASLResponse, Data) }, + G_STRUCT_OFFSET(LassoSaSASLResponse, Data) }, { "ResourceOffering", SNIPPET_LIST_NODES, - G_STRUCT_OFFSET(LassoSaSASLResponse, ResourceOffering) }, + G_STRUCT_OFFSET(LassoSaSASLResponse, ResourceOffering) }, { "Credentials", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoSaSASLResponse, Credentials) }, { "serverMechanism", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSaSASLResponse, serverMechanism) }, + G_STRUCT_OFFSET(LassoSaSASLResponse, serverMechanism) }, { "id", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSaSASLResponse, id) }, + G_STRUCT_OFFSET(LassoSaSASLResponse, id) }, { NULL, 0, 0} }; @@ -190,12 +190,12 @@ lasso_sa_sasl_response_new_from_message(const gchar *message) gint lasso_sa_sasl_response_add_credentials(LassoSaSASLResponse *response, - LassoSaCredentials *credentials) + LassoSaCredentials *credentials) { g_return_val_if_fail(LASSO_IS_SA_SASL_RESPONSE(response), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(LASSO_IS_SA_CREDENTIALS(credentials), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_object_ref(credentials); response->Credentials = g_list_append(response->Credentials, credentials); @@ -205,12 +205,12 @@ lasso_sa_sasl_response_add_credentials(LassoSaSASLResponse *response, gint lasso_sa_sasl_response_add_resource_offering(LassoSaSASLResponse *response, - LassoDiscoResourceOffering *resourceOffering) + LassoDiscoResourceOffering *resourceOffering) { g_return_val_if_fail(LASSO_IS_SA_SASL_RESPONSE(response), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_return_val_if_fail(LASSO_IS_DISCO_RESOURCE_OFFERING(resourceOffering), - LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); + LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ); g_object_ref(resourceOffering); response->ResourceOffering = g_list_append(response->ResourceOffering, resourceOffering); diff --git a/lasso/xml/saml-2.0/saml2_attribute_value.c b/lasso/xml/saml-2.0/saml2_attribute_value.c index 6f915335..cbfb2680 100644 --- a/lasso/xml/saml-2.0/saml2_attribute_value.c +++ b/lasso/xml/saml-2.0/saml2_attribute_value.c @@ -78,8 +78,8 @@ lasso_saml2_attribute_value_get_type() }; this_type = g_type_register_static(LASSO_TYPE_NODE, - "LassoSaml2AttributeValue", - &this_info, 0); + "LassoSaml2AttributeValue", + &this_info, 0); } return this_type; } diff --git a/lasso/xml/saml_advice.c b/lasso/xml/saml_advice.c index 5b3736b5..7c5fcaa0 100644 --- a/lasso/xml/saml_advice.c +++ b/lasso/xml/saml_advice.c @@ -49,19 +49,19 @@ */ /*****************************************************************************/ -/* private methods */ +/* private methods */ /*****************************************************************************/ static struct XmlSnippet schema_snippets[] = { /* { "AssertionIDReference", SNIPPET_LIST_CONTENT, G_STRUCT_OFFSET(LassoSamlAdvice, AssertionIDReference) }, { "Assertion", SNIPPET_NODE, G_STRUCT_OFFSET(LassoSamlAdvice, Assertion) }, */ - { "", SNIPPET_LIST_XMLNODES, G_STRUCT_OFFSET(LassoSamlAdvice, any) }, + { "", SNIPPET_LIST_XMLNODES, G_STRUCT_OFFSET(LassoSamlAdvice, any) }, { NULL, 0, 0} }; /*****************************************************************************/ -/* instance and class init functions */ +/* instance and class init functions */ /*****************************************************************************/ static void @@ -69,7 +69,7 @@ instance_init(LassoSamlAdvice *node) { /* node->AssertionIDReference = NULL; node->Assertion = NULL; */ - node->any = NULL; + node->any = NULL; } static void diff --git a/lasso/xml/saml_advice.h b/lasso/xml/saml_advice.h index 3dc2464a..5e455598 100644 --- a/lasso/xml/saml_advice.h +++ b/lasso/xml/saml_advice.h @@ -49,10 +49,6 @@ struct _LassoSamlAdvice { LassoNode parent; /*< public >*/ - /* <element ref="saml:AssertionIDReference"/> */ - // GList *AssertionIDReference; - /* <element ref="saml:Assertion"/> */ - // LassoNode *Assertion; /* actually LassoSamlAssertion* but it recurses */ GList *any; /* of xmlNode */ }; diff --git a/lasso/xml/saml_attribute.c b/lasso/xml/saml_attribute.c index d9267d4d..3d8c5438 100644 --- a/lasso/xml/saml_attribute.c +++ b/lasso/xml/saml_attribute.c @@ -66,9 +66,9 @@ static struct XmlSnippet schema_snippets[] = { { "AttributeName", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSamlAttribute, attributeName) }, + G_STRUCT_OFFSET(LassoSamlAttribute, attributeName) }, { "AttributeNameSpace", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSamlAttribute, attributeNameSpace) }, + G_STRUCT_OFFSET(LassoSamlAttribute, attributeNameSpace) }, { "AttributeValue", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoSamlAttribute, AttributeValue) }, { NULL, 0, 0} diff --git a/lasso/xml/saml_attribute_designator.c b/lasso/xml/saml_attribute_designator.c index 4f6bf9c2..40183cf0 100644 --- a/lasso/xml/saml_attribute_designator.c +++ b/lasso/xml/saml_attribute_designator.c @@ -87,7 +87,7 @@ lasso_saml_attribute_designator_get_type() }; this_type = g_type_register_static(LASSO_TYPE_NODE, - "LassoSamlAttributeDesignator", &this_info, 0); + "LassoSamlAttributeDesignator", &this_info, 0); } return this_type; } diff --git a/lasso/xml/saml_attribute_statement.c b/lasso/xml/saml_attribute_statement.c index cfb86951..8d7bf6c0 100644 --- a/lasso/xml/saml_attribute_statement.c +++ b/lasso/xml/saml_attribute_statement.c @@ -89,8 +89,8 @@ lasso_saml_attribute_statement_get_type() }; this_type = g_type_register_static(LASSO_TYPE_SAML_SUBJECT_STATEMENT_ABSTRACT, - "LassoSamlAttributeStatement", - &this_info, 0); + "LassoSamlAttributeStatement", + &this_info, 0); } return this_type; } diff --git a/lasso/xml/saml_attribute_value.c b/lasso/xml/saml_attribute_value.c index 59e01776..3523f5c0 100644 --- a/lasso/xml/saml_attribute_value.c +++ b/lasso/xml/saml_attribute_value.c @@ -80,8 +80,8 @@ lasso_saml_attribute_value_get_type() }; this_type = g_type_register_static(LASSO_TYPE_NODE, - "LassoSamlAttributeValue", - &this_info, 0); + "LassoSamlAttributeValue", + &this_info, 0); } return this_type; } diff --git a/lasso/xml/soap_binding_consent.c b/lasso/xml/soap_binding_consent.c index cc7f7ef7..a1491926 100644 --- a/lasso/xml/soap_binding_consent.c +++ b/lasso/xml/soap_binding_consent.c @@ -50,12 +50,12 @@ static struct XmlSnippet schema_snippets[] = { { "uri", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingConsent, uri) }, + G_STRUCT_OFFSET(LassoSoapBindingConsent, uri) }, { "timestamp", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingConsent, timestamp) }, + G_STRUCT_OFFSET(LassoSoapBindingConsent, timestamp) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingConsent, id) }, { "mustUnderstand", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingConsent, mustUnderstand) }, + G_STRUCT_OFFSET(LassoSoapBindingConsent, mustUnderstand) }, { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingConsent, actor) }, { NULL, 0, 0} }; diff --git a/lasso/xml/soap_binding_correlation.c b/lasso/xml/soap_binding_correlation.c index d7fbd6ad..4bf24e9e 100644 --- a/lasso/xml/soap_binding_correlation.c +++ b/lasso/xml/soap_binding_correlation.c @@ -48,14 +48,14 @@ static struct XmlSnippet schema_snippets[] = { { "messageID", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingCorrelation, messageID) }, + G_STRUCT_OFFSET(LassoSoapBindingCorrelation, messageID) }, { "refToMessageID", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingCorrelation, refToMessageID) }, + G_STRUCT_OFFSET(LassoSoapBindingCorrelation, refToMessageID) }, { "timestamp", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingCorrelation, timestamp) }, + G_STRUCT_OFFSET(LassoSoapBindingCorrelation, timestamp) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingCorrelation, id) }, { "mustUnderstand", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingCorrelation, mustUnderstand) }, + G_STRUCT_OFFSET(LassoSoapBindingCorrelation, mustUnderstand) }, { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingCorrelation, actor) }, { NULL, 0, 0} }; diff --git a/lasso/xml/soap_binding_ext_credentials_context.c b/lasso/xml/soap_binding_ext_credentials_context.c index d9fbeb31..51609f4d 100644 --- a/lasso/xml/soap_binding_ext_credentials_context.c +++ b/lasso/xml/soap_binding_ext_credentials_context.c @@ -52,14 +52,14 @@ static struct XmlSnippet schema_snippets[] = { { "RequestAuthnContext", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoSoapBindingExtCredentialsContext, RequestAuthnContext) }, + G_STRUCT_OFFSET(LassoSoapBindingExtCredentialsContext, RequestAuthnContext) }, { "SecurityMechID", SNIPPET_CONTENT, - G_STRUCT_OFFSET(LassoSoapBindingExtCredentialsContext, SecurityMechID) }, + G_STRUCT_OFFSET(LassoSoapBindingExtCredentialsContext, SecurityMechID) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingExtCredentialsContext, id) }, { "mustUnderstand", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingExtCredentialsContext, mustUnderstand) }, + G_STRUCT_OFFSET(LassoSoapBindingExtCredentialsContext, mustUnderstand) }, { "actor", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingExtCredentialsContext, actor) }, + G_STRUCT_OFFSET(LassoSoapBindingExtCredentialsContext, actor) }, { NULL, 0, 0} }; diff --git a/lasso/xml/soap_binding_ext_service_instance_update.c b/lasso/xml/soap_binding_ext_service_instance_update.c index 3cc21f0a..0c6c9c8c 100644 --- a/lasso/xml/soap_binding_ext_service_instance_update.c +++ b/lasso/xml/soap_binding_ext_service_instance_update.c @@ -59,16 +59,16 @@ static struct XmlSnippet schema_snippets[] = { { "SecurityMechID", SNIPPET_CONTENT, - G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, SecurityMechID) }, + G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, SecurityMechID) }, { "Credential", SNIPPET_NODE, - G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, Credential) }, + G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, Credential) }, { "Endpoint", SNIPPET_CONTENT, - G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, Endpoint) }, + G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, Endpoint) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, id) }, { "mustUnderstand", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, mustUnderstand) }, + G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, mustUnderstand) }, { "actor", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, actor) }, + G_STRUCT_OFFSET(LassoSoapBindingExtServiceInstanceUpdate, actor) }, { NULL, 0, 0} }; diff --git a/lasso/xml/soap_binding_ext_timeout.c b/lasso/xml/soap_binding_ext_timeout.c index 8d9477f8..c033d0f0 100644 --- a/lasso/xml/soap_binding_ext_timeout.c +++ b/lasso/xml/soap_binding_ext_timeout.c @@ -49,10 +49,10 @@ static struct XmlSnippet schema_snippets[] = { { "maxProcessingTime", SNIPPET_ATTRIBUTE | SNIPPET_INTEGER, \ - G_STRUCT_OFFSET(LassoSoapBindingExtTimeout, maxProcessingTime) }, + G_STRUCT_OFFSET(LassoSoapBindingExtTimeout, maxProcessingTime) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingExtTimeout, id) }, { "mustUnderstand", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingExtTimeout, mustUnderstand) }, + G_STRUCT_OFFSET(LassoSoapBindingExtTimeout, mustUnderstand) }, { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingExtTimeout, actor) }, { NULL, 0, 0} }; diff --git a/lasso/xml/soap_binding_processing_context.c b/lasso/xml/soap_binding_processing_context.c index 397df4b8..41a04ffb 100644 --- a/lasso/xml/soap_binding_processing_context.c +++ b/lasso/xml/soap_binding_processing_context.c @@ -53,7 +53,7 @@ static struct XmlSnippet schema_snippets[] = { { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingProcessingContext, id) }, { "mustUnderstand", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingProcessingContext, mustUnderstand) }, + G_STRUCT_OFFSET(LassoSoapBindingProcessingContext, mustUnderstand) }, { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingProcessingContext, actor) }, { "", SNIPPET_TEXT_CHILD, G_STRUCT_OFFSET(LassoSoapBindingProcessingContext, content) }, { NULL, 0, 0} diff --git a/lasso/xml/soap_binding_provider.c b/lasso/xml/soap_binding_provider.c index 579140ca..06195fe5 100644 --- a/lasso/xml/soap_binding_provider.c +++ b/lasso/xml/soap_binding_provider.c @@ -49,12 +49,12 @@ static struct XmlSnippet schema_snippets[] = { { "providerID", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingProvider, providerID) }, + G_STRUCT_OFFSET(LassoSoapBindingProvider, providerID) }, { "affiliationID", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingProvider, affiliationID) }, + G_STRUCT_OFFSET(LassoSoapBindingProvider, affiliationID) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingProvider, id) }, { "mustUnderstand", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingProvider, mustUnderstand) }, + G_STRUCT_OFFSET(LassoSoapBindingProvider, mustUnderstand) }, { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingProvider, actor) }, { NULL, 0, 0} }; diff --git a/lasso/xml/soap_binding_usage_directive.c b/lasso/xml/soap_binding_usage_directive.c index 20e07c4c..5b0bb512 100644 --- a/lasso/xml/soap_binding_usage_directive.c +++ b/lasso/xml/soap_binding_usage_directive.c @@ -51,12 +51,12 @@ static struct XmlSnippet schema_snippets[] = { { "", SNIPPET_LIST_NODES, - G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, other) }, + G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, other) }, { "ref", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, ref) }, + G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, ref) }, { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, id) }, { "mustUnderstand", SNIPPET_ATTRIBUTE, - G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, mustUnderstand) }, + G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, mustUnderstand) }, { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, actor) }, { NULL, 0, 0} }; diff --git a/lasso/xml/soap_body.c b/lasso/xml/soap_body.c index 419968ff..780d57d4 100644 --- a/lasso/xml/soap_body.c +++ b/lasso/xml/soap_body.c @@ -39,9 +39,9 @@ * </xs:sequence> * <xs:anyAttribute namespace="##any" processContents="lax"> * <xs:annotation> - * <xs:documentation> + * <xs:documentation> * Prose in the spec does not specify that attributes are allowed on the Body element - * </xs:documentation> + * </xs:documentation> * </xs:annotation> * </xs:anyAttribute> * </xs:complexType> @@ -80,7 +80,7 @@ class_init(LassoSoapBodyClass *klass) parent_class = g_type_class_peek_parent(nclass); nclass->node_data = g_new0(LassoNodeClassData, 1); - nclass->get_xmlNode = get_xmlNode; + nclass->get_xmlNode = get_xmlNode; lasso_node_class_set_nodename(nclass, "Body"); lasso_node_class_set_ns(nclass, LASSO_SOAP_ENV_HREF, LASSO_SOAP_ENV_PREFIX); lasso_node_class_add_snippets(nclass, schema_snippets); @@ -88,18 +88,18 @@ class_init(LassoSoapBodyClass *klass) static xmlNode* get_xmlNode(LassoNode *node, gboolean lasso_dump) { - xmlNodePtr ret; - - /* Fix namespace of Id */ - ret = parent_class->get_xmlNode(node, lasso_dump); - - { - xmlNsPtr ns; - ns = xmlNewNs(ret, (xmlChar*)LASSO_WSUTIL1_HREF, (xmlChar*)LASSO_WSUTIL1_PREFIX); - xmlNewNsProp(ret, ns, (xmlChar*)"Id", (xmlChar*)LASSO_SOAP_BODY(node)->Id); - } - - return ret; + xmlNodePtr ret; + + /* Fix namespace of Id */ + ret = parent_class->get_xmlNode(node, lasso_dump); + + { + xmlNsPtr ns; + ns = xmlNewNs(ret, (xmlChar*)LASSO_WSUTIL1_HREF, (xmlChar*)LASSO_WSUTIL1_PREFIX); + xmlNewNsProp(ret, ns, (xmlChar*)"Id", (xmlChar*)LASSO_SOAP_BODY(node)->Id); + } + + return ret; } GType diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c index 8a01ef3b..1ee8908c 100644 --- a/lasso/xml/tools.c +++ b/lasso/xml/tools.c @@ -191,23 +191,23 @@ xmlSecKeyPtr lasso_get_public_key_from_pem_file(const char *file) { LassoPemFileType file_type; xmlSecKeyPtr pub_key = NULL; - file_type = lasso_get_pem_file_type(file); - switch (file_type) { - case LASSO_PEM_FILE_TYPE_UNKNOWN: + file_type = lasso_get_pem_file_type(file); + switch (file_type) { + case LASSO_PEM_FILE_TYPE_UNKNOWN: message(G_LOG_LEVEL_WARNING, "PEM file type unknown: %s", file); - break; /* with a warning ? */ - case LASSO_PEM_FILE_TYPE_CERT: - pub_key = lasso_get_public_key_from_pem_cert_file(file); - break; - case LASSO_PEM_FILE_TYPE_PUB_KEY: - pub_key = xmlSecCryptoAppKeyLoad(file, - xmlSecKeyDataFormatPem, NULL, NULL, NULL); - break; - case LASSO_PEM_FILE_TYPE_PRIVATE_KEY: + break; /* with a warning ? */ + case LASSO_PEM_FILE_TYPE_CERT: + pub_key = lasso_get_public_key_from_pem_cert_file(file); + break; + case LASSO_PEM_FILE_TYPE_PUB_KEY: + pub_key = xmlSecCryptoAppKeyLoad(file, + xmlSecKeyDataFormatPem, NULL, NULL, NULL); + break; + case LASSO_PEM_FILE_TYPE_PRIVATE_KEY: pub_key = lasso_get_public_key_from_private_key_file(file); - - break; /* with a warning ? */ - } + + break; /* with a warning ? */ + } return pub_key; } /** diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index fe493fb7..abb59005 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -137,9 +137,10 @@ static void xmlDetectSAX2(xmlParserCtxtPtr ctxt) { if (ctxt == NULL) return; #ifdef LIBXML_SAX1_ENABLED - if ((ctxt->sax) && (ctxt->sax->initialized == XML_SAX2_MAGIC) && - ((ctxt->sax->startElementNs != NULL) || - (ctxt->sax->endElementNs != NULL))) ctxt->sax2 = 1; + if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC) && + ((ctxt->sax->startElementNs != NULL) || + (ctxt->sax->endElementNs != NULL))) + ctxt->sax2 = 1; #else ctxt->sax2 = 1; #endif /* LIBXML_SAX1_ENABLED */ @@ -371,7 +372,7 @@ lasso_node_export_to_ecp_soap_response(LassoNode *node, const char *assertionCon **/ char* lasso_node_export_to_paos_request(LassoNode *node, const char *issuer, - const char *responseConsumerURL, const char *relay_state) + const char *responseConsumerURL, const char *relay_state) { xmlNode *envelope, *body, *header, *paos_request, *ecp_request, *ecp_relay_state, *message; xmlNs *soap_env_ns, *saml_ns, *ecp_ns; @@ -385,7 +386,7 @@ lasso_node_export_to_paos_request(LassoNode *node, const char *issuer, envelope = xmlNewNode(NULL, (xmlChar*)"Envelope"); soap_env_ns = xmlNewNs(envelope, - (xmlChar*)LASSO_SOAP_ENV_HREF, (xmlChar*)LASSO_SOAP_ENV_PREFIX); + (xmlChar*)LASSO_SOAP_ENV_HREF, (xmlChar*)LASSO_SOAP_ENV_PREFIX); xmlSetNs(envelope, soap_env_ns); header = xmlNewTextChild(envelope, NULL, (xmlChar*)"Header", NULL); @@ -393,7 +394,7 @@ lasso_node_export_to_paos_request(LassoNode *node, const char *issuer, /* PAOS request header block */ paos_request = xmlNewNode(NULL, (xmlChar*)"Request"); xmlSetNs(paos_request, xmlNewNs(paos_request, - (xmlChar*)LASSO_PAOS_HREF, (xmlChar*)LASSO_PAOS_PREFIX)); + (xmlChar*)LASSO_PAOS_HREF, (xmlChar*)LASSO_PAOS_PREFIX)); xmlSetProp(paos_request, (xmlChar*)"service", (xmlChar*)LASSO_ECP_HREF); xmlSetProp(paos_request, (xmlChar*)"responseConsumerURL", (const xmlChar*)responseConsumerURL); @@ -420,7 +421,7 @@ lasso_node_export_to_paos_request(LassoNode *node, const char *issuer, ecp_relay_state = xmlNewNode(NULL, (xmlChar*)"RelayState"); xmlNodeSetContent(ecp_relay_state, (const xmlChar*)relay_state); ecp_ns = xmlNewNs(ecp_relay_state, (xmlChar*)LASSO_ECP_HREF, - (xmlChar*)LASSO_ECP_PREFIX); + (xmlChar*)LASSO_ECP_PREFIX); xmlSetNs(ecp_relay_state, ecp_ns); xmlSetNsProp(ecp_relay_state, soap_env_ns, (xmlChar*)"mustUnderstand", (xmlChar*)"1"); @@ -732,7 +733,7 @@ exit: **/ LassoNode* lasso_node_decrypt(LassoSaml2EncryptedElement* encrypted_element, - xmlSecKey *encryption_private_key) + xmlSecKey *encryption_private_key) { xmlDocPtr doc = NULL; xmlDocPtr doc2 = NULL; @@ -980,7 +981,7 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) return 0; while (class && LASSO_IS_NODE_CLASS(class) && class->node_data) { - + for (t = xmlnode->children; t; t = t->next) { if (t->type == XML_TEXT_NODE) { for (snippet = class->node_data->snippets; @@ -1009,7 +1010,7 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) if (t->type != XML_ELEMENT_NODE) continue; - + for (snippet = class->node_data->snippets; snippet && snippet->name; snippet++) { void *tmp = NULL; @@ -1057,8 +1058,8 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) } else { /* failed to do sth with */ message(G_LOG_LEVEL_WARNING, - "Failed to do sth with %s", - t->name); + "Failed to do sth with %s", + t->name); } } else if (type == SNIPPET_LIST_CONTENT) { GList **location = value; @@ -1155,7 +1156,7 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) any_attribute = G_STRUCT_MEMBER_P(node, snippet_any_attribute->offset); if (*any_attribute == NULL) { *any_attribute = g_hash_table_new_full( - g_str_hash, g_str_equal, g_free, g_free); + g_str_hash, g_str_equal, g_free, g_free); } for (node_attr = xmlnode->properties; node_attr; node_attr = node_attr->next) { @@ -1171,7 +1172,7 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) if (known_attr == FALSE) { xmlChar *tmp = xmlGetProp(xmlnode, attr_name); g_hash_table_insert(*any_attribute, - g_strdup((char*)attr_name), g_strdup((char*)tmp)); + g_strdup((char*)attr_name), g_strdup((char*)tmp)); xmlFree(tmp); } } @@ -1209,7 +1210,7 @@ lasso_node_impl_get_xmlNode(LassoNode *node, gboolean lasso_dump) GList *list_ns = NULL, *list_classes = NULL, *t; LassoNode *value_node; struct XmlSnippet *version_snippet; - + if (class->node_data == NULL) return NULL; @@ -1331,17 +1332,17 @@ lasso_node_dispose(GObject *object) case SNIPPET_CONTENT: case SNIPPET_TEXT_CHILD: case SNIPPET_ATTRIBUTE: { - if (snippet->type & SNIPPET_ANY) { - g_hash_table_destroy(*value); - } else { - g_free(*value); - } - } break; + if (snippet->type & SNIPPET_ANY) { + g_hash_table_destroy(*value); + } else { + g_free(*value); + } + } break; case SNIPPET_SIGNATURE: - break; /* no real element here */ + break; /* no real element here */ default: - fprintf(stderr, "%d\n", type); - g_assert_not_reached(); + fprintf(stderr, "%d\n", type); + g_assert_not_reached(); } if (type != SNIPPET_SIGNATURE) { @@ -1396,17 +1397,17 @@ class_init(LassoNodeClass *class) static void base_class_finalize(LassoNodeClass *class) { - if (class->node_data) { - LassoNodeClassData *data = class->node_data; - - if (data->ns) { - xmlFreeNs(data->ns); - } - if (data->node_name) { - g_free(data->node_name); - } - g_free(class->node_data); - } + if (class->node_data) { + LassoNodeClassData *data = class->node_data; + + if (data->ns) { + xmlFreeNs(data->ns); + } + if (data->node_name) { + g_free(data->node_name); + } + g_free(class->node_data); + } } GType @@ -1592,15 +1593,15 @@ lasso_node_new_from_xmlNode(xmlNode *xmlnode) if (prefix == NULL) return NULL; - + if (strcmp(prefix, "Dst") == 0 && strcmp((char*)xmlnode->name, "Status") == 0) prefix = "Utility"; else if (strcmp(prefix, "Disco") == 0 && strcmp((char*)xmlnode->name, "Status") == 0) prefix = "Utility"; else if (strcmp(prefix, "Sa") == 0 && strcmp((char*)xmlnode->name, "Status") == 0) prefix = "Utility"; - else if (strcmp(prefix, "DgmeMspEd") == 0 && strcmp((char*)xmlnode->name, "Status") == 0) - prefix = "Utility"; + else if (strcmp(prefix, "DgmeMspEd") == 0 && strcmp((char*)xmlnode->name, "Status") == 0) + prefix = "Utility"; xsitype = xmlGetNsProp(xmlnode, (xmlChar*)"type", (xmlChar*)LASSO_XSI_HREF); if (xsitype) { @@ -1635,7 +1636,7 @@ lasso_node_new_from_xmlNode(xmlNode *xmlnode) } else { typename = g_strdup_printf("Lasso%s%s", prefix, node_name); } - + node = lasso_node_new_from_xmlNode_with_type(xmlnode, typename); g_free(typename); @@ -1847,7 +1848,7 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, snippet->type & SNIPPET_INTEGER) || snippet->type & SNIPPET_OPTIONAL)) continue; - + if (snippet->type & SNIPPET_OPTIONAL_NEG && GPOINTER_TO_INT(value) == -1) continue; @@ -1865,13 +1866,13 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, xmlAddChild(xmlnode, xmlNewText((xmlChar*)str)); break; case SNIPPET_NODE: - { - xmlNode *t2; - t2 = lasso_node_get_xmlNode(LASSO_NODE(value), lasso_dump); - if (snippet->class_name) - xmlNodeSetName(t2, (xmlChar*)snippet->name); - xmlAddChild(xmlnode, t2); - } break; + { + xmlNode *t2; + t2 = lasso_node_get_xmlNode(LASSO_NODE(value), lasso_dump); + if (snippet->class_name) + xmlNodeSetName(t2, (xmlChar*)snippet->name); + xmlAddChild(xmlnode, t2); + } break; case SNIPPET_CONTENT: xmlNewTextChild(xmlnode, NULL, (xmlChar*)snippet->name, (xmlChar*)str); @@ -2042,7 +2043,7 @@ find_path(LassoNode *node, char *path, LassoNode **value_node, struct XmlSnippet char *s, *t; struct XmlSnippet *tsnippet = NULL; LassoNode *tnode = node; - + s = path; while (s-1) { t = strchr(s, '/'); @@ -2070,7 +2071,7 @@ get_value_by_path(LassoNode *node, char *path, struct XmlSnippet *xml_snippet) { struct XmlSnippet *snippet; LassoNode *value_node; - + if (find_path(node, path, &value_node, &snippet) != TRUE) return NULL; @@ -2166,7 +2167,7 @@ set_value_at_path(LassoNode *node, char *path, char *query_value) struct XmlSnippet *snippet; LassoNode *value_node; void *value; - + if (find_path(node, path, &value_node, &snippet) != TRUE) return FALSE; @@ -2405,19 +2406,19 @@ sameNs(xmlNs *ns1, xmlNs *ns2) return (ns1 == NULL && ns2 == NULL) || ( ns1 && ns2 && ns1->prefix && ns2->prefix && strcmp((char*)ns1->prefix, (char*)ns2->prefix) == 0 && - strcmp((char*)ns1->href, (char*)ns2->href) == 0); + strcmp((char*)ns1->href, (char*)ns2->href) == 0); } static void xmlPropUseNsDef(xmlNs *ns, xmlNode *node) { - xmlAttr *attr; + xmlAttr *attr; - for (attr = node->properties; attr; attr = attr->next) { - if (sameNs(ns, attr->ns)) { - attr->ns = ns; - } - } + for (attr = node->properties; attr; attr = attr->next) { + if (sameNs(ns, attr->ns)) { + attr->ns = ns; + } + } } static void @@ -2427,7 +2428,7 @@ xmlUseNsDef(xmlNs *ns, xmlNode *node) xmlNs *ns2; xmlNs *ns3 = NULL; - xmlPropUseNsDef(ns, node); + xmlPropUseNsDef(ns, node); if (sameNs(ns, node->ns)) { node->ns = ns; } diff --git a/php/patch_swig_output.py b/php/patch_swig_output.py index 8ee8e21e..93304286 100755 --- a/php/patch_swig_output.py +++ b/php/patch_swig_output.py @@ -274,8 +274,8 @@ else: break segment = wrap[i:j] if not 'object_init_ex' in segment: - i = wrap.find(begin, i + len(segment)) - continue + i = wrap.find(begin, i + len(segment)) + continue x = segment.find('object_init_ex(return_value,') + len('object_init_ex(return_value,') y = segment.find(')', x) segment = '%s%s%s' % (segment[:x], 'get_node_info_with_swig(ty)->php', segment[y:]) diff --git a/website/convert-to-static.py b/website/convert-to-static.py index 6e0bdf62..4aaadcd1 100644 --- a/website/convert-to-static.py +++ b/website/convert-to-static.py @@ -260,8 +260,8 @@ for base, dirs, files in os.walk('web'): continue if ext not in ('.html', '.xml') or filename.startswith('doap.') or 'api-reference' in src_file: - if os.path.exists(dst_file): - os.unlink(dst_file) + if os.path.exists(dst_file): + os.unlink(dst_file) os.link(src_file, dst_file) continue |