Lines Matching refs:hSession
146 bool HdcDaemon::RedirectToTask(HTaskInfo hTaskInfo, HSession hSession, const uint32_t channelId, in RedirectToTask() argument
201 bool HdcDaemon::HandDaemonAuth(HSession hSession, const uint32_t channelId, SessionHandShake &hands… in HandDaemonAuth() argument
206 hSession->tokenRSA = Base::GetRandomString(SHA_DIGEST_LENGTH); in HandDaemonAuth()
208 handshake.buf = hSession->tokenRSA; in HandDaemonAuth()
210 Send(hSession->sessionId, channelId, CMD_KERNEL_HANDSHAKE, in HandDaemonAuth()
224 …if (!HdcAuth::AuthVerify(reinterpret_cast<uint8_t *>(const_cast<char *>(hSession->tokenRSA.c_str()… in HandDaemonAuth()
228 handshake.buf = hSession->tokenRSA; in HandDaemonAuth()
230 Send(hSession->sessionId, channelId, CMD_KERNEL_HANDSHAKE, in HandDaemonAuth()
248 bool HdcDaemon::DaemonSessionHandshake(HSession hSession, const uint32_t channelId, uint8_t *payloa… in DaemonSessionHandshake() argument
257 WRITE_LOG(LOG_DEBUG, "session %s try to handshake", hSession->ToDebugString().c_str()); in DaemonSessionHandshake()
261 hSession->availTailIndex = 0; in DaemonSessionHandshake()
267 uint32_t unOld = hSession->sessionId; in DaemonSessionHandshake()
268 hSession->sessionId = handshake.sessionId; in DaemonSessionHandshake()
269 hSession->connectKey = handshake.connectKey; in DaemonSessionHandshake()
270 AdminSession(OP_UPDATE, unOld, hSession); in DaemonSessionHandshake()
272 if (hSession->connType == CONN_SERIAL and clsUARTServ!= nullptr) { in DaemonSessionHandshake()
276 (static_cast<HdcDaemonUART *>(clsUARTServ))->OnNewHandshakeOK(hSession->sessionId); in DaemonSessionHandshake()
281 (reinterpret_cast<HdcDaemonUSB *>(clsUSBServ))->OnNewHandshakeOK(hSession->sessionId); in DaemonSessionHandshake()
287 if (enableSecure && !HandDaemonAuth(hSession, channelId, handshake)) { in DaemonSessionHandshake()
298 hSession->availTailIndex = 0; in DaemonSessionHandshake()
301 Send(hSession->sessionId, channelId, CMD_KERNEL_HANDSHAKE, (uint8_t *)failedString.c_str(), in DaemonSessionHandshake()
312 … WRITE_LOG(LOG_INFO, "session %u handshakeOK send back CMD_KERNEL_HANDSHAKE", hSession->sessionId); in DaemonSessionHandshake()
320 Send(hSession->sessionId, channelId, CMD_KERNEL_HANDSHAKE, in DaemonSessionHandshake()
322 hSession->handshakeOK = true; in DaemonSessionHandshake()
381 bool HdcDaemon::FetchCommand(HSession hSession, const uint32_t channelId, const uint16_t command, u… in FetchCommand() argument
386 if (!hSession->handshakeOK and command != CMD_KERNEL_HANDSHAKE) { in FetchCommand()
388 hSession->sessionId, command); in FetchCommand()
402 ret = DaemonSessionHandshake(hSession, channelId, payload, payloadSize); in FetchCommand()
406 ClearOwnTasks(hSession, channelId); in FetchCommand()
409 Send(hSession->sessionId, channelId, CMD_KERNEL_CHANNEL_CLOSE, payload, 1); in FetchCommand()
417 ret = DispatchTaskData(hSession, channelId, command, payload, payloadSize); in FetchCommand()
419 LogMsg(hSession->sessionId, channelId, MSG_FAIL, "debugging is not allowed"); in FetchCommand()
421 Send(hSession->sessionId, channelId, CMD_KERNEL_CHANNEL_CLOSE, &count, 1); in FetchCommand()
472 void HdcDaemon::NotifyInstanceSessionFree(HSession hSession, bool freeOrClear) in NotifyInstanceSessionFree() argument
479 clsUsbModule->OnSessionFreeFinally(hSession); in NotifyInstanceSessionFree()