SHA256
ESP32: отправлять homeserver sessionType в SHiNE auth
This commit is contained in:
+5
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user