diff options
author | David Shaw <[email protected]> | 2005-12-19 19:39:32 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2005-12-19 19:39:32 +0000 |
commit | 5432755319f34010f587dae19ae325020bf9454c (patch) | |
tree | e6743212622a6479a23893c1ad045d25c081985c /keyserver/gpgkeys_hkp.c | |
parent | * gpg.c (main): Restore convert-sk-to-pk as programs rely on it. (diff) | |
download | gnupg-5432755319f34010f587dae19ae325020bf9454c.tar.gz gnupg-5432755319f34010f587dae19ae325020bf9454c.zip |
* ksutil.h, ksutil.c (curl_armor_writer, curl_writer,
curl_writer_finalize): New functionality to handle binary format keys by
armoring them for input to GPG.
* gpgkeys_curl.c (get_key), gpgkeys_hkp.c (get_key): Call it here.
Diffstat (limited to '')
-rw-r--r-- | keyserver/gpgkeys_hkp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/keyserver/gpgkeys_hkp.c b/keyserver/gpgkeys_hkp.c index 38e9cefde..d51c659ff 100644 --- a/keyserver/gpgkeys_hkp.c +++ b/keyserver/gpgkeys_hkp.c @@ -263,21 +263,22 @@ get_key(char *getkey) curl_easy_setopt(curl,CURLOPT_FILE,&ctx); res=curl_easy_perform(curl); - if(res!=0) + if(res!=CURLE_OK) { fprintf(console,"gpgkeys: HTTP fetch error %d: %s\n",res,errorbuffer); fprintf(output,"\nKEY 0x%s FAILED %d\n",getkey,curl_err_to_gpg_err(res)); } else { - if(ctx.done) - fprintf(output,"\nKEY 0x%s END\n",getkey); - else + curl_writer_finalize(&ctx); + if(!ctx.flags.done) { fprintf(console,"gpgkeys: key %s not found on keyserver\n",getkey); - fprintf(output,"KEY 0x%s FAILED %d\n", + fprintf(output,"\nKEY 0x%s FAILED %d\n", getkey,KEYSERVER_KEY_NOT_FOUND); } + else + fprintf(output,"\nKEY 0x%s END\n",getkey); } return KEYSERVER_OK; |