fix: reset position before demanding new data for frame decryption
This commit is contained in:
parent
8ff12e49bb
commit
6bb11e60b7
2 changed files with 3 additions and 2 deletions
|
@ -513,8 +513,6 @@ impl BackupDecryptor {
|
||||||
Err(e) => return Err(e),
|
Err(e) => return Err(e),
|
||||||
};
|
};
|
||||||
|
|
||||||
// if we got to an attachment, but there we demand more data, it will be faulty, because we try to decrypt the frame although we would need
|
|
||||||
// to decrypt the attachment
|
|
||||||
match decrypt_frame(
|
match decrypt_frame(
|
||||||
&mut self.reader,
|
&mut self.reader,
|
||||||
hmac,
|
hmac,
|
||||||
|
@ -524,6 +522,8 @@ impl BackupDecryptor {
|
||||||
frame_length,
|
frame_length,
|
||||||
) {
|
) {
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
|
// here we have to reset as well because the hmac depends on the length decryption which should therefore happen next time on the correct bits
|
||||||
|
self.reader.set_position(initial_reader_position);
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
Ok(Some(backup_frame)) => {
|
Ok(Some(backup_frame)) => {
|
||||||
|
|
|
@ -133,6 +133,7 @@ const App: Component = () => {
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
id="backup-input"
|
id="backup-input"
|
||||||
|
accept=".backup"
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setBackupFile(event.currentTarget.files?.[0]);
|
setBackupFile(event.currentTarget.files?.[0]);
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue