Lines Matching refs:pubkey
43 Pubk(String, String, String), // with (plain, pubkey, confirm msg)
367 if let Some((hostname, pubkey)) = buf.split_once(HDC_HOST_DAEMON_BUF_SEPARATOR) {
368 (hostname.to_string(), pubkey.to_string())
410 let (hostname, pubkey) = get_host_pubkey_info(buf.trim());
411 if pubkey.is_empty() {
433 if known_hosts.contains(&pubkey) {
434 crate::info!("pubkey matches known host({})", hostname);
437 AuthStatus::Pubk(token.clone(), pubkey, "".to_string()),
455 AuthStatus::Pubk(token.clone(), pubkey.clone(), confirmmsg.to_string()),
476 if write_known_hosts_pubkey(&pubkey).is_err() {
489 AuthStatus::Pubk(token.clone(), pubkey, "".to_string()),
502 AuthStatus::Pubk(token.clone(), pubkey, "".to_string()),
537 pubkey: String,
540 match validate_signature(token, pubkey, buf).await {
610 "wrong command, need pubkey now",
615 AuthStatus::Pubk(token, pubkey, confirm) => {
627 handshake_deal_signature(session_id, channel_id, token, pubkey, recv.buf).await
648 async fn validate_signature(plain: String, pubkey: String, signature: String) -> io::Result<()> {
655 let rsa = if let Ok(cipher) = Rsa::public_key_from_pem(pubkey.as_bytes()) {
658 return Err(Error::new(ErrorKind::Other, "pubkey convert failed"));
680 crate::info!("auth_cancel is {}, no need clear pubkey file", auth_cancel);
691 crate::info!("remove pubkey file {:?} success", file_name);
694 crate::error!("remove pubkey file {:?} failed: {}", file_name, err);
718 crate::info!("pubkey file {:?} not exists", file_name);
723 fn write_known_hosts_pubkey(pubkey: &String) -> io::Result<()> {
737 Ok(mut f) => writeln!(&mut f, "{}", pubkey),
739 crate::error!("write pubkey err: {}", e.to_string());