- Fix #674 Escape the values written in the XML of the
AuthnRequest,LogoutRequest,LogoutResponseand the SP metadata. A value with a&, like an IdP URL with several query parameters, produced an XML that was not well formed:AuthnRequest: Destination (idp.singleSignOnService.url), ProviderName (displayname of the organization),sp.NameIDFormat, thesecurity.requestedAuthnContextvalues,security.requestedAuthnContextComparisonand the NameID of the Subject (nameIdValueReq)LogoutRequest: Destination (idp.singleLogoutService.url) and SessionIndexLogoutResponse: Destination (idp.singleLogoutService.responseUrl) and InResponseTo- Metadata: the organization and contact person data,
sp.NameIDFormat, the bindings, and the name, description, requested attributes and attribute values ofsp.attributeConsumingService
The URL the user is redirected to is not changed. If any of those settings was defined already escaped (&) to get a valid XML, the escaping must be removed from the settings, otherwise the value will be escaped twice
- Fix #657 The Destination check of
Response,LogoutRequestandLogoutResponseis done by the newUtils::checkDestination, so the 3 messages are validated in the same way:security.requireDestinationnow also applies toLogoutRequestandLogoutResponse: when true, a logout message with no Destination attribute is rejected withValidationError::MISSING_DESTINATION- The Destination of a
LogoutRequestand aLogoutResponseis trimmed before it is compared, as the one of theResponsealready was. A Destination that only has whitespaces is now reported asValidationError::EMPTY_DESTINATIONinstead ofWRONG_DESTINATION, andsecurity.relaxDestinationValidationaccepts it
- Update certificate and private_key string replacement to include tabs.
- Add
IdPMetadataParser::getLastFetchedXMLFromUrl, which returns the XML that the last call toIdPMetadataParser::parseRemoteXMLretrieved from the URL (null if the request failed) - Several decryption error handling improvements:
- An encryption algorithm rejected by the
security.allowCBCEncryptionorsecurity.allowRSA15KeyTransportsettings is reported with the newValidationError::ENCRYPTION_ALGORITHM_NOT_ALLOWEDcode. The message of xmlseclibs is kept and the name of the setting that allows the algorithm is appended. Before, the plain Exception of xmlseclibs was thrown, andAuth::processResponsedid not catch it - An EncryptedAssertion that can not be decrypted no longer makes the
Responseconstructor throw:isValid()returns false andgetErrorException()has the cause.
This covers a rejected algorithm and every other decryption error of the EncryptedAssertion and of the EncryptedID inside it (Error::PRIVATE_KEY_NOT_FOUND,ValidationError::DECRYPTION_FAILED,KEY_ALGORITHM_ERROR,MISSING_ENCRYPTED_ELEMENT,KEYINFO_NOT_FOUND_IN_ENCRYPTED_DATA...). The assertion of such a Response is not available (encryptedis false), as when the signature of the message is rejected before decrypting it. Utils::decryptElement,Response::getNameIdData/getNameIdandLogoutRequest::getNameIdData/getNameIdthrow thatValidationErrorinstead of the Exception of xmlseclibs. Other errors are thrown as beforeLogoutRequest::isValid()(and soAuth::processSLO, with theinvalid_logout_requesterror) already reported a rejected algorithm in the EncryptedID; its error now has the new code- Add
Utils::locateDecryptionKeyandUtils::locateDecryptionKeyInfo, which locate the key of an EncryptedData with a decryption context created byUtils::createDecryptionContextand throw the new error for a rejected algorithm (other exceptions are thrown unchanged)
- An encryption algorithm rejected by the
Response::isValid()decrypts the EncryptedID of a not encrypted Assertion once the signatures are validated, asLogoutRequest::isValid()does, so a NameID that can not be decrypted makesisValid()return false. Before,isValid()returned true andgetNameId()(called byAuth::processResponse) threw the exception