diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2006-12-28 10:56:13 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2006-12-28 10:56:13 +0000 |
| commit | d5c4e974ebff28e79c5aeb4f180899e2a61b7ae1 (patch) | |
| tree | d762a059d60e8110a5bc2f1a68f6d4c6fa36ddbd /lasso/xml | |
| parent | 7a78af3361d314541891fc30c4787a9d756844f9 (diff) | |
| download | lasso-d5c4e974ebff28e79c5aeb4f180899e2a61b7ae1.tar.gz lasso-d5c4e974ebff28e79c5aeb4f180899e2a61b7ae1.tar.xz lasso-d5c4e974ebff28e79c5aeb4f180899e2a61b7ae1.zip | |
coding style improvements
Diffstat (limited to 'lasso/xml')
| -rw-r--r-- | lasso/xml/lib_authentication_statement.c | 5 | ||||
| -rw-r--r-- | lasso/xml/tools.c | 4 | ||||
| -rw-r--r-- | lasso/xml/xml.c | 11 |
3 files changed, 11 insertions, 9 deletions
diff --git a/lasso/xml/lib_authentication_statement.c b/lasso/xml/lib_authentication_statement.c index cf5439ad..d08ffd52 100644 --- a/lasso/xml/lib_authentication_statement.c +++ b/lasso/xml/lib_authentication_statement.c @@ -156,10 +156,11 @@ lasso_lib_authentication_statement_new_full(const char *authenticationMethod, statement = g_object_new(LASSO_TYPE_LIB_AUTHENTICATION_STATEMENT, NULL); statement->AuthenticationMethod = g_strdup(authenticationMethod); - if (authenticationInstant == NULL) + if (authenticationInstant == NULL) { time = lasso_get_current_time(); - else + } else { time = g_strdup(authenticationInstant); + } statement->AuthenticationInstant = time; diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c index b301ca69..a7b0717a 100644 --- a/lasso/xml/tools.c +++ b/lasso/xml/tools.c @@ -369,8 +369,7 @@ lasso_query_sign(char *query, LassoSignatureMethod sign_method, const char *priv /* sign digest message */ status = RSA_sign(NID_sha1, (unsigned char*)digest, 20, sigret, &siglen, rsa); RSA_free(rsa); - } - else if (sign_method == LASSO_SIGNATURE_METHOD_DSA_SHA1) { + } else if (sign_method == LASSO_SIGNATURE_METHOD_DSA_SHA1) { dsa = PEM_read_bio_DSAPrivateKey(bio, NULL, NULL, NULL); if (dsa == NULL) { goto done; @@ -379,6 +378,7 @@ lasso_query_sign(char *query, LassoSignatureMethod sign_method, const char *priv status = DSA_sign(NID_sha1, (unsigned char*)digest, 20, sigret, &siglen, dsa); DSA_free(dsa); } + if (status == 0) { goto done; } diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index fc99ec9f..de88a712 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -350,10 +350,11 @@ lasso_node_export_to_query(LassoNode *node, g_return_val_if_fail (LASSO_IS_NODE(node), NULL); unsigned_query = lasso_node_build_query(node); - if (private_key_file) + if (private_key_file) { query = lasso_query_sign(unsigned_query, sign_method, private_key_file); - else + } else { query = g_strdup(unsigned_query); + } g_free(unsigned_query); return query; @@ -866,11 +867,11 @@ lasso_node_impl_init_from_xml(LassoNode *node, xmlNode *xmlnode) if (t2) tmp = lasso_node_new_from_xmlNode_with_type(t2, snippet->class_name); - } else if (type == SNIPPET_CONTENT) + } else if (type == SNIPPET_CONTENT) { tmp = xmlNodeGetContent(t); - else if (type == SNIPPET_NAME_IDENTIFIER) + } else if (type == SNIPPET_NAME_IDENTIFIER) { tmp = lasso_saml_name_identifier_new_from_xmlNode(t); - else if (type == SNIPPET_LIST_NODES) { + } else if (type == SNIPPET_LIST_NODES) { GList **location = value; LassoNode *n = lasso_node_new_from_xmlNode_with_type(t, snippet->class_name); |
