From: Lukasz Pawelczyk Date: Fri, 8 Sep 2017 10:18:05 +0000 (+0200) Subject: ExternalEncryption: Sync at the very end of the operation X-Git-Tag: submit/tizen/20170918.080130~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d4d58fc594bd6129cbe84d4f27f48e48fc919aa;p=platform%2Fcore%2Fsecurity%2Fode.git ExternalEncryption: Sync at the very end of the operation Change-Id: Iec7639130371d1bd2e393e8a71bf11cd4eabd190 --- diff --git a/server/external-encryption.cpp b/server/external-encryption.cpp index 65373a2..0690f2c 100644 --- a/server/external-encryption.cpp +++ b/server/external-encryption.cpp @@ -310,11 +310,11 @@ int ExternalEncryption::encrypt(const std::string &password, unsigned int option INFO(SINK, "Encryption started..."); engine->encrypt(MasterKey, options); setOptions(options & getSupportedOptions()); - INFO(SINK, "Sync disk..."); - sync(); INFO(SINK, "Encryption completed"); ::vconf_set_str(EXTERNAL_STATE_VCONF_KEY, "encrypted"); context.notify("ExternalEncryption::mount"); + INFO(SINK, "Sync disk..."); + sync(); } catch (runtime::Exception &e) { ::vconf_set_str(EXTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); ERROR(SINK, "Encryption failed - " + std::string(e.what())); @@ -358,10 +358,10 @@ int ExternalEncryption::decrypt(const std::string &password) INFO(SINK, "Decryption started..."); ::vconf_set_str(EXTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); engine->decrypt(MasterKey, getOptions()); - INFO(SINK, "Sync disk..."); - sync(); INFO(SINK, "Decryption completed"); ::vconf_set_str(EXTERNAL_STATE_VCONF_KEY, "unencrypted"); + INFO(SINK, "Sync disk..."); + sync(); } catch (runtime::Exception &e) { ERROR(SINK, "Decryption failed - " + std::string(e.what())); }