summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-01-25 14:54:59 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2014-01-25 14:54:59 +0100
commitda4a34838def1e07d8ed678a3e61e391290f6ab8 (patch)
treed0d107f42dbb2c84bcff46b6f58eb69eef752a0c /src
parent9ecd18f7ddb83ab47c6b63ca28c953db204404fa (diff)
header_check_ecryptfs: code style modification
Diffstat (limited to 'src')
-rw-r--r--src/file_ecryptfs.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/file_ecryptfs.c b/src/file_ecryptfs.c
index 0c1ec8c..9f18b14 100644
--- a/src/file_ecryptfs.c
+++ b/src/file_ecryptfs.c
@@ -72,19 +72,17 @@ static void file_check_ecryptfs(file_recovery_t *file_recovery)
static int header_check_ecryptfs(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
{
const struct ecrypfs_header *e=(const struct ecrypfs_header *)buffer;
- if((be32(e->marker1) ^ be32(e->marker2)) == 0x3c81b7f5)
- {
- reset_file_recovery(file_recovery_new);
+ if((be32(e->marker1) ^ be32(e->marker2)) != 0x3c81b7f5)
+ return 0;
+ reset_file_recovery(file_recovery_new);
#ifdef DJGPP
- file_recovery_new->extension="ecr";
+ file_recovery_new->extension="ecr";
#else
- file_recovery_new->extension=file_hint_ecryptfs.extension;
+ file_recovery_new->extension=file_hint_ecryptfs.extension;
#endif
- file_recovery_new->min_filesize=be64(e->unencrypted_file_size);
- file_recovery_new->calculated_file_size=be64(e->unencrypted_file_size);
- file_recovery_new->data_check=NULL;
- file_recovery_new->file_check=&file_check_ecryptfs;
- return 1;
- }
- return 0;
+ file_recovery_new->min_filesize=be64(e->unencrypted_file_size);
+ file_recovery_new->calculated_file_size=be64(e->unencrypted_file_size);
+ file_recovery_new->data_check=NULL;
+ file_recovery_new->file_check=&file_check_ecryptfs;
+ return 1;
}