Lines Matching refs:handshake

426 void HdcServer::GetDaemonAuthType(HSession hSession, SessionHandShake &handshake)
431 * Notice, If deamon is old version 'handshake.buf' will be 'hSession->tokenRSA',
437 if (!Base::TlvToStringMap(handshake.buf, tlvmap)) {
450 bool HdcServer::HandServerAuth(HSession hSession, SessionHandShake &handshake)
453 switch (handshake.authType) {
456 GetDaemonAuthType(hSession, handshake);
457 if (!HdcAuth::GetPublicKeyinfo(handshake.buf)) {
461 handshake.authType = AUTH_PUBLICKEY;
462 bufString = SerialStruct::SerializeToString(handshake);
471 if (!HdcAuth::RsaSignAndBase64(handshake.buf, hSession->verifyType)) {
475 handshake.authType = AUTH_SIGNATURE;
476 bufString = SerialStruct::SerializeToString(handshake);
483 WRITE_LOG(LOG_FATAL, "invalid auth type %d", handshake.authType);
488 void HdcServer::UpdateHdiInfo(Hdc::HdcSessionBase::SessionHandShake &handshake, const string &connectKey)
499 WRITE_LOG(LOG_INFO, "handshake info is : %s", handshake.ToDebugString().c_str());
500 WRITE_LOG(LOG_INFO, "handshake.buf = %s", handshake.buf.c_str());
501 if (handshake.version < "Ver: 3.0.0b") {
502 if (!handshake.buf.empty()) {
503 hdiNew->devName = handshake.buf;
507 if (Base::TlvToStringMap(handshake.buf, tlvmap)) {
524 hdiNew->version = handshake.version;
530 // session handshake step3
532 Hdc::HdcSessionBase::SessionHandShake handshake;
533 SerialStruct::ParseFromString(handshake, s);
535 WRITE_LOG(LOG_DEBUG, "handshake.banner:%s, payload:%s(%d)", handshake.banner.c_str(), s.c_str(), payloadSize);
538 if (handshake.banner == HANDSHAKE_FAILED.c_str()) {
543 if (handshake.banner != HANDSHAKE_MESSAGE.c_str()) {
547 if (handshake.authType != AUTH_OK) {
548 if (!HandServerAuth(hSession, handshake)) {
554 // handshake auth OK
555 UpdateHdiInfo(handshake, hSession->connectKey);
568 WRITE_LOG(LOG_DEBUG, "Session handshake %s connType:%d", ret ? "successful" : "failed",