[saml2] use new encryption structure instead for internal field in LassoSaml2Assertion

This commit is contained in:
Benjamin Dauvergne 2010-12-14 01:57:09 +01:00
parent ec5ec161f7
commit 355df68dfe
2 changed files with 8 additions and 9 deletions

View File

@ -860,11 +860,9 @@ lasso_saml20_login_build_assertion(LassoLogin *login,
/* Save encryption material in assertion private datas to be able to encrypt later */
if (do_encrypt_assertion) {
assertion->encryption_activated = TRUE;
lasso_assign_string(assertion->encryption_public_key_str,
provider->private_data->encryption_public_key_str);
assertion->encryption_sym_key_type =
lasso_provider_get_encryption_sym_key_type(provider);
lasso_node_set_encryption((LassoNode*)assertion,
lasso_provider_get_encryption_public_key(provider),
lasso_provider_get_encryption_sym_key_type(provider));
}
/* store assertion in session object */

View File

@ -589,16 +589,17 @@ LassoNode*
lasso_assertion_encrypt(LassoSaml2Assertion *assertion, char *recipient)
{
xmlSecKey *encryption_public_key = NULL;
LassoEncryptionSymKeyType encryption_sym_key_type = 0;
LassoNode *ret = NULL;
if (assertion->encryption_activated == FALSE ||
assertion->encryption_public_key_str == NULL) {
lasso_node_get_encryption((LassoNode*)assertion, &encryption_public_key,
&encryption_sym_key_type);
if (! encryption_public_key) {
return NULL;
}
encryption_public_key = lasso_xmlsec_load_private_key(assertion->encryption_public_key_str, NULL);
ret = LASSO_NODE(lasso_node_encrypt(LASSO_NODE(assertion),
encryption_public_key, assertion->encryption_sym_key_type, recipient));
encryption_public_key, encryption_sym_key_type, recipient));
lasso_release_sec_key(encryption_public_key);
return ret;