From: s414.kim Date: Thu, 16 May 2019 06:14:51 +0000 (+0900) Subject: Replace internal encrypt/decrypt API with new start APIs X-Git-Tag: submit/tizen/20190816.084956~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73737171681a12bcaee11856152f802685f54ec5;p=platform%2Fcore%2Fsecurity%2Fode-ui.git Replace internal encrypt/decrypt API with new start APIs - For the UX changes, it should be replaced - The original encrypt/decrypt API will be invoked from stater Change-Id: I002ae3779ef509a8553f71de08ed662d243a2bda Signed-off-by: s414.kim --- diff --git a/ode/src/interface/internal/decrypt-device.cpp b/ode/src/interface/internal/decrypt-device.cpp index b89708a..5d2cce2 100644 --- a/ode/src/interface/internal/decrypt-device.cpp +++ b/ode/src/interface/internal/decrypt-device.cpp @@ -149,7 +149,7 @@ DecryptDeviceInterface::~DecryptDeviceInterface() void DecryptDeviceInterface::onConfirmed(const std::string ¤t) { - encryption.decrypt(current); + encryption.decrypt(); ::sleep(2); dispose(); } diff --git a/ode/src/interface/internal/encrypt-device.cpp b/ode/src/interface/internal/encrypt-device.cpp index 3eaea55..f15dcf4 100644 --- a/ode/src/interface/internal/encrypt-device.cpp +++ b/ode/src/interface/internal/encrypt-device.cpp @@ -235,7 +235,7 @@ EncryptDeviceInterface::~EncryptDeviceInterface() void EncryptDeviceInterface::onConfirmed(const std::string ¤t) { - encryption.encrypt(current, confirmPage->getOption()); + encryption.encrypt(confirmPage->getOption()); ::sleep(2); dispose(); } diff --git a/ode/src/interface/tools/encryption.cpp b/ode/src/interface/tools/encryption.cpp index 877b304..e7b6760 100644 --- a/ode/src/interface/tools/encryption.cpp +++ b/ode/src/interface/tools/encryption.cpp @@ -25,20 +25,14 @@ InternalEncryption::~InternalEncryption() { } -void InternalEncryption::encrypt(const std::string &pwd, int opt) +void InternalEncryption::encrypt(int opt) { - bool ret = false; - ::ode_internal_encryption_verify_password(pwd.c_str(), &ret); - if (!ret) { - return; - } - - ::ode_internal_encryption_encrypt(pwd.c_str(), opt); + ::ode_internal_encryption_prepare_encryption(opt); } -void InternalEncryption::decrypt(const std::string &pwd) +void InternalEncryption::decrypt() { - ::ode_internal_encryption_decrypt(pwd.c_str()); + ::ode_internal_encryption_prepare_decryption(); } ExternalEncryption::ExternalEncryption() diff --git a/ode/src/interface/tools/encryption.h b/ode/src/interface/tools/encryption.h index da6a795..5984c8a 100644 --- a/ode/src/interface/tools/encryption.h +++ b/ode/src/interface/tools/encryption.h @@ -30,8 +30,8 @@ public: InternalEncryption(); ~InternalEncryption(); - void encrypt(const std::string &pwd, int opt); - void decrypt(const std::string &pwd); + void encrypt(int opt); + void decrypt(); }; class ExternalEncryption {