Changeset View
Changeset View
Standalone View
Standalone View
g10/getkey.c
| Context not available. | |||||
| kbnode_t *ret_keyblock, kbnode_t *ret_found_key); | kbnode_t *ret_keyblock, kbnode_t *ret_found_key); | ||||
| static kbnode_t finish_lookup (kbnode_t keyblock, | static kbnode_t finish_lookup (kbnode_t keyblock, | ||||
| unsigned int req_usage, int want_exact, | unsigned int req_usage, int want_exact, | ||||
| unsigned int *r_flags); | int want_secret, unsigned int *r_flags); | ||||
| static void print_status_key_considered (kbnode_t keyblock, unsigned int flags); | static void print_status_key_considered (kbnode_t keyblock, unsigned int flags); | ||||
| Context not available. | |||||
| /* Warning: node flag bits 0 and 1 should be preserved by | /* Warning: node flag bits 0 and 1 should be preserved by | ||||
| * merge_selfsigs. FIXME: Check whether this still holds. */ | * merge_selfsigs. FIXME: Check whether this still holds. */ | ||||
| merge_selfsigs (ctrl, keyblock); | merge_selfsigs (ctrl, keyblock); | ||||
| found_key = finish_lookup (keyblock, pk->req_usage, 0, &infoflags); | found_key = finish_lookup (keyblock, pk->req_usage, 0, 0, &infoflags); | ||||
| print_status_key_considered (keyblock, infoflags); | print_status_key_considered (keyblock, infoflags); | ||||
| if (found_key) | if (found_key) | ||||
| pk_from_block (pk, keyblock, found_key); | pk_from_block (pk, keyblock, found_key); | ||||
| Context not available. | |||||
| */ | */ | ||||
| static kbnode_t | static kbnode_t | ||||
| finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact, | finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact, | ||||
| unsigned int *r_flags) | int want_secret, unsigned int *r_flags) | ||||
| { | { | ||||
| kbnode_t k; | kbnode_t k; | ||||
| Context not available. | |||||
| continue; | continue; | ||||
| } | } | ||||
| if (want_secret && agent_probe_secret_key (NULL, pk)) | |||||
| { | |||||
| if (DBG_LOOKUP) | |||||
| log_debug ("\tno secret key\n"); | |||||
| continue; | |||||
| } | |||||
| if (DBG_LOOKUP) | if (DBG_LOOKUP) | ||||
| log_debug ("\tsubkey might be fine\n"); | log_debug ("\tsubkey might be fine\n"); | ||||
| /* In case a key has a timestamp of 0 set, we make sure | /* In case a key has a timestamp of 0 set, we make sure | ||||
| Context not available. | |||||
| * merge_selfsigs. */ | * merge_selfsigs. */ | ||||
| merge_selfsigs (ctrl, keyblock); | merge_selfsigs (ctrl, keyblock); | ||||
| found_key = finish_lookup (keyblock, ctx->req_usage, ctx->exact, | found_key = finish_lookup (keyblock, ctx->req_usage, ctx->exact, | ||||
| &infoflags); | want_secret, &infoflags); | ||||
| print_status_key_considered (keyblock, infoflags); | print_status_key_considered (keyblock, infoflags); | ||||
| if (found_key) | if (found_key) | ||||
| { | { | ||||
| Context not available. | |||||