summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-09-22 14:37:11 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-09-22 14:37:11 +0000
commita952e642e05288e24760e0106a2022d4fd941750 (patch)
tree379e90c49fd1d81378ab68edd765ef822068408b
parent4eedccfa77742a38e5a5c00df58a4b2368b83634 (diff)
downloadlasso-a952e642e05288e24760e0106a2022d4fd941750.tar.gz
lasso-a952e642e05288e24760e0106a2022d4fd941750.tar.xz
lasso-a952e642e05288e24760e0106a2022d4fd941750.zip
forgotten commit; /insert const keyword explanation here/
-rw-r--r--lasso/Attic/protocols/artifact.c6
-rw-r--r--lasso/Attic/protocols/authn_request.c4
-rw-r--r--lasso/Attic/protocols/authn_response.c4
-rw-r--r--lasso/Attic/protocols/elements/assertion.c6
-rw-r--r--lasso/Attic/protocols/elements/authentication_statement.c2
-rw-r--r--lasso/Attic/protocols/federation_termination_notification.c4
-rw-r--r--lasso/Attic/protocols/logout_request.c6
-rw-r--r--lasso/Attic/protocols/logout_response.c4
-rw-r--r--lasso/Attic/protocols/name_identifier_mapping_request.c4
-rw-r--r--lasso/Attic/protocols/name_identifier_mapping_response.c4
-rw-r--r--lasso/Attic/protocols/register_name_identifier_request.c4
-rw-r--r--lasso/Attic/protocols/register_name_identifier_response.c4
-rw-r--r--lasso/Attic/protocols/request.c4
-rw-r--r--lasso/Attic/protocols/response.c4
-rw-r--r--lasso/xml/errors.c1
-rw-r--r--lasso/xml/tools.c13
-rw-r--r--lasso/xml/xml.c3
17 files changed, 35 insertions, 42 deletions
diff --git a/lasso/Attic/protocols/artifact.c b/lasso/Attic/protocols/artifact.c
index 0cb78154..2a9c9881 100644
--- a/lasso/Attic/protocols/artifact.c
+++ b/lasso/Attic/protocols/artifact.c
@@ -41,7 +41,7 @@ lasso_artifact_split_samlArt(gchar *b64_samlArt,
gint i, j, byte_code = 0;
/* decode samlArt */
- i = xmlSecBase64Decode((const xmlChar *)b64_samlArt, samlArt, 42+1);
+ i = xmlSecBase64Decode(b64_samlArt, samlArt, 42+1);
if (i < 0 || i > 42) {
return -1;
}
@@ -289,7 +289,7 @@ lasso_artifact_new(gchar *samlArt,
class = LASSO_NODE_GET_CLASS(artifact);
class->new_child(artifact, "SAMLart", samlArt, FALSE);
class->new_child(artifact, "ByteCode", byteCode, FALSE);
- b64_identityProviderSuccinctID = xmlSecBase64Encode((const xmlSecByte *)identityProviderSuccinctID,
+ b64_identityProviderSuccinctID = xmlSecBase64Encode(identityProviderSuccinctID,
20, 0);
class->new_child(artifact, "B64IdentityProviderSuccinctID",
b64_identityProviderSuccinctID, FALSE);
@@ -351,7 +351,7 @@ lasso_artifact_new_from_lares(const xmlChar *lares,
g_return_val_if_fail(lares != NULL, NULL);
- byteCode = (gchar *) g_new0(gchar, 5+1);
+ byteCode = g_new0(gchar, 5+1);
identityProviderSuccinctID = (gchar *) g_new0(gchar, 20);
assertionHandle = (gchar *) g_new0(gchar, 20+1);
ret = lasso_artifact_split_samlArt((gchar*)lares, byteCode,
diff --git a/lasso/Attic/protocols/authn_request.c b/lasso/Attic/protocols/authn_request.c
index d755f9ef..c5e3585d 100644
--- a/lasso/Attic/protocols/authn_request.c
+++ b/lasso/Attic/protocols/authn_request.c
@@ -164,7 +164,7 @@ lasso_authn_request_new(const xmlChar *providerID,
/* RequestID */
id = lasso_build_unique_id(32);
lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
@@ -175,7 +175,7 @@ lasso_authn_request_new(const xmlChar *providerID,
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_request_abstract_set_issueInstant(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* Signature template */
if (sign_type != lassoSignatureTypeNone) {
diff --git a/lasso/Attic/protocols/authn_response.c b/lasso/Attic/protocols/authn_response.c
index 3c915f00..75d5ba12 100644
--- a/lasso/Attic/protocols/authn_response.c
+++ b/lasso/Attic/protocols/authn_response.c
@@ -129,7 +129,7 @@ lasso_authn_response_new(char *providerID,
/* ResponseID */
id = lasso_build_unique_id(32);
lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
@@ -143,7 +143,7 @@ lasso_authn_response_new(char *providerID,
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_response_abstract_set_issueInstant(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* ProviderID */
diff --git a/lasso/Attic/protocols/elements/assertion.c b/lasso/Attic/protocols/elements/assertion.c
index 027559af..b158e97c 100644
--- a/lasso/Attic/protocols/elements/assertion.c
+++ b/lasso/Attic/protocols/elements/assertion.c
@@ -80,16 +80,14 @@ lasso_assertion_new(const xmlChar *issuer,
NULL));
id = lasso_build_unique_id(32);
- lasso_saml_assertion_set_assertionID(LASSO_SAML_ASSERTION(assertion),
- (const xmlChar *)id);
+ lasso_saml_assertion_set_assertionID(LASSO_SAML_ASSERTION(assertion), id);
xmlFree(id);
lasso_saml_assertion_set_majorVersion(LASSO_SAML_ASSERTION(assertion),
lassoLibMajorVersion);
lasso_saml_assertion_set_minorVersion(LASSO_SAML_ASSERTION(assertion),
lassoLibMinorVersion);
time = lasso_get_current_time();
- lasso_saml_assertion_set_issueInstant(LASSO_SAML_ASSERTION(assertion),
- (const xmlChar *)time);
+ lasso_saml_assertion_set_issueInstant(LASSO_SAML_ASSERTION(assertion), time);
xmlFree(time);
lasso_saml_assertion_set_issuer(LASSO_SAML_ASSERTION(assertion), issuer);
diff --git a/lasso/Attic/protocols/elements/authentication_statement.c b/lasso/Attic/protocols/elements/authentication_statement.c
index 22b814d7..b4064ce5 100644
--- a/lasso/Attic/protocols/elements/authentication_statement.c
+++ b/lasso/Attic/protocols/elements/authentication_statement.c
@@ -88,7 +88,7 @@ lasso_authentication_statement_new(const xmlChar *authenticationMethod
authenticationMethod);
time = lasso_get_current_time();
lasso_saml_authentication_statement_set_authenticationInstant(LASSO_SAML_AUTHENTICATION_STATEMENT(statement),
- (const xmlChar *)time);
+ time);
xmlFree(time);
lasso_lib_authentication_statement_set_reauthenticateOnOrAfter(LASSO_LIB_AUTHENTICATION_STATEMENT(statement),
reauthenticateOnOrAfter);
diff --git a/lasso/Attic/protocols/federation_termination_notification.c b/lasso/Attic/protocols/federation_termination_notification.c
index fa14189a..0d66c955 100644
--- a/lasso/Attic/protocols/federation_termination_notification.c
+++ b/lasso/Attic/protocols/federation_termination_notification.c
@@ -84,7 +84,7 @@ lasso_federation_termination_notification_new(const xmlChar *providerID,
/* RequestID */
id = lasso_build_unique_id(32);
lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
@@ -95,7 +95,7 @@ lasso_federation_termination_notification_new(const xmlChar *providerID,
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_request_abstract_set_issueInstant(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* set the signature template */
diff --git a/lasso/Attic/protocols/logout_request.c b/lasso/Attic/protocols/logout_request.c
index bb7a9db5..8640c8e8 100644
--- a/lasso/Attic/protocols/logout_request.c
+++ b/lasso/Attic/protocols/logout_request.c
@@ -85,7 +85,7 @@ lasso_logout_request_new(gchar *providerID,
/* RequestID */
request_id = lasso_build_unique_id(32);
lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)request_id);
+ request_id);
/* MajorVersion */
lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
lassoLibMajorVersion);
@@ -95,7 +95,7 @@ lasso_logout_request_new(gchar *providerID,
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_request_abstract_set_issueInstant(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* set the signature template */
@@ -217,7 +217,7 @@ lasso_logout_request_new_from_query(gchar *query)
/* SessionIndex */
str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "SessionIndex"), 0);
if (str != NULL)
- lasso_lib_logout_request_set_sessionIndex(LASSO_LIB_LOGOUT_REQUEST(request), (const xmlChar *)str);
+ lasso_lib_logout_request_set_sessionIndex(LASSO_LIB_LOGOUT_REQUEST(request), str);
/* consent */
str = lasso_g_ptr_array_index((GPtrArray *)g_datalist_get_data(&gd, "consent"), 0);
diff --git a/lasso/Attic/protocols/logout_response.c b/lasso/Attic/protocols/logout_response.c
index d33e5486..7158b61d 100644
--- a/lasso/Attic/protocols/logout_response.c
+++ b/lasso/Attic/protocols/logout_response.c
@@ -110,7 +110,7 @@ lasso_logout_response_new(gchar *providerID,
/* ResponseID */
id = lasso_build_unique_id(32);
lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
@@ -121,7 +121,7 @@ lasso_logout_response_new(gchar *providerID,
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_response_abstract_set_issueInstant(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* set the signature template */
diff --git a/lasso/Attic/protocols/name_identifier_mapping_request.c b/lasso/Attic/protocols/name_identifier_mapping_request.c
index ae2b7457..6271f5da 100644
--- a/lasso/Attic/protocols/name_identifier_mapping_request.c
+++ b/lasso/Attic/protocols/name_identifier_mapping_request.c
@@ -87,7 +87,7 @@ lasso_name_identifier_mapping_request_new(const xmlChar *providerID,
/* RequestID */
id = lasso_build_unique_id(32);
lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
@@ -98,7 +98,7 @@ lasso_name_identifier_mapping_request_new(const xmlChar *providerID,
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_request_abstract_set_issueInstant(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* ProviderID */
lasso_lib_name_identifier_mapping_request_set_providerID(LASSO_LIB_NAME_IDENTIFIER_MAPPING_REQUEST(request),
diff --git a/lasso/Attic/protocols/name_identifier_mapping_response.c b/lasso/Attic/protocols/name_identifier_mapping_response.c
index 754fc2eb..749f76e6 100644
--- a/lasso/Attic/protocols/name_identifier_mapping_response.c
+++ b/lasso/Attic/protocols/name_identifier_mapping_response.c
@@ -82,7 +82,7 @@ lasso_name_identifier_mapping_response_new(const xmlChar *providerID,
/* ResponseID */
id = lasso_build_unique_id(32);
lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
@@ -93,7 +93,7 @@ lasso_name_identifier_mapping_response_new(const xmlChar *providerID,
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_response_abstract_set_issueInstant(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* ProviderID */
lasso_lib_name_identifier_mapping_response_set_providerID(LASSO_LIB_NAME_IDENTIFIER_MAPPING_RESPONSE(response),
diff --git a/lasso/Attic/protocols/register_name_identifier_request.c b/lasso/Attic/protocols/register_name_identifier_request.c
index ddd1b861..6e03da38 100644
--- a/lasso/Attic/protocols/register_name_identifier_request.c
+++ b/lasso/Attic/protocols/register_name_identifier_request.c
@@ -116,7 +116,7 @@ lasso_register_name_identifier_request_new(const xmlChar *providerID,
/* RequestID */
id = lasso_build_unique_id(32);
lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
@@ -127,7 +127,7 @@ lasso_register_name_identifier_request_new(const xmlChar *providerID,
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_request_abstract_set_issueInstant(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* ProviderID */
lasso_lib_register_name_identifier_request_set_providerID(LASSO_LIB_REGISTER_NAME_IDENTIFIER_REQUEST(request),
diff --git a/lasso/Attic/protocols/register_name_identifier_response.c b/lasso/Attic/protocols/register_name_identifier_response.c
index 530523ff..caa19ade 100644
--- a/lasso/Attic/protocols/register_name_identifier_response.c
+++ b/lasso/Attic/protocols/register_name_identifier_response.c
@@ -221,7 +221,7 @@ lasso_register_name_identifier_response_new(gchar *providerID,
/* ResponseID */
id = lasso_build_unique_id(32);
lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
@@ -232,7 +232,7 @@ lasso_register_name_identifier_response_new(gchar *providerID,
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_response_abstract_set_issueInstant(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* ProviderID */
lasso_lib_status_response_set_providerID(LASSO_LIB_STATUS_RESPONSE(response),
diff --git a/lasso/Attic/protocols/request.c b/lasso/Attic/protocols/request.c
index 54250afa..8c1d6692 100644
--- a/lasso/Attic/protocols/request.c
+++ b/lasso/Attic/protocols/request.c
@@ -83,7 +83,7 @@ lasso_request_new(const xmlChar *assertionArtifact)
/* RequestID */
id = lasso_build_unique_id(32);
lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
@@ -94,7 +94,7 @@ lasso_request_new(const xmlChar *assertionArtifact)
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_request_abstract_set_issueInstant(LASSO_SAMLP_REQUEST_ABSTRACT(request),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* Signature template with X509
diff --git a/lasso/Attic/protocols/response.c b/lasso/Attic/protocols/response.c
index 8bc014f0..115a65a1 100644
--- a/lasso/Attic/protocols/response.c
+++ b/lasso/Attic/protocols/response.c
@@ -83,7 +83,7 @@ lasso_response_new()
/* ResponseID */
id = lasso_build_unique_id(32);
lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)id);
+ id);
xmlFree(id);
/* MajorVersion */
lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
@@ -94,7 +94,7 @@ lasso_response_new()
/* IssueInstant */
time = lasso_get_current_time();
lasso_samlp_response_abstract_set_issueInstant(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
- (const xmlChar *)time);
+ time);
xmlFree(time);
/* Add Status */
diff --git a/lasso/xml/errors.c b/lasso/xml/errors.c
index 0351cc88..8a3d5dd7 100644
--- a/lasso/xml/errors.c
+++ b/lasso/xml/errors.c
@@ -26,6 +26,7 @@
#include "errors.h"
#include <stdio.h>
#include <string.h>
+#include <glib/gstrfuncs.h>
const char*
lasso_strerror(int error_code)
diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c
index a2445a25..de0a2c9e 100644
--- a/lasso/xml/tools.c
+++ b/lasso/xml/tools.c
@@ -158,7 +158,7 @@ lasso_get_current_time()
g_get_current_time(&time_val);
tm = localtime(&(time_val.tv_sec));
- strftime((char *)ret, 21, "%Y-%m-%dT%H:%M:%SZ", tm);
+ strftime(ret, 21, "%Y-%m-%dT%H:%M:%SZ", tm);
return ret;
}
@@ -405,10 +405,9 @@ lasso_query_verify_signature(const gchar *query,
/* set SignatureValue content */
str_unescaped = lasso_str_unescape(str_split[1]);
xmlNodeSetContent(sigValNode, str_unescaped);
- g_free(str_unescaped);
+ xmlFree(str_unescaped);
g_strfreev(str_split);
- /*xmlDocDump(stdout, doc);*/
/* find start node */
sigNode = xmlSecFindNode(xmlDocGetRootElement(doc),
@@ -491,7 +490,7 @@ xmlChar *
lasso_str_escape(xmlChar *str)
{
/* value returned must be xmlFree() */
- return xmlURIEscapeStr((const xmlChar *)str, NULL);
+ return xmlURIEscapeStr(str, NULL);
}
xmlChar *
@@ -647,9 +646,5 @@ lasso_str_sign(xmlChar *str,
xmlChar *
lasso_str_unescape(xmlChar *str)
{
- xmlChar *ret;
-
- ret = g_malloc(strlen(str) * 2); /* XXX why *2? strlen(str) should be enough */
- xmlURIUnescapeString((const char *)str, 0, ret);
- return ret;
+ return xmlURIUnescapeString(str, 0, NULL);
}
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index e370ba96..4ff5cfd0 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -773,8 +773,7 @@ lasso_node_impl_export_to_base64(LassoNode *node)
gchar *buffer, *ret;
buffer = lasso_node_impl_dump(node, "utf-8", 0);
- ret = xmlSecBase64Encode((const xmlSecByte *) buffer,
- (xmlSecSize)strlen((const char *)buffer), 0);
+ ret = xmlSecBase64Encode(buffer, strlen(buffer), 0);
g_free(buffer);
buffer = NULL;