src/keymanagement.c
branchsync
changeset 3171 13355e5d4756
parent 3137 93877eafa715
child 3184 557a689068aa
     1.1 --- a/src/keymanagement.c	Mon Dec 03 12:26:02 2018 +0100
     1.2 +++ b/src/keymanagement.c	Tue Dec 04 14:29:28 2018 +0100
     1.3 @@ -1228,12 +1228,22 @@
     1.4  
     1.5      if (!(session && ident && ident->fpr))
     1.6          return PEP_ILLEGAL_VALUE;
     1.7 -            
     1.8 -        // See if key is revoked already
     1.9 +
    1.10 +    bool has_private = false;
    1.11 +    
    1.12 +    status = contains_priv_key(session, ident->fpr, &has_private);        
    1.13 +
    1.14 +    if (status != PEP_STATUS_OK && status != PEP_KEY_NOT_FOUND)
    1.15 +        return status;
    1.16 +        
    1.17 +    // See if key is revoked already
    1.18 +    if (has_private) {
    1.19          bool revoked = false;
    1.20          status = key_revoked(session, ident->fpr, &revoked);
    1.21 +
    1.22          if (!revoked)
    1.23              revoke_key(session, ident->fpr, NULL);
    1.24 +    }            
    1.25              
    1.26      // double-check to be sure key is even in the DB
    1.27      if (ident->fpr)