Password-protected files

This commit is contained in:
yflory
2018-05-25 18:00:10 +02:00
parent 95218f0fa1
commit c7e08fedfb
18 changed files with 117 additions and 96 deletions

View File

@@ -1169,8 +1169,8 @@ define([
// No password for avatars
var secret = Hash.getSecrets('file', parsed.hash);
if (secret.keys && secret.channel) {
var cryptKey = secret.keys && secret.keys.fileKeyStr;
var hexFileName = Util.base64ToHex(secret.channel);
var hexFileName = secret.channel;
var cryptKey = Hash.encodeBase64(secret.keys && secret.keys.cryptKey);
var src = Hash.getBlobPathFromHex(hexFileName);
Common.getFileSize(hexFileName, function (e, data) {
if (e || !data) {