ESP32: отправлять homeserver sessionType в SHiNE auth

This commit is contained in:
AidarKC
2026-06-13 15:08:53 +04:00
parent 61c21b245e
commit 81d1b84a7d
4 changed files with 34 additions and 2 deletions
@@ -81,6 +81,7 @@ static const uint8_t kBlockTypeAccessServers = 40;
static const uint8_t kBlockTypeSessions = 50;
static const uint8_t kBlockTypeTrustedState = 70;
static const uint8_t kSessionTypeHomeserver = 100;
static const char *kSessionClientPlatformEsp32 = "ESP32";
enum Screen {
SCREEN_HOME,
@@ -3192,6 +3193,8 @@ static bool ensureShineSessionAuthenticated(String &errorOut) {
+ "\",\"sessionKey\":\"" + jsonEscape(sessionKey)
+ "\",\"timeMs\":" + String((unsigned long long)timeMs)
+ ",\"signatureB64\":\"" + jsonEscape(bytesToBase64String(signature, 64))
+ ",\"sessionType\":" + String((unsigned int)kSessionTypeHomeserver)
+ ",\"clientPlatform\":\"" + jsonEscape(kSessionClientPlatformEsp32)
+ "\",\"clientInfo\":\"ESP32 homeserver\"}";
String loginResp;
if (shineWsRequest(gShineWs, "SessionLogin", loginReq, loginResp)) {
@@ -3257,6 +3260,8 @@ static bool ensureShineSessionAuthenticated(String &errorOut) {
+ ",\"authNonce\":\"" + jsonEscape(authNonce)
+ "\",\"deviceKey\":\"" + jsonEscape(bytesToBase64String(devicePub, 32))
+ "\",\"signatureB64\":\"" + jsonEscape(bytesToBase64String(signature, 64))
+ ",\"sessionType\":" + String((unsigned int)kSessionTypeHomeserver)
+ ",\"clientPlatform\":\"" + jsonEscape(kSessionClientPlatformEsp32)
+ "\",\"clientInfo\":\"ESP32 homeserver\"}";
String createResp;
if (!shineWsRequest(gShineWs, "CreateAuthSession", createReq, createResp)) {