eet: read sould be failed if cipher_key exist but file not ciphered
authorJiwon Kim <jwkim0000@gmail.com>
Tue, 7 Feb 2017 23:06:01 +0000 (15:06 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Tue, 7 Feb 2017 23:14:54 +0000 (15:14 -0800)
commit9fa4a5fb6dc5b616e67a6b47042b62c9dfcab167
treec0ac75bed75db9d83ad906476c3c86bc017f066a
parent4279fe84057adbedeb9c117132ae1c0c2102a122
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>
src/lib/eet/eet_lib.c