summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@entrouvert.com>2004-09-17 09:43:03 +0000
committerFrederic Peters <fpeters@entrouvert.com>2004-09-17 09:43:03 +0000
commit6dda2ff2ab6e5e42a1c97e4ac941f84804c02b05 (patch)
treef9e1559920e368a31f14cca42d8c51a484564219
parent40940b95aaefd87f9af96439669cc6cb184d69ef (diff)
use memcpy to copy memory; also fixed type of samlArt.
-rw-r--r--lasso/id-ff/login.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/lasso/id-ff/login.c b/lasso/id-ff/login.c
index a782bd4b..049a4d1e 100644
--- a/lasso/id-ff/login.c
+++ b/lasso/id-ff/login.c
@@ -435,9 +435,8 @@ lasso_login_build_artifact_msg(LassoLogin *login,
LassoFederation *federation = NULL;
LassoProvider *remote_provider;
gchar *url;
- xmlChar samlArt[42+1], *b64_samlArt, *relayState;
+ xmlSecByte samlArt[42], *b64_samlArt, *relayState;
xmlChar *assertionHandle, *identityProviderSuccinctID;
- gint i;
/* nico */
LassoNodeClass *assertion_class;
@@ -507,17 +506,13 @@ lasso_login_build_artifact_msg(LassoLogin *login,
identityProviderSuccinctID = lasso_sha1(LASSO_PROFILE(login)->server->providerID);
assertionHandle = lasso_build_random_sequence(20);
- /* g_sprintf(samlArt, "%c%c%s%s", 0, 3, identityProviderSuccinctID, assertionHandle); */
- g_sprintf(samlArt, "%c%c", 0, 3); /* ByteCode */
- for(i=0;i<20;i++) {
- samlArt[i+2] = identityProviderSuccinctID[i];
- }
- for(i=0;i<20;i++) {
- samlArt[i+22] = assertionHandle[i];
- }
+ memcpy(samlArt, "\000\003", 2); /* byte code */
+ memcpy(samlArt+2, identityProviderSuccinctID, 20);
+ memcpy(samlArt+22, assertionHandle, 20);
+
xmlFree(assertionHandle);
xmlFree(identityProviderSuccinctID);
- b64_samlArt = xmlSecBase64Encode((const xmlSecByte *)samlArt, 42, 0);
+ b64_samlArt = xmlSecBase64Encode(samlArt, 42, 0);
relayState = lasso_node_get_child_content(LASSO_PROFILE(login)->request,
"RelayState", NULL, NULL);