aboutsummaryrefslogtreecommitdiff
path: root/plugins/openpgp/src/encryption_list_entry.vala
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/openpgp/src/encryption_list_entry.vala')
-rw-r--r--plugins/openpgp/src/encryption_list_entry.vala9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/openpgp/src/encryption_list_entry.vala b/plugins/openpgp/src/encryption_list_entry.vala
index cf5da8c4..5e61df8d 100644
--- a/plugins/openpgp/src/encryption_list_entry.vala
+++ b/plugins/openpgp/src/encryption_list_entry.vala
@@ -32,6 +32,7 @@ private class EncryptionListEntry : Plugins.EncryptionListEntry, Object {
return null;
}
+
public void encryption_activated(Entities.Conversation conversation, Plugins.SetInputFieldStatus input_status_callback) {
try {
GPGHelper.get_public_key(db.get_account_key(conversation.account) ?? "");
@@ -40,6 +41,14 @@ private class EncryptionListEntry : Plugins.EncryptionListEntry, Object {
return;
}
+ GPG.Key key_check = GPGHelper.get_public_key(db.get_account_key(conversation.account));
+ if (key_check.expired || key_check.revoked){
+ string status_str = key_check.expired ? " has expired." : " has been revoked.";
+ debug("GPG public key %s is NOT fine for encryption: it %s.\n", key_check.fpr, status_str);
+ input_status_callback(new Plugins.InputFieldStatus("Your GPG key " + key_check.fpr + status_str, Plugins.InputFieldStatus.MessageType.ERROR, Plugins.InputFieldStatus.InputState.NO_SEND));
+ return;
+ }
+
if (conversation.type_ == Conversation.Type.CHAT) {
string? key_id = stream_interactor.get_module(Manager.IDENTITY).get_key_id(conversation.account, conversation.counterpart);
if (key_id == null) {