From a532ea72114e6fa899e3f2add21eb005c71b939d Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@ucc.asn.au>
Date: Sun, 21 Aug 2022 11:33:01 +0800
Subject: [PATCH] Fix naming, "pk" is a secret key not public

---
 sshproto/src/cliauth.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sshproto/src/cliauth.rs b/sshproto/src/cliauth.rs
index 2a05c39..61e8d4d 100644
--- a/sshproto/src/cliauth.rs
+++ b/sshproto/src/cliauth.rs
@@ -134,15 +134,15 @@ impl CliAuth {
         &mut self,
         b: &mut CliBehaviour<'_>,
     ) -> Result<Option<Req>> {
-        let pk = b.next_authkey().await.map_err(|_| {
+        let k = b.next_authkey().await.map_err(|_| {
             self.try_pubkey = false;
             Error::BehaviourError { msg: "next_pubkey failed TODO" }
         })?;
-        let pk = pk.map(|pk| Req::PubKey { key: pk });
-        if pk.is_none() {
+        let k = k.map(|k| Req::PubKey { key: k });
+        if k.is_none() {
             self.try_pubkey = false;
         }
-        Ok(pk)
+        Ok(k)
     }
 
     pub fn auth_sig_msg(
@@ -173,7 +173,7 @@ impl CliAuth {
             };
             let mut ctx = ParseContext::default();
             ctx.method_pubkey_force_sig_bool = true;
-            key.sign_encode(&msg, Some(&ctx))
+            key.sign(&msg, Some(&ctx))
         } else {
             Err(Error::bug())
         }
-- 
GitLab