Skip to content

Issue with shared folder #2

@kionez

Description

@kionez

Hi,

I'm playing with your python library, and I wasn't able to use it for my purposes. After some time of try-and-error, I discovered how it's handled a shared folder, instead of "classsic" way to concatenate chunks such as {k: foo:bar} when it founds a folder shared with someone else, it concatenates as {k: foo1:bar1/foo2:bar2 }.

So i wrote a small patch which keeps only the first part of key chunk, and now it works fine on my account.

I hope it helps and please forgive my poor english :)

1: https://eu.static.mega.co.nz/crypto_5.js

--- megaclient.py.orig  2013-02-05 00:44:35.265816237 +0100
+++ megaclient.py   2013-02-05 00:45:05.589558279 +0100
@@ -57,7 +57,8 @@

     def processfile(self, file):
         if file['t'] == 0 or file['t'] == 1:
-            key = file['k'][file['k'].index(':') + 1:]
+            obj = file['k'].split('/')[0]
+            key = obj[obj.index(':') + 1:]
             key = decrypt_key(base64_to_a32(key), self.master_key)
             if file['t'] == 0:
                 k = file['k'] = (key[0] ^ key[4], key[1] ^ key[5], key[2] ^ key[6], key[3] ^ key[7])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions