1 |
/* editkey.c - GPG edit key interface |
/* editkey.c - GPG edit key interface |
2 |
* Copyright (C) 2001-2004 Timo Schulz |
* Copyright (C) 2001-2005 Timo Schulz |
3 |
* |
* |
4 |
* This file is part of MyGPGME. |
* This file is part of MyGPGME. |
5 |
* |
* |
63 |
if (ctx->out_of_core) |
if (ctx->out_of_core) |
64 |
return; |
return; |
65 |
|
|
66 |
if (ctx->result_type == RESULT_TYPE_NONE) |
if (ctx->result_type == RESULT_TYPE_NONE) { |
|
{ |
|
67 |
ctx->result.editk = calloc (1, sizeof * ctx->result.editk); |
ctx->result.editk = calloc (1, sizeof * ctx->result.editk); |
68 |
if (!ctx->result.editk) |
if (!ctx->result.editk) { |
|
{ |
|
69 |
ctx->out_of_core = 1; |
ctx->out_of_core = 1; |
70 |
return; |
return; |
71 |
} |
} |
288 |
|
|
289 |
|
|
290 |
static const char* |
static const char* |
291 |
cmd_addkey_handler( gpgme_editkey_t ctx, gpg_status_code_t code, const char *key ) |
cmd_addkey_handler (gpgme_editkey_t ctx, gpg_status_code_t code, const char *key) |
292 |
{ |
{ |
293 |
static char buf[64]; |
static char buf[64]; |
294 |
|
|
522 |
{ |
{ |
523 |
int step = *r_step; |
int step = *r_step; |
524 |
|
|
525 |
|
|
526 |
/*DEBUG3("code=%d key=%s step=%d\n", code, key, step);*/ |
/*DEBUG3("code=%d key=%s step=%d\n", code, key, step);*/ |
527 |
if ((step == 0 || c->result.editk->already_signed) |
if ((step == 0 /*|| c->result.editk->already_signed*/) |
528 |
&& do_check (code, GET_LINE, key, "keyedit.add_revoker")) { |
&& do_check (code, GET_LINE, key, "keyedit.add_revoker")) { |
529 |
*r_step = step = 1; |
*r_step = step = 1; |
530 |
if (c->result.editk->already_signed) { |
if (c->result.editk && c->result.editk->already_signed) { |
531 |
*r_step = step = 3; |
*r_step = step = 3; |
532 |
return ""; |
return ""; |
533 |
} |
} |
827 |
else if (use_key_check && ctx->result.editk->key_expired) |
else if (use_key_check && ctx->result.editk->key_expired) |
828 |
rc = mk_error (Invalid_Mode); |
rc = mk_error (Invalid_Mode); |
829 |
else if( gpgme_get_process_rc( ctx ) ) |
else if( gpgme_get_process_rc( ctx ) ) |
830 |
rc = mk_error( Interal_GPG_Problem ); |
rc = mk_error( Internal_GPG_Problem ); |
831 |
} |
} |
832 |
return rc; |
return rc; |
833 |
} /* gpgme_op_editkey */ |
} /* gpgme_op_editkey */ |