From: Sungbae Yoo Date: Mon, 13 Feb 2017 11:29:09 +0000 (+0900) Subject: Change not to reboot when error occurs in internal encryption X-Git-Tag: submit/tizen/20170214.101511~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F114483%2F2;p=platform%2Fcore%2Fsecurity%2Fode.git Change not to reboot when error occurs in internal encryption Signed-off-by: Sungbae Yoo Change-Id: I4dd7bb8697625b958eedfc21273d291136c79763 --- diff --git a/server/internal-encryption.cpp b/server/internal-encryption.cpp index d015184..4dbcf13 100644 --- a/server/internal-encryption.cpp +++ b/server/internal-encryption.cpp @@ -215,7 +215,6 @@ int InternalEncryption::encrypt(const std::string& password, unsigned int option } INFO("Encryption started..."); - ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); engine->encrypt(MasterKey, options); setOptions(options & getSupportedOptions()); INFO("Sync disk..."); @@ -223,10 +222,11 @@ int InternalEncryption::encrypt(const std::string& password, unsigned int option INFO("Encryption completed"); ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "encrypted"); + ::reboot(RB_AUTOBOOT); } catch (runtime::Exception &e) { + ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); ERROR("Encryption failed - " + std::string(e.what())); } - ::reboot(RB_AUTOBOOT); }; std::thread asyncWork(encryptWorker); @@ -266,17 +266,17 @@ int InternalEncryption::decrypt(const std::string& password) } INFO("Decryption started..."); - ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); engine->decrypt(MasterKey, getOptions()); INFO("Sync disk..."); sync(); INFO("Decryption completed"); ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "unencrypted"); + ::reboot(RB_AUTOBOOT); } catch (runtime::Exception &e) { + ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); ERROR("Decryption failed - " + std::string(e.what())); } - ::reboot(RB_AUTOBOOT); }; std::thread asyncWork(decryptWorker);