summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Laniel <dlaniel@entrouvert.com>2006-11-21 17:16:29 +0000
committerDamien Laniel <dlaniel@entrouvert.com>2006-11-21 17:16:29 +0000
commit84d4c960be871c9d175eb7d699f2269c47f6bdf3 (patch)
tree7dfe430aa9b75c7251a9f355cc460c760cf0d626
parent9f4d57b3e8aff190ad415d342aff1c0c201b6802 (diff)
Fixed -Wall warnings and replaced a LASSO_ERROR_UNDEFINED
-rw-r--r--lasso/saml-2.0/ecp.c19
-rw-r--r--lasso/saml-2.0/login.c2
-rw-r--r--lasso/saml-2.0/provider.c8
-rw-r--r--lasso/saml-2.0/server.c2
-rw-r--r--lasso/xml/tools.c11
-rw-r--r--lasso/xml/xml.c7
6 files changed, 28 insertions, 21 deletions
diff --git a/lasso/saml-2.0/ecp.c b/lasso/saml-2.0/ecp.c
index 10f1128d..e451e4bf 100644
--- a/lasso/saml-2.0/ecp.c
+++ b/lasso/saml-2.0/ecp.c
@@ -98,7 +98,7 @@ lasso_ecp_process_authn_request_msg(LassoEcp *ecp, const char *authn_request_msg
xpathObj = xmlXPathEvalExpression((xmlChar*)"//ecp:RelayState", xpathCtx);
if (xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr) {
xmlnode = xpathObj->nodesetval->nodeTab[0];
- LASSO_PROFILE(ecp)->msg_relayState = xmlNodeGetContent(xmlnode);
+ LASSO_PROFILE(ecp)->msg_relayState = (char *)xmlNodeGetContent(xmlnode);
}
xmlXPathRegisterNs(xpathCtx, (xmlChar*)"s", (xmlChar*)LASSO_SOAP_ENV_HREF);
@@ -143,8 +143,8 @@ lasso_ecp_process_response_msg(LassoEcp *ecp, const char *response_msg)
xmlXPathRegisterNs(xpathCtx, (xmlChar*)"ecp", (xmlChar*)LASSO_ECP_HREF);
xpathObj = xmlXPathEvalExpression((xmlChar*)"//ecp:Response", xpathCtx);
if (xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr) {
- ecp->assertionConsumerURL = \
- xmlGetProp(xpathObj->nodesetval->nodeTab[0], "AssertionConsumerURL");
+ ecp->assertionConsumerURL = (char*)xmlGetProp(
+ xpathObj->nodesetval->nodeTab[0], (xmlChar*)"AssertionConsumerURL");
}
xmlXPathFreeContext(xpathCtx);
@@ -165,19 +165,22 @@ lasso_ecp_process_response_msg(LassoEcp *ecp, const char *response_msg)
paos_response = xmlNewNode(NULL, (xmlChar*)"Response");
xmlSetNs(paos_response, xmlNewNs(paos_response,
(xmlChar*)LASSO_PAOS_HREF, (xmlChar*)LASSO_PAOS_PREFIX));
- xmlSetNsProp(paos_response, soap_env_ns, "mustUnderstand", "1");
- xmlSetNsProp(paos_response, soap_env_ns, "actor", LASSO_SOAP_ENV_ACTOR);
+ xmlSetNsProp(paos_response, soap_env_ns, (xmlChar*)"mustUnderstand", (xmlChar *)"1");
+ xmlSetNsProp(paos_response, soap_env_ns, (xmlChar*)"actor",
+ (xmlChar*)LASSO_SOAP_ENV_ACTOR);
xmlAddChild(header, paos_response);
/* ECP relay state block */
if (LASSO_PROFILE(ecp)->msg_relayState) {
ecp_relay_state = xmlNewNode(NULL, (xmlChar*)"RelayState");
- xmlNodeSetContent(ecp_relay_state, LASSO_PROFILE(ecp)->msg_relayState);
+ xmlNodeSetContent(ecp_relay_state, (xmlChar*)LASSO_PROFILE(ecp)->msg_relayState);
ecp_ns = xmlNewNs(ecp_relay_state, (xmlChar*)LASSO_ECP_HREF,
(xmlChar*)LASSO_ECP_PREFIX);
xmlSetNs(ecp_relay_state, ecp_ns);
- xmlSetNsProp(ecp_relay_state, soap_env_ns, "mustUnderstand", "1");
- xmlSetNsProp(ecp_relay_state, soap_env_ns, "actor", LASSO_SOAP_ENV_ACTOR);
+ xmlSetNsProp(ecp_relay_state, soap_env_ns, (xmlChar*)"mustUnderstand",
+ (xmlChar*)"1");
+ xmlSetNsProp(ecp_relay_state, soap_env_ns, (xmlChar*)"actor",
+ (xmlChar*)LASSO_SOAP_ENV_ACTOR);
xmlAddChild(header, ecp_relay_state);
}
diff --git a/lasso/saml-2.0/login.c b/lasso/saml-2.0/login.c
index ebd82af5..6a44cc66 100644
--- a/lasso/saml-2.0/login.c
+++ b/lasso/saml-2.0/login.c
@@ -37,6 +37,8 @@
#include <lasso/id-ff/sessionprivate.h>
#include <lasso/id-ff/loginprivate.h>
+#include <lasso/xml/xml_enc.h>
+
#include <lasso/xml/saml-2.0/samlp2_authn_request.h>
#include <lasso/xml/saml-2.0/samlp2_response.h>
#include <lasso/xml/saml-2.0/saml2_assertion.h>
diff --git a/lasso/saml-2.0/provider.c b/lasso/saml-2.0/provider.c
index b3639016..74eead48 100644
--- a/lasso/saml-2.0/provider.c
+++ b/lasso/saml-2.0/provider.c
@@ -282,13 +282,11 @@ lasso_saml20_provider_get_assertion_consumer_service_url_by_binding(LassoProvide
{
GHashTable *descriptor;
GList *l = NULL, *r = NULL;
- char *sid;
char *name;
char *binding_s;
- const char *possible_bindings[] = {
- "HTTP-Artifact", "HTTP-Post", "HTTP-POST", "SOAP", NULL
- };
- int i;
+/* const char *possible_bindings[] = { */
+/* "HTTP-Artifact", "HTTP-Post", "HTTP-POST", "SOAP", NULL */
+/* }; */
int lname;
descriptor = provider->private_data->SPDescriptor;
diff --git a/lasso/saml-2.0/server.c b/lasso/saml-2.0/server.c
index 9ac2d4e9..7b71deeb 100644
--- a/lasso/saml-2.0/server.c
+++ b/lasso/saml-2.0/server.c
@@ -56,7 +56,7 @@ lasso_saml20_server_load_affiliation(LassoServer *server, xmlDoc *doc, xmlNode *
for (t = t->children; t; t = t->next) {
if (t->type == XML_ELEMENT_NODE &&
strcmp((char*)t->name, "AffiliateMember") == 0) {
- member_id = xmlNodeGetContent(t);
+ member_id = (char*)xmlNodeGetContent(t);
provider = lasso_server_get_provider(server, member_id);
if (provider == NULL) {
message(G_LOG_LEVEL_WARNING,
diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c
index b4fbf71b..9cab894a 100644
--- a/lasso/xml/tools.c
+++ b/lasso/xml/tools.c
@@ -136,13 +136,14 @@ lasso_get_pem_file_type(const char *pem_file)
EVP_PKEY *pkey;
X509 *cert;
LassoPemFileType type = LASSO_PEM_FILE_TYPE_UNKNOWN;
+ int reset_success;
g_return_val_if_fail(pem_file != NULL, LASSO_PARAM_ERROR_INVALID_VALUE);
bio = BIO_new_file(pem_file, "rb");
if (bio == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Failed to open %s pem file", pem_file);
- return LASSO_ERROR_UNDEFINED;
+ return LASSO_PEM_FILE_TYPE_UNKNOWN;
}
pkey = PEM_read_bio_PUBKEY(bio, NULL, NULL, NULL);
@@ -150,13 +151,17 @@ lasso_get_pem_file_type(const char *pem_file)
type = LASSO_PEM_FILE_TYPE_PUB_KEY;
EVP_PKEY_free(pkey);
} else {
- BIO_reset(bio);
+ reset_success = BIO_reset(bio);
+ if (reset_success == -1)
+ return LASSO_PEM_FILE_TYPE_UNKNOWN;
pkey = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
if (pkey != NULL) {
type = LASSO_PEM_FILE_TYPE_PRIVATE_KEY;
EVP_PKEY_free(pkey);
} else {
- BIO_reset(bio);
+ reset_success = BIO_reset(bio);
+ if (reset_success == -1)
+ return LASSO_PEM_FILE_TYPE_UNKNOWN;
cert = PEM_read_bio_X509(bio, NULL, NULL, NULL);
if (cert != NULL) {
type = LASSO_PEM_FILE_TYPE_CERT;
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index 33c3c29b..abbcf98e 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -556,7 +556,6 @@ lasso_node_decrypt(LassoSaml2EncryptedElement* encrypted_element,
LassoNode *decrypted_node;
xmlNodePtr encrypted_data_node = NULL;
xmlNodePtr encrypted_key_node = NULL;
- GList *encrypted_key_list = NULL;
xmlNodePtr encryption_method_node = NULL;
char *algorithm;
xmlSecKeyDataId key_type;
@@ -578,7 +577,7 @@ lasso_node_decrypt(LassoSaml2EncryptedElement* encrypted_element,
message(G_LOG_LEVEL_WARNING, "No EncryptionMethod node in EncryptedData");
return NULL;
}
- algorithm = (char *)xmlGetNoNsProp(encryption_method_node, "Algorithm");
+ algorithm = (char*)xmlGetNoNsProp(encryption_method_node, (xmlChar *)"Algorithm");
if (algorithm == NULL) {
message(G_LOG_LEVEL_WARNING, "No EncryptionMethod");
return NULL;
@@ -598,8 +597,8 @@ lasso_node_decrypt(LassoSaml2EncryptedElement* encrypted_element,
return NULL;
}
for (i = encrypted_element->EncryptedKey; i->data != NULL; i = i->next) {
- if (strcmp(((xmlNode *)(i->data))->name, "EncryptedKey") == 0) {
- encrypted_key_node = (xmlNode *)(i->data);
+ if (strcmp((char*)((xmlNode*)i->data)->name, "EncryptedKey") == 0) {
+ encrypted_key_node = (xmlNode*)(i->data);
break;
}
}