Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kinode/src/register-ui/src/pages/ImportKeyfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function ImportKeyfile({
credentials: 'include',
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
keyfile: Buffer.from(localKey).toString('base64'),
keyfile: Buffer.from(localKey).toString('utf8'),
password_hash: hashed_password,
}),
});
Expand Down
5 changes: 5 additions & 0 deletions kinode/src/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ async fn handle_import_keyfile(
sender: Arc<RegistrationSender>,
provider: Arc<RootProvider<PubSubFrontend>>,
) -> Result<impl Reply, Rejection> {
println!("received base64 keyfile: {}\r", info.keyfile);
// if keyfile was not present in node and is present from user upload
let encoded_keyfile = match base64_standard.decode(info.keyfile) {
Ok(k) => k,
Expand All @@ -455,6 +456,10 @@ async fn handle_import_keyfile(
}
};

println!(
"received keyfile: {}\r",
String::from_utf8_lossy(&encoded_keyfile)
);
let (decoded_keyfile, mut our) =
match keygen::decode_keyfile(&encoded_keyfile, &info.password_hash) {
Ok(k) => {
Expand Down