Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/rres-raylib.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,9 @@ int UnpackResourceChunk(rresResourceChunk *chunk)
.nb_lanes = 1 // Single-threaded
};
crypto_argon2_inputs inputs = {
.pass = (const uint8_t *)rresGetCipherPassword(), // User password
.pass = (const uint8_t *)rresGetCipherPassword(), // User password
.pass_size = 16, // Password length
.salt = salt, // Salt for the password
.pass_size = (uint32_t)strlen(rresGetCipherPassword()), // Password length
.salt_size = 16
};
crypto_argon2_extras extras = { 0 }; // Extra parameters unused
Expand Down Expand Up @@ -640,9 +640,9 @@ int UnpackResourceChunk(rresResourceChunk *chunk)
.nb_lanes = 1 // Single-threaded
};
crypto_argon2_inputs inputs = {
.pass = (const uint8_t *)rresGetCipherPassword(), // User password
.salt = salt, // Salt for the password
.pass_size = (uint32_t)strlen(rresGetCipherPassword()), // Password length
.pass = (const uint8_t *)rresGetCipherPassword(), // User password
.pass_size = 16, // Password length
.salt = salt, // Salt for the password
.salt_size = 16
};
crypto_argon2_extras extras = { 0 }; // Extra parameters unused
Expand All @@ -666,7 +666,7 @@ int UnpackResourceChunk(rresResourceChunk *chunk)
memcpy(mac, ((unsigned char *)chunk->data.raw) + (chunk->info.packedSize - 16), 16);

// Message decryption requires key, nonce and MAC
int decryptResult = crypto_aead_unlock(decryptedData, mac, key, nonce, NULL, 0, (unsigned char *)chunk->data.raw, (chunk->info.packedSize - 16 - 24 - 16));
int decryptResult = crypto_aead_unlock(decryptedData, mac, key, nonce, NULL, 0, chunk->data.raw, (chunk->info.packedSize - 16 - 24 - 16));

// Wipe secrets if they are no longer needed
crypto_wipe(nonce, 24);
Expand Down