Skip to content
Snippets Groups Projects
Unverified Commit 9fb18d4c authored by Sébastien Blin's avatar Sébastien Blin
Browse files

jams: passing invalid jams should return a server error

Change-Id: I3a5601e1aff2f3ab228d1c1dc58d5400101c4fb9
parent 210b7481
Branches
Tags
No related merge requests found
......@@ -699,7 +699,8 @@ void JamiAccount::serialize(YAML::Emitter &out) const
out << YAML::Key << DRing::Account::ConfProperties::ARCHIVE_PATH << YAML::Value << archivePath_;
out << YAML::Key << DRing::Account::ConfProperties::ARCHIVE_HAS_PASSWORD << YAML::Value << archiveHasPassword_;
out << YAML::Key << Conf::RING_ACCOUNT_RECEIPT << YAML::Value << receipt_;
out << YAML::Key << Conf::RING_ACCOUNT_RECEIPT_SIG << YAML::Value << YAML::Binary(receiptSignature_.data(), receiptSignature_.size());
if (receiptSignature_.size() > 0)
out << YAML::Key << Conf::RING_ACCOUNT_RECEIPT_SIG << YAML::Value << YAML::Binary(receiptSignature_.data(), receiptSignature_.size());
out << YAML::Key << DRing::Account::ConfProperties::RING_DEVICE_NAME << YAML::Value << ringDeviceName_;
out << YAML::Key << DRing::Account::ConfProperties::MANAGER_URI << YAML::Value << managerUri_;
out << YAML::Key << DRing::Account::ConfProperties::MANAGER_USERNAME << YAML::Value << managerUsername_;
......
......@@ -103,7 +103,10 @@ ServerAccountManager::initAuthentication(
JAMI_ERR("[Auth] Got server response: %d", (int)state);
if (state != Request::State::DONE)
return;
if (response.status_code >= 400 && response.status_code < 500)
if (response.status_code == 0) {
ctx->onFailure(AuthError::SERVER_ERROR, "Invalid server provided");
return;
} else if (response.status_code >= 400 && response.status_code < 500)
ctx->onFailure(AuthError::INVALID_ARGUMENTS, "");
else if (response.status_code < 200 || response.status_code > 299)
ctx->onFailure(AuthError::INVALID_ARGUMENTS, "");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment