2025-01-25 12:25:38 -08:00
|
|
|
#include "sasl_mechanism.hpp"
|
|
|
|
|
2025-01-30 09:28:28 -08:00
|
|
|
auto SaslPlain::step(std::string_view msg) -> StepResult {
|
2025-01-25 12:25:38 -08:00
|
|
|
if (complete_) {
|
2025-01-30 09:28:28 -08:00
|
|
|
return Failure{};
|
2025-01-25 12:25:38 -08:00
|
|
|
} else {
|
|
|
|
std::string reply;
|
|
|
|
|
|
|
|
reply += authzid_;
|
|
|
|
reply += '\0';
|
|
|
|
reply += authcid_;
|
|
|
|
reply += '\0';
|
|
|
|
reply += password_;
|
|
|
|
|
|
|
|
complete_ = true;
|
|
|
|
|
2025-01-30 09:28:28 -08:00
|
|
|
return std::move(reply);
|
2025-01-25 12:25:38 -08:00
|
|
|
}
|
|
|
|
}
|
2025-01-28 20:01:51 -08:00
|
|
|
|
2025-01-30 09:28:28 -08:00
|
|
|
auto SaslExternal::step(std::string_view msg) -> StepResult {
|
2025-01-28 20:01:51 -08:00
|
|
|
if (complete_) {
|
2025-01-30 09:28:28 -08:00
|
|
|
return Failure{};
|
2025-01-28 20:01:51 -08:00
|
|
|
} else {
|
2025-01-30 09:28:28 -08:00
|
|
|
return std::move(authzid_);
|
2025-01-28 20:01:51 -08:00
|
|
|
}
|
|
|
|
}
|