Commit 7762e230 authored by Roberto Sassu's avatar Roberto Sassu Committed by Tyler Hicks

eCryptfs: modified size of keysig in the ecryptfs_key_sig structure

The size of the 'keysig' array is incremented of one byte in order to make
room for the NULL character. The 'keysig' variable is used, in the function
ecryptfs_generate_key_packet_set(), to find an authentication token with
the given signature and is printed a debug message if it cannot be
retrieved.
Signed-off-by: default avatarRoberto Sassu <roberto.sassu@polito.it>
Signed-off-by: default avatarTyler Hicks <tyhicks@linux.vnet.ibm.com>
parent cf35ca69
...@@ -233,7 +233,7 @@ ecryptfs_get_key_payload_data(struct key *key) ...@@ -233,7 +233,7 @@ ecryptfs_get_key_payload_data(struct key *key)
struct ecryptfs_key_sig { struct ecryptfs_key_sig {
struct list_head crypt_stat_list; struct list_head crypt_stat_list;
char keysig[ECRYPTFS_SIG_SIZE_HEX]; char keysig[ECRYPTFS_SIG_SIZE_HEX + 1];
}; };
struct ecryptfs_filename { struct ecryptfs_filename {
......
...@@ -2425,6 +2425,7 @@ int ecryptfs_add_keysig(struct ecryptfs_crypt_stat *crypt_stat, char *sig) ...@@ -2425,6 +2425,7 @@ int ecryptfs_add_keysig(struct ecryptfs_crypt_stat *crypt_stat, char *sig)
return -ENOMEM; return -ENOMEM;
} }
memcpy(new_key_sig->keysig, sig, ECRYPTFS_SIG_SIZE_HEX); memcpy(new_key_sig->keysig, sig, ECRYPTFS_SIG_SIZE_HEX);
new_key_sig->keysig[ECRYPTFS_SIG_SIZE_HEX] = '\0';
/* Caller must hold keysig_list_mutex */ /* Caller must hold keysig_list_mutex */
list_add(&new_key_sig->crypt_stat_list, &crypt_stat->keysig_list); list_add(&new_key_sig->crypt_stat_list, &crypt_stat->keysig_list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment