Commit Graph

98 Commits

Author SHA1 Message Date
Benjamin Dauvergne ab7c12e163 saml-2.0: fix leak of message_id in lasso_profile_saml20_build_paos_request_msg 2015-11-24 19:22:18 +01:00
John Dennis 9a2f8d404e Implement PAOS request and response messages
Re-implement lasso_profile_saml20_build_paos_request_msg() and
lasso_saml20_login_process_paos_response_msg() to use the
functionality introduced by earlier patches and to assure they are
functionally complete.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis bdecdc248c ECP and PAOS special handling
ECP does not require an SP to know the remote IdP provider. Existing
code made the assumption the remote provider always was
necessary. Determination and setting of the remote consumer URL is
different in the presence of ECP. Rework the logic to reflect
differing requirements.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
John Dennis 904e23d7ff Enhance process soap response to include processing soap headers
The existing lasso_saml20_profile_process_soap_response() assumed
there were no SOAP headers (prior to ECP none of the SOAP messages
contained headers). A new function
lasso_saml20_profile_process_soap_response_with_headers() was
implemented that serializes from the XML SOAP headers into a
LassoSoapHeader node and optionally will return the LassoSoapHeader
node.

The functionality in lasso_saml20_profile_process_soap_response() was
moved into the new
lasso_saml20_profile_process_soap_response_with_headers() and now
lasso_saml20_profile_process_soap_response() simply calls
lasso_saml20_profile_process_soap_response_with_headers() passing NULL
for the header return.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
2015-08-24 16:05:29 +02:00
Benjamin Dauvergne 875f40832b Restore not-unused code
Clang was wrong on one instance, a value must be initialized to its NULL
state before using any lasso_assign_ macro with it.

Bug introduced in 4789e8d4d6.
2014-07-30 17:17:08 +02:00
Simo Sorce 99376a3c88 Fix potential null dereference errors
Ina  number of cases function inputs are not checked for NULL although
values may end up with a NULL value and then they are dereferenced
directly.
Check values in the function (or the caller) if appropriate.

License: MIT
Signed-off-by: Simo Sorce <simo@redhat.com>
2014-07-30 16:07:45 +02:00
Simo Sorce 4789e8d4d6 Trim unused code
Clang complains these values are never used, avoid even assigning them.

License: MIT
Signed-off-by: Simo Sorce <simo@redhat.com>
2014-07-30 16:07:44 +02:00
Benjamin Dauvergne 5def9c160b saml-2.0/profile: fix leak of xmlSecKey when building signed query strings 2014-06-08 12:32:10 +02:00
Simo Sorce 3a6b2fdee7 Fix license boilerplates
Instad of referring to an old FSF address, point the reader to the FSF
website where the latest licenses and addresses are published.

Signed-off-by: Simo Sorce <simo@redhat.com>
2013-12-03 21:55:06 +01:00
Benjamin Dauvergne 0bb846a355 saml-2.0/profile: fix typo in commit 8de55 2013-10-10 17:17:04 +02:00
Benjamin Dauvergne 8de55e4b2a saml-2.0/profile: add warning message when unable to build an artifact response message due to an unfound artifact resolution endpoint 2013-10-10 17:08:20 +02:00
Benjamin Dauvergne 566e29b3f8 saml2/profile.c: add resolving of the endpoint index in artifacts
* lasso/saml-2.0/profile.c: add new argument role to lasso_saml20_profile_init_artifact_resolve()
   for looking up ArtifactResolutionService location; extract endpoint index
   from artifact and use it to resolve the endpoint location.
 * login.c: pass new argument ; force msg_url as it is preinitialized by
   lasso_saml20_profile_init_artifact_resolve()
2013-09-08 23:53:33 +02:00
Benjamin Dauvergne 4799770a0d saml2/profile: fix missing ArtifactResolutionService index in artifacts 2013-09-08 21:34:12 +02:00
Benjamin Dauvergne b6faccae0f fix warnings about unused but set variables 2013-09-08 21:31:52 +02:00
Benjamin Dauvergne 727f07b1ae Simplify useless complexity in include paths 2011-12-16 14:17:31 +01:00
Benjamin Dauvergne cd017964d0 [core] introduce the LassoSignatureContext context, to pass around signature parameters
This structure is used to pass around the signature algorithm
and the signature key.
2011-12-05 12:03:13 +01:00
Benjamin Dauvergne 5192cdf7a0 [core] multiple decryption keys support
This commit complements the support for multiple signing certificate
support in the metadata files. The use-case is still key roll-over.

The structure LassoServerPrivateData was changed to accomodate multiple
decryption keys, and so:

 xmlSecKey *encryption_private_key

became:

 GList *encryption_private_keys

All uses of this key were replaced by a loop over this list, terminating
with the first key to be able to decrypt the content.

The private key passed to lasso_server_new() or
lasso_server_new_from_buffers() is first added to the list of decryption
keys. Any other call to
lasso_server_set_encryption_private_key_with_password() or
lasso_server_set_encryption_private_key() will add a new key to the
list.
2011-11-21 10:25:03 +01:00
Benjamin Dauvergne 773cdab883 [core] add missing break to switch/case 2011-11-18 15:36:40 +01:00
Benjamin Dauvergne 7016e7c453 [saml2] for any RequestDenied SAML2 response return LASSO_PROFILE_ERROR_REQUEST_DENIED as error 2011-04-21 11:23:06 +02:00
Benjamin Dauvergne 4391f1ffb9 [saml2] make LASSO_SIGNATURE_VERIFY_HINT_FORCE as least as stringent as _MAYBE when checking signature on messages 2010-12-14 12:10:47 +01:00
Benjamin Dauvergne 76dc05434a [SAMLv2] fix segfault in has_signature by initializing local variables 2010-10-20 15:42:59 +02:00
Benjamin Dauvergne 7d90d5e26a [SAMLv2] delete an unused local variable 2010-10-11 09:58:16 +02:00
Benjamin Dauvergne c36d6a90dd [SAMLv2] user server->signature_method when signing request and response 2010-10-09 17:55:31 +02:00
Benjamin Dauvergne 3872f17fcd [SAMLv2] handle unknown provider in artifact resolve, and also alow to ignore signature validation
In lasso_saml20_profile_process_artifact_resolve, we know take a short
path with an error when the remote provider is unknown and we also
respect the lasso_profile_get_signature_verify_hint() when checking the
signature on the artifact resolve message.
2010-10-07 18:48:28 +02:00
Benjamin Dauvergne 462c9a1cd0 [Core] replace all use of g_strcmp0 by lasso_strisequal and lasso_strisnotequal
Too much human errors with strcmp kind of functions. Also change name os
lasso_is_empty_string to lasso_strisempty.
2010-10-01 15:29:38 +02:00
Benjamin Dauvergne 4c3af26a58 [SAMLv2] also initialize Destination for response messages
asynchronous bindings needs Destination attribute even for response
messages.
2010-09-30 10:58:50 +02:00
Benjamin Dauvergne 6eeebd0304 [SAMLv2] in profile.c fix uncovered enumeration value in switch 2010-09-17 17:02:40 +02:00
Benjamin Dauvergne 51d5d4d3e3 [SAMLv2] apply the LassoProfileVerifySignatureHint when processing requests
The check was missing for processing of logout requests, name id
management request and assertion query responses.

A new internal function lasso_saml20_profile_check_signature_status is
added.
2010-09-09 16:20:17 +02:00
Benjamin Dauvergne b1f6b7e0ed [SAMLv2] when no artifact message is present, still return a success status
It is mandated by the specification.
2010-09-07 10:34:34 +02:00
Benjamin Dauvergne f245907b8c [SAMLv2] when failing to recreate the content for the ArtefactResponse set a lasso specific status code 2010-09-03 19:02:42 +02:00
Benjamin Dauvergne 4178cbef13 [SAMLv2] change the way content is stored and loaded for the HTTP-Artifact binding
Previously content was stored as the result of lasso_node_dump method
then reloaded, and then serialized again as part of the ArtifactResponse
message. lasso_node_dump was ignoring all hint to sign node, but keeping
the needed parameters around. That's not what must be done, the
signature should happen at the generation of the artifact and the result
must manipulated as is (i.e. XML content) and never moved back to the
land of LassoNode objects.

Now the content is:
- first removed of any signature at the message level, because the
  ArtifactResponse will take care of this, (any signature under this
  level (like at the assertion) is kept),
- serialized using lasso_node_export_to_xml,
- reloaded using lasso_xml_parse_memory,
- and put into the ArtifactResponse using a
  lasso_misc_text_node_new_with_xml_node.
2010-09-03 19:02:42 +02:00
Benjamin Dauvergne edd618319c [SAMLv2] make lasso_saml20_profile_generate_artifact a static function
It is only used in lasso/saml-2.0/profile.c anyway.
2010-09-03 19:02:42 +02:00
Benjamin Dauvergne e869899b79 [SAMLv2] add support for encrypted private keys
* support private key with new internal API in signature setting
   methods

Plug lasso_node_set_signature into
lasso_profile_saml20_setup_message_signature and
lasso_server_saml2_assertion_setup_signature.

 * also use lasso_node_get_signature in has_signature

 * add forgottent LASSO_PROFILE_SIGNATURE_VERIFY_HINT_FORCE in switch
   cases

For AuthnResponse checking the semantic is now that if HINT_FORCE is
used we verify message signature *and* assertion signature. If
HINT_MAYBE is used we check the assertion signature if its issuer
differs from the message issuer.
2010-07-16 19:34:30 +00:00
Benjamin Dauvergne c939427f21 [Core] add a password parameter to lasso_query_sign
We force use of the password through a custom OpenSSL password callback.
2010-07-16 19:34:21 +00:00
Benjamin Dauvergne c1a4ba2fc0 Merge branch 'issue-88' 2010-06-29 09:15:02 +00:00
Benjamin Dauvergne a041a2ef81 Initialize all uninitialized rc variables 2010-04-30 09:23:01 +00:00
Benjamin Dauvergne 86e549141f SAML 2.0: lasso_saml20_profile_process_any_response_msg, change status code checking 2010-04-27 22:55:21 +00:00
Benjamin Dauvergne 38d3f9d9a4 SAML 2.0 Profile: remove unused must_sign variable 2010-04-22 00:44:11 +00:00
Benjamin Dauvergne 81c35bbe2e Ameliorate support for lasso_profile_set_signature_verify_hint
* lasso/id-ff/profile.h:
   - add end symbol for enum LassoProfileSignatureVerifyHint
 * lasso/id-ff/profile.c:
   - fix documentation of lasso_profile_set_signature_verify_hint
   - do not allow to set or return invalid value for the
     signature_verify_hint attribute.
 * lasso/saml-2.0/login.c:
   - handle new enum value
 * lasso/saml-2.0/profile.c:
   - handle new enum value
   - fix missing catch of signature error reporting when
     signature_verify_hint is IGNORE.
 * docs/reference/lasso/lasso-sections.txt:
   - export enums LassoProfileSignatureHint and
     LassoProfileSignatureVerifyHint
 * tests/metadata_tests.c:
   - fix test of all Role enumerations
2010-04-16 15:37:17 +00:00
Benjamin Dauvergne 21015341e4 SAML 2.0: add Destination attribute to requests
* lasso/saml-2.0/profile.c:
   this change make Lasso respect paragraphs 3.4.5.2 (HTTP-Redirect
   binding securit considerations ) and 3.5.5.2 (the same for HTTP-Post)
   of the saml-bindings-2.0-os.pdf document, and should allow our Authn
   Requests to be accepted by shiboleth IdP.
2010-04-06 15:00:46 +00:00
Benjamin Dauvergne ed77956b86 Fix return path in lasso_saml20_process_any_response for signatures checking 2010-04-06 13:10:58 +00:00
Benjamin Dauvergne c07cd3898c SAML 2.0&ID-FF 1.2: simplify and complete metadata loading for multi-role support 2010-03-27 16:52:04 +00:00
Benjamin Dauvergne 97f37266e3 Support SignatureVerifyHint in SAML 2.0 SSO profile and common message handling 2010-03-27 16:51:38 +00:00
Benjamin Dauvergne 7d950e7457 SAML 2.0: change error code for empty ArtifactResolve response to LASSO_PROFILE_ERROR_MISSING_RESPONSE 2010-03-02 11:57:57 +00:00
Benjamin Dauvergne d393251585 SAML 2.0: in lasso_saml20_profile_set_session_from_dump_decrypt, really decrypt
* lasso/saml-2.0/profile.c:
   dump for already signed assertion containing an EncryptedID as
   Subject does not work as before, the decrypted NameID is no more
   included in it, so instead of trying to plug it in the NameID field
   we resort to really deciphering the EncryptedID.
   That could be a performance problem if the session object is stuffed
   with a lot of assertions.
2010-02-17 10:15:21 +00:00
Benjamin Dauvergne ee77424f54 SAML 2.0: in lasso_saml20_profile_process_any_response do not stop on missing issuer
* lasso/saml-2.0/profile.c:
   Issuer is not a mandatory element of SAML 2.0 response,
   but if we do not remember which issuer we sent the request (of if
   the response is spontaneous) then we will receive a provider not found
   error when trying to check the message signature.
2010-02-10 00:34:35 +00:00
Benjamin Dauvergne 8c26e2ba8c Use new SAML2 strings instead of hardcoding query string field names 2010-02-10 00:34:29 +00:00
Benjamin Dauvergne 92efc271a4 SAML 2.0: fix annotations, documentation and signatures 2010-01-29 00:43:50 +00:00
Benjamin Dauvergne 0279087029 Documentation: distribute stylesheet, fix documentation comments, compelte lasso-sections.txt 2010-01-18 10:03:54 +00:00
Benjamin Dauvergne 9d544c49d0 SAML 2.0: report missing request when creating artifact resolve response, fix typo in lasso_saml20_profile_build_post_response_msg 2010-01-14 16:18:28 +00:00