diff --git a/src/lib_client_base/client_keys.ml b/src/lib_client_base/client_keys.ml index 0f1753d7e..a0cd0c5ef 100644 --- a/src/lib_client_base/client_keys.ml +++ b/src/lib_client_base/client_keys.ml @@ -142,6 +142,7 @@ let find_signer_for_key cctxt ~scheme = | signer, false -> let module Signer = (val signer : SIGNER) in Signer.init cctxt >>=? fun () -> + Hashtbl.replace signers_table scheme (signer, true) ; return signer | signer, true -> return signer diff --git a/src/lib_client_base_unix/client_signer_encrypted.ml b/src/lib_client_base_unix/client_signer_encrypted.ml index ba63aaecb..20c7c17a2 100644 --- a/src/lib_client_base_unix/client_signer_encrypted.ml +++ b/src/lib_client_base_unix/client_signer_encrypted.ml @@ -74,19 +74,20 @@ module Encrypted_signer : SIGNER = struct if Secret_key_locator.scheme skloc <> scheme then Lwt.return a else - match Base58.safe_decode (Secret_key_locator.location skloc) with + let location = Secret_key_locator.location skloc in + match Base58.safe_decode location with | None -> Lwt.fail Exit - | Some loc -> - let salt, skenc = salt_skenc_of_skloc loc in + | Some payload -> + let salt, skenc = salt_skenc_of_skloc payload in match decrypt_sk skenc salt a with | Some sk -> - Hashtbl.replace decrypted_sks loc + Hashtbl.replace decrypted_sks location (Ed25519.Secret_key.of_bytes_exn sk) ; Lwt.return a | None -> passwd_ask_loop cctxt ~name ~salt ~skenc >>= fun (passwd, decrypted_sk) -> - Hashtbl.replace decrypted_sks loc decrypted_sk ; + Hashtbl.replace decrypted_sks location decrypted_sk ; Lwt.return (passwd :: a) end [] sks