mirror of
https://github.com/Nathanwoodburn/FireWallet.git
synced 2024-11-24 08:08:14 +11:00
main: Added Yubikey device check and removed redundant code
- Added a check for the number of connected Yubikeys - Removed redundant code that prompts user to insert Yubikey before unlocking.
This commit is contained in:
parent
79350570fd
commit
6218b337fb
@ -2285,6 +2285,15 @@ namespace FireWallet
|
|||||||
NotifyForm notifyForm = new NotifyForm("Insert Yubikey\nThis will use your yubikey to encrypt your account password.");
|
NotifyForm notifyForm = new NotifyForm("Insert Yubikey\nThis will use your yubikey to encrypt your account password.");
|
||||||
notifyForm.ShowDialog();
|
notifyForm.ShowDialog();
|
||||||
notifyForm.Dispose();
|
notifyForm.Dispose();
|
||||||
|
var devices = YubiKeyDevice.FindAll();
|
||||||
|
if (devices.Count() != 1)
|
||||||
|
{
|
||||||
|
NotifyForm notifyForm2 = new NotifyForm("Please insert your yubikey and try again.");
|
||||||
|
notifyForm2.ShowDialog();
|
||||||
|
notifyForm2.Dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NotifyForm yubiLoadingForm = new NotifyForm("Encrypting. . .", false);
|
NotifyForm yubiLoadingForm = new NotifyForm("Encrypting. . .", false);
|
||||||
yubiLoadingForm.Show();
|
yubiLoadingForm.Show();
|
||||||
@ -2295,7 +2304,7 @@ namespace FireWallet
|
|||||||
{
|
{
|
||||||
//Assumes there is exactly one yubikey connected and it has a RSA2048 certificate in slot 9d
|
//Assumes there is exactly one yubikey connected and it has a RSA2048 certificate in slot 9d
|
||||||
//PIV PIN is assumed to be 123456
|
//PIV PIN is assumed to be 123456
|
||||||
var devices = YubiKeyDevice.FindAll();
|
|
||||||
var ykDevice = devices.First();
|
var ykDevice = devices.First();
|
||||||
PivSession piv = new(ykDevice);
|
PivSession piv = new(ykDevice);
|
||||||
|
|
||||||
@ -2350,9 +2359,6 @@ namespace FireWallet
|
|||||||
}
|
}
|
||||||
private string YubiUnlock()
|
private string YubiUnlock()
|
||||||
{
|
{
|
||||||
NotifyForm notifyForm = new NotifyForm("Insert Yubikey to unlock");
|
|
||||||
notifyForm.ShowDialog();
|
|
||||||
notifyForm.Dispose();
|
|
||||||
NotifyForm yubiLoadingForm = new NotifyForm("Decrypting. . .", false);
|
NotifyForm yubiLoadingForm = new NotifyForm("Decrypting. . .", false);
|
||||||
yubiLoadingForm.Show();
|
yubiLoadingForm.Show();
|
||||||
// Wait for the form to load
|
// Wait for the form to load
|
||||||
|
Loading…
Reference in New Issue
Block a user