wire: echo UDID in DataHeaders on every response

SignUpTask.Parse validates data_headers.udid against Certification.Udid;
mismatch discards the response. Sourced from the same mappedUdid the
translation middleware uses to decrypt — never controller state. Other
endpoints carry the extra key; SignUpTask is the only reader.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-05-27 14:11:47 -04:00
parent c8ee1e487f
commit 859980af02
2 changed files with 17 additions and 2 deletions

View File

@@ -166,7 +166,11 @@ public class ShadowverseTranslationMiddleware : IMiddleware
// populated (prod sends real numbers for the title check too, but 0 / 0 satisfies
// the client's BaseTask.Parse which only reads result_code + servertime here).
ShortUdid = viewer?.ShortUdid ?? 0,
ViewerId = viewer?.Id ?? 0
ViewerId = viewer?.Id ?? 0,
// Echo the decrypted-against UDID. Most clients ignore this field; SignUpTask.Parse
// requires it (validates against Certification.Udid on the response). Comes from
// mappedUdid (the value used for AES); never from controller state.
Udid = mappedUdid?.ToString() ?? ""
}
};

View File

@@ -21,4 +21,15 @@ public class DataHeaders
[JsonPropertyName("result_code")]
[Key("result_code")]
public int ResultCode { get; set; }
}
/// <summary>
/// Echoed UDID. Read by <c>SignUpTask.Parse</c> to validate response identity (client logs
/// <c>udid一致しません</c> and discards the response on mismatch); ignored by every other
/// client task. Always set by <c>ShadowverseTranslationMiddleware</c> from the request's
/// resolved UDID — never from controller state. Empty string when the SID→UDID lookup misses
/// (request without UDID/SID headers).
/// </summary>
[JsonPropertyName("udid")]
[Key("udid")]
public string Udid { get; set; } = "";
}