Good day.

I would like to report what I believe to be an oversight in the Python
wrapper of GPGME.

I am reporting it here as it is a minor thing, and account creation is
disabled on the bug tracker at dev.gnupg.org. I would also prefer not
to make an account if possible.

In the interact(...) function of the Context class on line 1089 in
core.py it is checked whether a key is actually passed in to the
function:

if key is None:
    raise ValueError("First argument cannot be None")

Which is fine when editing a key, but when interacting with a smart
card (setting the flag INTERACT_CARD) - for example to generate a key
on it - there is not necessarily a key to be edited.

In interact_start(...) on line 131 of edit.c the presence of the key is
only checked if card_edit isn't set:

if ((card_edit == 0 && !key) || !fnc || !out)
  return gpg_error (GPG_ERR_INV_VALUE);

This functions is called by gpgme_op_interact(...) in the same file
which is called from Python in the aforementioned interact(...)
function.

Thus I believe that the intended behavior in Python would be to mirror
the C code and only check whether the key is None if INTERACT_CARD is
not set.

Please correct me if I am wrong and point me in the right direction.

Thanks in advance
- meep

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Gnupg-devel mailing list
[email protected]
https://lists.gnupg.org/mailman/listinfo/gnupg-devel

Reply via email to