Skip to content
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

Attempt to not display revoked keys #1566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cjj20
Copy link

@cjj20 cjj20 commented Mar 27, 2024

This is my attempt to not display revoked keys.

@cjj20 cjj20 marked this pull request as draft March 27, 2024 17:49
@cjj20 cjj20 marked this pull request as ready for review March 27, 2024 17:56
@cjj20
Copy link
Author

cjj20 commented Mar 27, 2024

@fiaxh please review

@fiaxh
Copy link
Member

fiaxh commented Apr 4, 2024

Please compile your code and test it before submitting it - this code doesn't even compile.

It also needs lots of cleanup, for example you shouldn't add random commented-out code.

@cjj20
Copy link
Author

cjj20 commented Apr 9, 2024

Please compile your code and test it before submitting it - this code doesn't even compile.

It also needs lots of cleanup, for example you shouldn't add random commented-out code.

Hi, my apologies and I have compiled but would like to try a new approach. That is using the Gtk.ListStore.remove function along with the gpgme boolean Revoked. I may alternatively grayout the revoked keys.

@cjj20
Copy link
Author

cjj20 commented Apr 16, 2024

Please compile your code and test it before submitting it - this code doesn't even compile.

It also needs lots of cleanup, for example you shouldn't add random commented-out code.
Improvement made, compiles and hides the revoked keys but only when freshly built. When closed then reopened, revoked keys shows up again. New PR contains changes #1572

@eerielili
Copy link
Contributor

eerielili commented Apr 16, 2024

hello @cjj20

Improvement made, compiles and hides the revoked keys but only when freshly built. When closed then reopened, revoked keys shows up again

I suggest you have a look at #1540 and this snippet:

public static Gee.List<Key> get_keylist(string? pattern = null, bool secret_only = false) throws GLib.Error {
global_mutex.lock();
try {
initialize();
Gee.List<Key> keys = new ArrayList<Key>();
Context context = Context.create();
context.op_keylist_start(pattern, secret_only ? 1 : 0);
try {
while (true) {
Key key = context.op_keylist_next();
if (!key.expired && !key.revoked){
debug("PGP Key " + key.fpr + " is valid!");
keys.add(key);
}
else {
debug("PGP Key " + key.fpr + " is either expired or revoked!");
}
}
} catch (Error e) {
if (e.code != GPGError.ErrorCode.EOF) throw e;
}
context.op_keylist_end();
return keys;
} finally {
global_mutex.unlock();
}
}

Putting the check for expired or revoked GPG keys in the get_keylist function does help not showing them ever again after restarting Dino.

Kinds regards,
lili

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants