Implement data decryption as well.
[bluesky.git] / bluesky / inode.c
index 42b045c..e4902cd 100644 (file)
@@ -342,8 +342,9 @@ void bluesky_block_fetch(BlueSkyFS *fs, BlueSkyBlock *block)
     BlueSkyRCStr *string = s3store_get(fs->store, block->ref);
 
     bluesky_string_unref(block->data);
-    block->data = string;
+    block->data = bluesky_crypt_decrypt(string, fs->encryption_key);
     block->type = BLUESKY_BLOCK_CACHED;
+    bluesky_string_unref(string);
 }
 
 /* Write the given block to cloud-backed storage and mark it clean. */