adding secret keys on demand keysync
authorVolker Birk <vb@pep.foundation>
Wed, 31 Aug 2016 12:10:26 +0200
branchkeysync
changeset 110481cabcd37300
parent 1103 aba4f9ea5bce
child 1105 3fbdd80f0e52
adding secret keys on demand
src/sync_impl.c
     1.1 --- a/src/sync_impl.c	Wed Aug 31 11:50:49 2016 +0200
     1.2 +++ b/src/sync_impl.c	Wed Aug 31 12:10:26 2016 +0200
     1.3 @@ -251,7 +251,18 @@
     1.4                  status = PEP_SYNC_NO_TRUST;
     1.5                  goto error;
     1.6              }
     1.7 -            // FIXME: actually add secret keys here
     1.8 +            
     1.9 +            IdentityList_t *list = &msg->payload.choice.groupKeys.ownIdentities;
    1.10 +            for (int i=0; i<list->list.count; i++) {
    1.11 +                Identity_t *ident = list->list.array[i];
    1.12 +                bloblist_t *bl = bloblist_add(_message->attachments,
    1.13 +                        (char *) ident->fpr.buf, ident->fpr.size,
    1.14 +                        "application/pgp-keys", "");
    1.15 +                if (!bl)
    1.16 +                    goto enomem;
    1.17 +                if (!_message->attachments)
    1.18 +                    _message->attachments = bl;
    1.19 +            }
    1.20          }
    1.21  
    1.22          message *_encrypted = NULL;