Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2EE: directly encrypt/decrypt #3802

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tobiasKaminsky
Copy link
Member

Previously it was first reading complete file into memory.

Signed-off-by: tobiasKaminsky tobias@kaminsky.me

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@@ -201,7 +200,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
.get(mFile.getEncryptedFileName()).getAuthenticationTag());

try {
byte[] decryptedBytes = EncryptionUtils.decryptFile(tmpFile, key, iv, authenticationTag);
// byte[] decryptedBytes = EncryptionUtils.decryptFile(tmpFile, key, iv, authenticationTag);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this dead code needed here?

@@ -519,7 +519,9 @@ private RemoteOperationResult encryptedUpload(OwnCloudClient client, OCFile pare
// IV, always generate new one
byte[] iv = EncryptionUtils.randomBytes(EncryptionUtils.ivLength);

EncryptionUtils.EncryptedFile encryptedFile = EncryptionUtils.encryptFile(mFile, key, iv);
// EncryptionUtils.EncryptedFile encryptedFile = EncryptionUtils.encryptFile(mFile, key, iv);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this dead line?

// check authentication tag
byte[] extractedAuthenticationTag = Arrays.copyOfRange(fileBytes,
fileBytes.length - (128 / 8), fileBytes.length);
FileOutputStream fileOutputStream1 = new FileOutputStream(output);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name looks like autogenerated by some bad generator. I'm sure we can avoid names like someVar7.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first review, however this is in dev by me and I mainly opened a PR to not forget about it ;-)
I'll enhance this prior setting it to "2. to review".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants