Modify enum values for corrupted encryption 98/181298/3 accepted/tizen/4.0/unified/20180613.234958 submit/tizen_4.0/20180612.052541
authorseolheui kim <s414.kim@samsung.com>
Tue, 12 Jun 2018 02:22:01 +0000 (11:22 +0900)
committerseolheui kim <s414.kim@samsung.com>
Tue, 12 Jun 2018 05:00:36 +0000 (14:00 +0900)
- combine State::CorruptedEncryption and State::CorruptedDecryption with State::Corrupted
  to avoid build break since State::Corrupted is used in other packages.

Change-Id: I14ba9ee1c51dc35240a7151f7ddf545453555ced
Signed-off-by: seolheui kim <s414.kim@samsung.com>
lib/ode/common.h
rmi/external-encryption.h
rmi/internal-encryption.h
server/external-encryption.cpp
server/internal-encryption.cpp
tools/cli/ode-admin-cli.cpp

index f2fc30b..b84a848 100644 (file)
@@ -70,8 +70,7 @@ typedef enum {
 typedef enum {
     ODE_STATE_UNENCRYPTED   = 0x00, /**< Device is not encrypted */
     ODE_STATE_ENCRYPTED     = 0x01, /**< Device is encrypted  */
-    ODE_STATE_CORRUPTED_ENCRYPTION     = 0x02,  /**< Device is corrupted because of encryption error  */
-    ODE_STATE_CORRUPTED_DECRYPTION     = 0x03,  /**< Device is corrupted becouse of decryption error  */
+    ODE_STATE_CORRUPTED     = 0x02, /**< Device is corrupted because of encryption error */
 } ode_state_e;
 
 /**
index 540d947..b944090 100644 (file)
@@ -49,9 +49,8 @@ public:
        enum State {
                Unencrypted = 0x00,
                Encrypted   = 0x01,
-               CorruptedEncryption   = 0x02,
-               CorruptedDecryption   = 0x03,
-               Invalid = 0x04,
+               Corrupted   = 0x02,
+               Invalid     = 0x03,
        };
 
        virtual int getState() = 0;
index 659482e..c20f7f9 100644 (file)
@@ -48,9 +48,8 @@ public:
        enum State {
                Unencrypted = 0x00,
                Encrypted   = 0x01,
-               CorruptedEncryption   = 0x02,
-               CorruptedDecryption   = 0x03,
-               Invalid = 0x04,
+               Corrupted   = 0x02,
+               Invalid     = 0x03,
        };
 
        virtual int getState() = 0;
index dfed067..09af99f 100644 (file)
@@ -426,10 +426,8 @@ int ExternalEncryptionServer::getState()
                return State::Encrypted;
        else if (valueStr == "unencrypted")
                return State::Unencrypted;
-       else if (valueStr == "error_partially_encrypted")
-               return State::CorruptedEncryption;
-       else if (valueStr == "error_partially_decrypted")
-               return State::CorruptedDecryption;
+       else if (valueStr == "error_partially_encrypted" || valueStr == "error_partially_decrypted")
+               return State::Corrupted;
 
        return State::Invalid;
 }
index 1900f62..ed5b6fc 100644 (file)
@@ -510,7 +510,7 @@ int InternalEncryptionServer::recovery()
        if (state == State::Unencrypted)
                return error::NoSuchDevice;
 
-       if (state == State::CorruptedEncryption || state == State::CorruptedDecryption)
+       if (state == State::Corrupted)
                Ext4Tool::mkfs(engine->getSource());
 
        std::fstream fs;
@@ -571,10 +571,8 @@ int InternalEncryptionServer::getState()
                return State::Encrypted;
        else if (valueStr == "unencrypted")
                return State::Unencrypted;
-       else if (valueStr == "error_partially_encrypted")
-               return State::CorruptedEncryption;
-       else if (valueStr == "error_partially_decrypted")
-               return State::CorruptedDecryption;
+       else if (valueStr == "error_partially_encrypted" || valueStr == "error_partially_decrypted")
+               return State::Corrupted;
 
        return State::Invalid;
 }
index 5bdf1d1..7c8247b 100644 (file)
@@ -549,11 +549,8 @@ static inline int get_state(const std::string name)
        case ODE_STATE_UNENCRYPTED:
                std::cout << "Unencrypted";
                break;
-       case ODE_STATE_CORRUPTED_ENCRYPTION:
-               std::cout << "Corrupted Encryption";
-               break;
-       case ODE_STATE_CORRUPTED_DECRYPTION:
-               std::cout << "Corrupted Decryption";
+       case ODE_STATE_CORRUPTED:
+               std::cout << "Corrupted";
                break;
        default:
                std::cout << "Invalid";