Compare commits

...

3 Commits

Author SHA1 Message Date
Philipp Crocoll
26c37bcd2a fix implementation of yubikey secret reading 2025-04-15 12:44:43 +02:00
PhilippC
1980f05a7c Merge pull request #2844 from PhilippC/2837-improve-error-reporting
Improve error reporting and fix crash
2025-04-15 12:17:18 +02:00
PhilippC
4be18d8373 Merge pull request #2830 from PhilippC/754-crash-when-using-fingerprint-before-otp
Fix crash when combining biometric unlock and KeeChallenge/OTP.
2025-04-15 11:42:59 +02:00

View File

@@ -148,17 +148,13 @@ namespace KeeChallenge
{
//read the secret from the stream
int totalBytesRead = 0;
byte[] buffer = new byte[secret.Length];
var secretOutputStream = new MemoryStream(secret);
int bytesRead = csDecrypt.Read(buffer, totalBytesRead, secret.Length - totalBytesRead);
int bytesRead = csDecrypt.Read(secret, totalBytesRead, secret.Length - totalBytesRead);
while (bytesRead > 0 && totalBytesRead < secret.Length)
{
secretOutputStream.Write(buffer, 0, bytesRead);
totalBytesRead += bytesRead;
bytesRead = csDecrypt.Read(buffer, totalBytesRead, secret.Length - totalBytesRead);
bytesRead = csDecrypt.Read(secret, totalBytesRead, secret.Length - totalBytesRead);
}
secretOutputStream.Close();
csDecrypt.Close();
}