aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-28 23:12:51 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-28 23:12:51 +0100
commit94152da2ef18a673a996e3d5cfb3780a8f5f7feb (patch)
tree792a486ea8cdca345e17a5b377eb42701b432a1b /src/plugins
parente12e7e960ee36607f6107a28c0935e8c2a006632 (diff)
Matrix: ignore expired and revoked signatures for gpg encrypt
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index d93c64a..6040edd 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -123,6 +123,7 @@ namespace QuickMedia {
string_split(output, '\n', [&](const char *str, size_t size) {
GpgLineType line_type = GpgLineType::UNKNOWN;
int column = 0;
+ bool invalid_signature = false;
string_split_view(std::string_view(str, size), ':', [&](const char *str, size_t size) {
std::string_view section(str, size);
@@ -131,8 +132,11 @@ namespace QuickMedia {
line_type = GpgLineType::UID;
else if(section == "fpr")
line_type = GpgLineType::FPR;
+ } else if(column == 1) {
+ if(line_type == GpgLineType::UID)
+ invalid_signature = (section == "e" || section == "r"); // Expired or revoked
} else if(column == 9) {
- if(line_type == GpgLineType::UID) {
+ if(line_type == GpgLineType::UID && !invalid_signature) {
// Assumes that each uid is preceeded with fpr
const std::string user_email = std::string(gpg_display_name_extract_email(section));
if(!user_email.empty() && users_by_email.find(user_email) != users_by_email.end()) {