leapcode/soledad — pull request #95 by andrejb (2013-11-18 14:16:01+00:00)
Title: Add MAC verification to recovery document. Closes #4348.

This modification adds a MAC verification to `import_recovery_documet()` and `export_recovery_document()`, and modifies soledad to set and retrieve the contents of both the `.secret` file and the recovery document stored on the shared database using these methods.

I have eliminated the `include_uuid` parameter from `export_recovery_document()` because (1) it was not used anywhere, (2) the recovery document on shared database must not be identifiable, and (3) the `.secret` file already contains the uuid in its name.

For now, the MAC is only verified when it is present, and as the structure of the stored file is the same these modifications should be backwards compatible. In the future we may want to make verification of the MAC obligatory.