Lines Matching refs:pubkey
283 UserPermit HdcDaemon::PostUIConfirm(string hostname, string pubkey)
298 if (SHA256(reinterpret_cast<const uint8_t *>(pubkey.c_str()), pubkey.length(), sha256Result) == nullptr) {
299 WRITE_LOG(LOG_FATAL, "sha256 pubkey failed");
305 WRITE_LOG(LOG_DEBUG, "Failed to set pubkey prop.");
331 bool HdcDaemon::GetHostPubkeyInfo(const string& buf, string& hostname, string& pubkey)
337 pubkey = buf.substr(buf.find(separator) + 1);
338 WRITE_LOG(LOG_INFO, "hostname is [%s], pubkey is [%s]", hostname.c_str(),
339 pubkey.substr(0, pubkey.size() / 2).c_str());
341 return (!hostname.empty() && !pubkey.empty());
448 string hostname, pubkey;
451 if (!GetHostPubkeyInfo(handshake.buf, hostname, pubkey)) {
452 WRITE_LOG(LOG_FATAL, "get pubkey failed for %u", hSession->sessionId);
455 if (AlreadyInKnownHosts(pubkey)) {
469 UserPermit permit = PostUIConfirm(hostname, pubkey);
475 UpdateKnownHosts(pubkey);
484 SendAuthSignMsg(handshake, channelId, hSession->sessionId, pubkey, hSession->tokenRSA);
576 bool HdcDaemon::AuthVerify(HSession hSession, const string &encryptToken, const string &token, const string &pubkey)
580 const unsigned char *pubkeyp = reinterpret_cast<const unsigned char *>(pubkey.c_str());
589 int wbytes = BIO_write(bio, pubkeyp, pubkey.length());
629 WRITE_LOG(LOG_FATAL, "base64 decode pubkey failed");
655 string pubkey = GetSessionAuthPubkey(hSession->sessionId);
656 if (!AuthVerify(hSession, handshake.buf, token, pubkey)) {
1016 info.pubkey = "";
1020 void HdcDaemon::UpdateSessionAuthPubkey(uint32_t sessionid, string pubkey)
1026 info.pubkey = pubkey;
1074 return info.pubkey;
1114 uint32_t channelId, uint32_t sessionid, string pubkey, string token)
1116 UpdateSessionAuthPubkey(sessionid, pubkey);