-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keys export import #707
Keys export import #707
Conversation
Import/Export works but the event DC_EVENT_IMEX_FILE_WRITTEN is not fired since somehow the export tries twice to write the file which results in an error: Cannot delete "/tmp/private-key-default.asc". So keys are exported but we can't show a confirmation message.
@Karissa mentioned it should ask for the password. But which one? The password for password protected keys? |
The password to the account which is checked by logging in or checking the config var in the backend. Use an IPC call for this. |
Hmm, the account password is easily to get from the settings since 4925f93 so this would not really improve security. The android app asks for the PIN (of the phone) when you export the secret keys. But afaik it is not possible to ask for the users OS account password with electron. Might be useful to introduce some PIN/password protection for deltachat desktop but that's another topic... |
_locales/_experimental_en.json
Outdated
}, | ||
"settings_manage_keys": { | ||
"message": "Manage Keys" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use the already translated translation keys? I think they are adequate to the ones here. Maybe some leftovers of the old pr from @Karissa? We now have access to all the translations which we also use on deltachat-android.
"pref_managekeys_menu_title": {
"message": "Manage keys"
},
"pref_managekeys_ask_for_storage_permission": {
"message": "Delta Chat needs access to your files to import/export keys."
},
"pref_managekeys_export_secret_keys": {
"message": "Export secret keys"
},
"pref_managekeys_export_explain": {
"message": "Export secret keys to \"%1$s\"?"
},
"pref_managekeys_import_secret_keys": {
"message": "Import secret keys"
},
"pref_managekeys_import_explain": {
"message": "Import secret keys from \"%1$s\"?\n\n• Existing secret keys will not be deleted\n\n• The last imported key will be used as the new default key unless it has the word \"legacy\" in its filename"
},
"pref_managekeys_secret_keys_exported_to_x": {
"message": "Secret keys written successfully to \"%1$s\"."
},
"pref_managekeys_secret_keys_imported_from_x": {
"message": "Secret keys imported from \"%1$s\"."
},
DC_EVENT_IMEX_FILE_WRITTEN should be triggered after keys are exported, but is not...? |
Good question. Maybe @r10s can help us on this question. |
it's a bug in core, i'll fix it. |
So this works fine now with the fix in core. Except the fact that we can't show a success message after having successfully imported keys since there is no event for that. Even if a DC_EVENT_IMEX_FILE_WRITTEN event would be triggered in https://github.com/deltachat/deltachat-core/blob/master/src/dc_imex.c#L706 we couldn't distinguish in the event handler which action triggered it. |
it's all about export? there are the events DC_EVENT_IMEX_PROGRESS - on success 1000 permille will be reported, on failure, it's 0. in fact, these events do not regard single export failed. i'll change this in the branch. @nicodh thanks for having a closer look at this :) it is obviously one of the parts that lacks some details :) |
i've updated the branch, DC_EVENT_IMEX_PROGRESS reports success/failure on exporting keys now (same as for backups). wrt to decide whether the event belongs to a backup or to a key-export (or whatever will be added in the future - location-export?): there is always only one export/import running at the same time. so, you can just remember the last action started. |
continues #474