Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Change-Id: I23fed938dd87afb6363723dc54eb35cb53dd960a
#define MEDIA_EXCLUSION_LIST "temp_video/Camera/DCIM:mp3|mpga|m4a|mp4|wav|amr|awb|wma|ogg|oga|aac|mka|flac|3gp|3ga|mid|midi|xmf|rtttl|rtx|ota|smf|spm|imy|mpeg|m4v|3gp|3gpp|3g2|3gpp2|wmv|asf|mkv|webm|ts|avi|jpg|jpeg|gif|png|bmp|wbmp|divx|flv|ac3|mov|tiff|f4v|mpeg3|voice"
#define CIPHER_MODE "aes"
#define MEDIA_EXCLUSION_LIST "temp_video/Camera/DCIM:mp3|mpga|m4a|mp4|wav|amr|awb|wma|ogg|oga|aac|mka|flac|3gp|3ga|mid|midi|xmf|rtttl|rtx|ota|smf|spm|imy|mpeg|m4v|3gp|3gpp|3g2|3gpp2|wmv|asf|mkv|webm|ts|avi|jpg|jpeg|gif|png|bmp|wbmp|divx|flv|ac3|mov|tiff|f4v|mpeg3|voice"
#define CIPHER_MODE "aes"
-#define ENCRYPTION_TMP_DIR ".ecryptfs_encrypted"
+#define ENCRYPTION_TMP_DIR ".ecryptfs_temp"
#define ECRYPTFS_VERSION_MAJOR 0x00
#define ECRYPTFS_VERSION_MAJOR 0x00
if (tempDir.exists()) {
tempDir.remove(true);
}
if (tempDir.exists()) {
tempDir.remove(true);
}
if (!(options & OPTION_ONLY_NEW_FILE)) {
copyInPlace(destination, destination, tempDir.getPath(),
[](const std::string &file) {
if (!(options & OPTION_ONLY_NEW_FILE)) {
copyInPlace(destination, destination, tempDir.getPath(),
[](const std::string &file) {
this->progress.update(current * 100 / totalSize);
});
}
this->progress.update(current * 100 / totalSize);
});
}
+
+ tempDir.remove(true);
} catch (runtime::Exception &e) {
try {
ecryptfsUmount(destination);
} catch (runtime::Exception &e) {
try {
ecryptfsUmount(destination);
runtime::File tempDir(source + "/" ENCRYPTION_TMP_DIR);
runtime::File tempMountpoint(tempDir.getPath() + "/mount");
runtime::File tempDir(source + "/" ENCRYPTION_TMP_DIR);
runtime::File tempMountpoint(tempDir.getPath() + "/mount");
+ if (tempDir.exists()) {
+ tempDir.remove(true);
+ }
tempDir.makeDirectory();
tempMountpoint.makeDirectory();
tempDir.makeDirectory();
tempMountpoint.makeDirectory();
INSERT_SD_CARD,
INTERNAL_ENCRYPT_PASSWORD,
INTERNAL_DECRYPT_PASSWORD,
INSERT_SD_CARD,
INTERNAL_ENCRYPT_PASSWORD,
INTERNAL_DECRYPT_PASSWORD,
+ EXTERNAL_DECRYPT_PASSWORD,
break;
case ENCRYPT_SD_CARD:
dlog_print(DLOG_DEBUG, LOG_TAG, "encrypt sd card confrim");
break;
case ENCRYPT_SD_CARD:
dlog_print(DLOG_DEBUG, LOG_TAG, "encrypt sd card confrim");
- create_base_window();
- create_progress_view("Encrypting", "External");
ret = ode_external_encryption_encrypt(ad->entry_data, 0);
if (ret != 0) {
dlog_print(DLOG_DEBUG, LOG_TAG, "external encryption failed");
}
ret = ode_external_encryption_encrypt(ad->entry_data, 0);
if (ret != 0) {
dlog_print(DLOG_DEBUG, LOG_TAG, "external encryption failed");
}
+ create_base_window();
+ create_progress_view("Encrypting", "External");
break;
case DECRYPT_SD_CARD:
dlog_print(DLOG_DEBUG, LOG_TAG, "decrypt sd card confrim");
break;
case DECRYPT_SD_CARD:
dlog_print(DLOG_DEBUG, LOG_TAG, "decrypt sd card confrim");
- create_base_window();
- create_progress_view("Decrypting", "External");
- ret = ode_external_encryption_decrypt(ad->entry_data);
- if (ret != 0) {
- dlog_print(DLOG_DEBUG, LOG_TAG, "external decryption failed");
- }
+ popup_data.parent = ad->base;
+ popup_data.popup = NULL;
+ popup_data.mode = EXTERNAL_DECRYPT_PASSWORD;
+ create_confirm_password_popup(&popup_data);
popup_data_s *popup_data = (popup_data_s *)data;
/* for temporary start */
popup_data_s *popup_data = (popup_data_s *)data;
/* for temporary start */
- if (popup_data->mode == INTERNAL_ENCRYPT_PASSWORD || popup_data->mode == INTERNAL_DECRYPT_PASSWORD) {
+ if (popup_data->mode == INTERNAL_ENCRYPT_PASSWORD || popup_data->mode == INTERNAL_DECRYPT_PASSWORD || popup_data->mode == EXTERNAL_DECRYPT_PASSWORD) {
snprintf(popup_data->entry_data, PATH_MAX, "%s", elm_entry_entry_get(confirm_entry));
evas_object_del(popup_data->popup);
password_result_callback(popup_data, "success");
snprintf(popup_data->entry_data, PATH_MAX, "%s", elm_entry_entry_get(confirm_entry));
evas_object_del(popup_data->popup);
password_result_callback(popup_data, "success");
+ case EXTERNAL_DECRYPT_PASSWORD:
+ ret = ode_external_encryption_decrypt(data->entry_data);
+ if (ret != 0) {
+ dlog_print(DLOG_DEBUG, LOG_TAG, "failed to decrypt internal storage");
+ return;
+ }
+ create_base_window();
+ create_progress_view("Decrypting", "External");
+ break;
/* for temporary end */
default:
break;
/* for temporary end */
default:
break;