feat: sign works

This commit is contained in:
2021-07-02 00:12:31 +08:00
parent c3a903173c
commit 6a66c3a5a6
4 changed files with 101 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ use authenticator::authenticatorservice::AuthenticatorService;
use authenticator::statecallback::StateCallback;
use authenticator::{RegisterFlags, StatusUpdate};
use sha2::{Digest, Sha256};
use std::sync::mpsc::{channel, RecvError};
use std::sync::mpsc::channel;
use std::thread;
use rust_util::XResult;
use rand::Rng;
@@ -85,7 +85,7 @@ impl Command for CommandImpl {
Ok(StatusUpdate::Success { dev_info }) => {
debugging!("STATUS: success using device: {}", dev_info);
}
Err(RecvError) => {
Err(_recv_error) => {
debugging!("STATUS: end");
return;
}
@@ -116,6 +116,7 @@ impl Command for CommandImpl {
success!("Device info: {}", &device_info);
let credential = u2f_get_key_handle_from_register_response(&register_data).unwrap();
success!("Key handle: {}", base64::encode(&credential));
success!("Key handle: {}", hex::encode(&credential));
Ok(())
}