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:
@@ -166,7 +166,11 @@ public class ShadowverseTranslationMiddleware : IMiddleware
|
|||||||
// populated (prod sends real numbers for the title check too, but 0 / 0 satisfies
|
// 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).
|
// the client's BaseTask.Parse which only reads result_code + servertime here).
|
||||||
ShortUdid = viewer?.ShortUdid ?? 0,
|
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() ?? ""
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -21,4 +21,15 @@ public class DataHeaders
|
|||||||
[JsonPropertyName("result_code")]
|
[JsonPropertyName("result_code")]
|
||||||
[Key("result_code")]
|
[Key("result_code")]
|
||||||
public int ResultCode { get; set; }
|
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; } = "";
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user