respect rfc6120 §6.5 properly in sasl_error

Any unknown condition should be considered as a <not-authorized/> one.
This commit is contained in:
Emmanuel Gil Peyrot 2017-04-01 14:36:55 +01:00
parent 9d57e1a63b
commit f8c76ac1e8

View file

@ -70,6 +70,16 @@ impl FromElement for SaslError {
else if element.has_child("temporary-auth-failure", ns::SASL) {
err.condition = Condition::TemporaryAuthFailure;
}
else {
/* RFC 6120 section 6.5:
*
* However, because additional error conditions might be defined in
* the future, if an entity receives a SASL error condition that it
* does not understand then it MUST treat the unknown condition as
* a generic authentication failure, i.e., as equivalent to
* <not-authorized/> (Section 6.5.10). */
err.condition = Condition::NotAuthorized;
}
Ok(err)
}
}