X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fode%2Fode-tests-common.cpp;h=651ded751bd8d58abfea63aaf4b221ecf698d418;hb=bb043095fbd2d11e52670b9395911768b7981a2e;hp=e3b314d724c50acdd67ee131a56b9a9dd7ea6d98;hpb=dcbc576c55c741c3cf0d2a44fab2a815fc6a48b2;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git diff --git a/src/ode/ode-tests-common.cpp b/src/ode/ode-tests-common.cpp index e3b314d..651ded7 100644 --- a/src/ode/ode-tests-common.cpp +++ b/src/ode/ode-tests-common.cpp @@ -18,8 +18,13 @@ * @brief Tests for the ODE API */ +#include +#include + #include + #include +#include #include "ode-tests-common.h" #define ERRORDESCRIBE(name) case name: return #name @@ -42,6 +47,8 @@ const char* ODEErrorToString(int error) { #undef ERRORDESCRIBE +// helper classes + HelperKeys::HelperKeys(const char* device, const char* password, bool initialize) { dev = device; pass = password; @@ -59,4 +66,20 @@ HelperKeys::HelperKeys(const char* device, const char* password, bool initialize HelperKeys::~HelperKeys() { ode_key_remove_master_key(dev); ode_key_remove(dev, pass); -}; +} + +HelperInternalEncryption::HelperInternalEncryption(const char* password) { + pass = password; + + bool result; + assert_positive(ode_internal_encryption_is_password_initialized, &result); + + if (!result) { + assert_positive(ode_internal_encryption_init_password, pass); + } +} + +HelperInternalEncryption::~HelperInternalEncryption() { + ode_internal_encryption_umount(); + ode_internal_encryption_clean_password(pass); +}