Revocation-related fixes
authorEdouard Tisserant
Sun, 29 May 2016 21:26:46 +0200
changeset 697c6ee542ba702
parent 695 b8d403779089
child 698 870bbc6ea19c
Revocation-related fixes
src/keymanagement.c
     1.1 --- a/src/keymanagement.c	Sun May 29 00:11:56 2016 +0200
     1.2 +++ b/src/keymanagement.c	Sun May 29 21:26:46 2016 +0200
     1.3 @@ -383,9 +383,8 @@
     1.4      {        
     1.5          if(revoked)
     1.6          {
     1.7 -            r_fpr = strdup(identity->fpr);
     1.8 -            if(!r_fpr)
     1.9 -                return PEP_OUT_OF_MEMORY;
    1.10 +            r_fpr = identity->fpr;
    1.11 +            identity->fpr = NULL;
    1.12          }
    1.13          
    1.14          DEBUG_LOG("generating key pair", "debug", identity->address);
    1.15 @@ -515,8 +514,14 @@
    1.16          return PEP_ILLEGAL_VALUE;
    1.17  
    1.18      if (ident->me)
    1.19 +    {
    1.20          revoke_key(session, ident->fpr, NULL);
    1.21 -    status = mark_as_compromized(session, ident->fpr);
    1.22 +        myself(session, ident);
    1.23 +    }
    1.24 +    else
    1.25 +    {
    1.26 +        status = mark_as_compromized(session, ident->fpr);
    1.27 +    }
    1.28  
    1.29      return status;
    1.30  }