mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
bitlk: avoid use ctime() with pointer to shared memory.
Use own buffer with ctime_r() is more secure.
This commit is contained in:
@@ -735,6 +735,7 @@ int BITLK_dump(struct crypt_device *cd, struct device *device, struct bitlk_meta
|
|||||||
{
|
{
|
||||||
struct volume_key *vk_p;
|
struct volume_key *vk_p;
|
||||||
struct bitlk_vmk *vmk_p;
|
struct bitlk_vmk *vmk_p;
|
||||||
|
char time[32];
|
||||||
int next_id = 0;
|
int next_id = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@@ -743,7 +744,8 @@ int BITLK_dump(struct crypt_device *cd, struct device *device, struct bitlk_meta
|
|||||||
log_std(cd, "GUID: \t%s\n", params->guid);
|
log_std(cd, "GUID: \t%s\n", params->guid);
|
||||||
log_std(cd, "Sector size: \t%u [bytes]\n", params->sector_size);
|
log_std(cd, "Sector size: \t%u [bytes]\n", params->sector_size);
|
||||||
log_std(cd, "Volume size: \t%" PRIu64 " [bytes]\n", params->volume_size);
|
log_std(cd, "Volume size: \t%" PRIu64 " [bytes]\n", params->volume_size);
|
||||||
log_std(cd, "Created: \t%s", ctime((time_t *)&(params->creation_time)));
|
if (ctime_r((time_t *)¶ms->creation_time, time))
|
||||||
|
log_std(cd, "Created: \t%s", time);
|
||||||
log_std(cd, "Description: \t%s\n", params->description);
|
log_std(cd, "Description: \t%s\n", params->description);
|
||||||
log_std(cd, "Cipher name: \t%s\n", params->cipher);
|
log_std(cd, "Cipher name: \t%s\n", params->cipher);
|
||||||
log_std(cd, "Cipher mode: \t%s\n", params->cipher_mode);
|
log_std(cd, "Cipher mode: \t%s\n", params->cipher_mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user