mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-08-17 20:56:02 +00:00
last byte in request range inclusive (!!)
This commit is contained in:
@@ -53,7 +53,7 @@ class EncryptedFilePart extends EncryptedFile {
|
||||
assert Files.isRegularFile(filePath);
|
||||
assert contentLength != null;
|
||||
|
||||
final Long rangeLength = range.getRight() - range.getLeft();
|
||||
final Long rangeLength = range.getRight() - range.getLeft() + 1;
|
||||
outputContext.setModificationTime(Files.getLastModifiedTime(filePath).toMillis());
|
||||
if (rangeLength <= 0 || range.getLeft() > contentLength - 1) {
|
||||
// unsatisfiable content range:
|
||||
|
||||
@@ -549,7 +549,7 @@ public class Aes256Cryptor implements Cryptor, AesCryptographicConfiguration {
|
||||
final Long fileSize = sensitiveHeaderContentBuf.getLong();
|
||||
sensitiveHeaderContentBuf.get(fileKeyBytes);
|
||||
|
||||
assert pos + length < fileSize;
|
||||
assert pos + length - 1 < fileSize;
|
||||
|
||||
// find first relevant block:
|
||||
final long startBlock = pos / CONTENT_MAC_BLOCK; // floor
|
||||
|
||||
Reference in New Issue
Block a user