#7 OpenPGP - Lookup key - uids

Closed
opened 2 months ago by DebXWoody · 1 comments

Es fehlt eine Iteration über die UIDs. Is die XMPP-Adresse nicht an erster Stelle, findet die Anwendung den Key nicht.

Muss dann so in der Art aussehen:

gpgme_error_t _openpgp_lookup_key(xmppc_t *xmppc,char* name, gpgme_ctx_t* ctx, gpgme_key_t* key) {
  logDebug(xmppc, "Looking for key: %s ...\n", name);
  gpgme_error_t error = gpgme_op_keylist_start (*ctx, NULL, 0);
  while (!error) {
    error = gpgme_op_keylist_next (*ctx, key);
    if(!error) {
      gpgme_user_id_t uids = (*key)->uids;
      while (uids) {
        if(strcmp(uids->name, name) == 0) {
         logDebug(xmppc, "Key found: %s ...\n", uids->name);
         return error;
        }
        uids=uids->next;
      }
    } else {
      gpgme_key_release((*key));
    }
  }
  return error;
}
Es fehlt eine Iteration über die UIDs. Is die XMPP-Adresse nicht an erster Stelle, findet die Anwendung den Key nicht. Muss dann so in der Art aussehen: ``` gpgme_error_t _openpgp_lookup_key(xmppc_t *xmppc,char* name, gpgme_ctx_t* ctx, gpgme_key_t* key) { logDebug(xmppc, "Looking for key: %s ...\n", name); gpgme_error_t error = gpgme_op_keylist_start (*ctx, NULL, 0); while (!error) { error = gpgme_op_keylist_next (*ctx, key); if(!error) { gpgme_user_id_t uids = (*key)->uids; while (uids) { if(strcmp(uids->name, name) == 0) { logDebug(xmppc, "Key found: %s ...\n", uids->name); return error; } uids=uids->next; } } else { gpgme_key_release((*key)); } } return error; } ```
DebXWoody added this to the 0.0.6 milestone 2 months ago
DebXWoody added the
bug
label 2 months ago
DebXWoody self-assigned this 2 months ago
DebXWoody commented 2 months ago
Poster

Fixed: 24eab6f6e0

Fixed: https://codeberg.org/Anoxinon_e.V./xmppc/commit/24eab6f6e08bfa75cf3002e9454ca83c06e7accd
DebXWoody closed this issue 2 months ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.