Lines Matching defs:hSession
97 bool HdcDaemon::RedirectToTask(HTaskInfo hTaskInfo, HSession hSession, const uint32_t channelId,
150 bool HdcDaemon::HandDaemonAuth(HSession hSession, const uint32_t channelId, SessionHandShake &handshake)
155 hSession->tokenRSA = Base::GetRandomString(SHA_DIGEST_LENGTH);
157 handshake.buf = hSession->tokenRSA;
159 Send(hSession->sessionId, channelId, CMD_KERNEL_HANDSHAKE, (uint8_t *)bufString.c_str(), bufString.size());
171 if (!HdcAuth::AuthVerify((uint8_t *)hSession->tokenRSA.c_str(),
175 handshake.buf = hSession->tokenRSA;
177 Send(hSession->sessionId, channelId, CMD_KERNEL_HANDSHAKE, (uint8_t *)bufString.c_str(),
195 bool HdcDaemon::DaemonSessionHandshake(HSession hSession, const uint32_t channelId, uint8_t *payload, int payloadSize)
204 hSession->availTailIndex = 0;
210 uint32_t unOld = hSession->sessionId;
211 hSession->sessionId = handshake.sessionId;
212 hSession->connectKey = handshake.connectKey;
213 AdminSession(OP_UPDATE, unOld, hSession);
215 (reinterpret_cast<HdcDaemonUSB *>(clsUSBServ))->OnNewHandshakeOK(hSession->sessionId);
221 if (enableSecure && !HandDaemonAuth(hSession, channelId, handshake)) {
231 Send(hSession->sessionId, channelId, CMD_KERNEL_HANDSHAKE, (uint8_t *)bufString.c_str(), bufString.size());
232 hSession->handshakeOK = true;
236 bool HdcDaemon::FetchCommand(HSession hSession, const uint32_t channelId, const uint16_t command, uint8_t *payload,
241 if (!hSession->handshakeOK && command != CMD_KERNEL_HANDSHAKE) {
248 ret = DaemonSessionHandshake(hSession, channelId, payload, payloadSize);
252 ClearOwnTasks(hSession, channelId);
255 Send(hSession->sessionId, channelId, CMD_KERNEL_CHANNEL_CLOSE, payload, 1);
261 ret = DispatchTaskData(hSession, channelId, command, payload, payloadSize);
309 void HdcDaemon::NotifyInstanceSessionFree(HSession hSession, bool freeOrClear)
316 clsUsbModule->OnSessionFreeFinally(hSession);