set pgp keypair in set_trust sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Tue, 16 Apr 2019 16:38:33 +0200
branchsync
changeset 3533a43f28ac5c9b
parent 3532 4fff402f6c9f
child 3534 aeeca2b084fc
child 3535 3beb2f01130e
set pgp keypair in set_trust
src/pEpEngine.c
     1.1 --- a/src/pEpEngine.c	Tue Apr 16 13:11:02 2019 +0200
     1.2 +++ b/src/pEpEngine.c	Tue Apr 16 16:38:33 2019 +0200
     1.3 @@ -2821,8 +2821,6 @@
     1.4      return status;
     1.5  }
     1.6  
     1.7 -// FIXME: We can rollback in set_identity on the return status,
     1.8 -// so we should probably do that.
     1.9  PEP_STATUS set_pgp_keypair(PEP_SESSION session, const char* fpr) {
    1.10      if (!session || EMPTYSTR(fpr))
    1.11          return PEP_ILLEGAL_VALUE;
    1.12 @@ -2853,6 +2851,10 @@
    1.13      if (!session || !identity || EMPTYSTR(identity->user_id) || EMPTYSTR(identity->fpr))
    1.14          return PEP_ILLEGAL_VALUE;
    1.15          
    1.16 +    PEP_STATUS status = set_pgp_keypair(session, identity->fpr);
    1.17 +    if (status != PEP_STATUS_OK)
    1.18 +        return status;
    1.19 +        
    1.20      int result;
    1.21                  
    1.22      sqlite3_reset(set_or_update);