summaryrefslogtreecommitdiff
path: root/src/lib/eet
diff options
context:
space:
mode:
authorJiwon Kim <jwkim0000@gmail.com>2017-02-07 15:06:01 -0800
committerCedric BAIL <cedric@osg.samsung.com>2017-02-07 15:14:54 -0800
commit9fa4a5fb6dc5b616e67a6b47042b62c9dfcab167 (patch)
treec0ac75bed75db9d83ad906476c3c86bc017f066a /src/lib/eet
parent4279fe84057adbedeb9c117132ae1c0c2102a122 (diff)
eet: read sould be failed if cipher_key exist but file not ciphered
Summary: Currentely, if eet_read_cipher()'s cipher_key param is exist but file not ciphered, function always read and return successful result. But, this behavior can not check data integrity. e.g. 1. App create config file using eet with encryption key. 2. Attacker replace config to malicious config (not encryted). 3. App can not notice if eet_read_cipher() read that successfully. @fix Test Plan: $eet -e test.cfg my_config test.src 1 $eet -d test.cfg my_config decode_res.txt my_encrytion_key (Currentely decode success, but should be failed) Reviewers: woohyun, raster Subscribers: id213sin, akanad, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4563 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/eet')
-rw-r--r--src/lib/eet/eet_lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c
index d2c95c220c..2930b0f1ed 100644
--- a/src/lib/eet/eet_lib.c
+++ b/src/lib/eet/eet_lib.c
@@ -1928,6 +1928,10 @@ eet_read_cipher(Eet_File *ef,
1928 if (!efn) 1928 if (!efn)
1929 goto on_error; 1929 goto on_error;
1930 1930
1931 /* Requested decryption but file not encrypted -> integrity violation */
1932 if (!efn->ciphered && cipher_key)
1933 goto on_error;
1934
1931 /* Get a binbuf attached to this efn */ 1935 /* Get a binbuf attached to this efn */
1932 in = read_binbuf_from_disk(ef, efn); 1936 in = read_binbuf_from_disk(ef, efn);
1933 if (!in) goto on_error; 1937 if (!in) goto on_error;