summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/crypto.c9
-rw-r--r--src/write.c3
2 files changed, 7 insertions, 5 deletions
diff --git a/src/crypto.c b/src/crypto.c
index f6e2cd8..1172644 100644
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -64,12 +64,13 @@ void decrypt_buffer(Bytef *encrypted_buffer, uint64_t buffer_length,
uint8_t initial_key = xor_key & 0xff;
uint8_t primary_key = (xor_key >> 24 ^ xor_key >> 16 ^ \
xor_key >> 8 ^ xor_key) & 0xff;
- if (xor_key == 1 && initial_key == 0)
- initial_key = encryption_key.initial_fallback_key;
- else if (primary_key == 0)
+ if (primary_key == 0)
primary_key = encryption_key.primary_fallback_key;
- if (encryption_key.uses_initial_key)
+ if (encryption_key.uses_initial_key) {
+ if (initial_key == 0)
+ initial_key = encryption_key.initial_fallback_key;
encrypted_buffer[0] ^= initial_key;
+ }
for (uint64_t i = 0; i < buffer_length; i++) {
encrypted_buffer[i] ^= primary_key;
}
diff --git a/src/write.c b/src/write.c
index 5d9cbad..7a0d90e 100644
--- a/src/write.c
+++ b/src/write.c
@@ -68,7 +68,8 @@ void make_paths(char *file_name) {
*buffer++ = PATH_DELIMITER;
*buffer = '\0';
if (stat(buffer_start, &temp) == -1) {
- printf("Creating directory %s\n", buffer_start);
+ if (!arguments.quiet)
+ printf("Creating directory %s\n", buffer_start);
mkdir(buffer_start, 0777);
}
} else {