diff --git a/g10/keyserver.c b/g10/keyserver.c index d1ddc99c0..568a7fa26 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -2164,7 +2164,7 @@ keyserver_import_cert(const char *name,unsigned char **fpr,size_t *fpr_len) if(domain) *domain='.'; - type=get_cert(look,max_cert_size,&key,fpr,fpr_len,&url); + type = get_cert (look, 0, max_cert_size, &key, fpr, fpr_len, &url); if(type==1) { int armor_status=opt.no_armor; diff --git a/include/util.h b/include/util.h index 0eb6281ed..355dd0cd4 100644 --- a/include/util.h +++ b/include/util.h @@ -244,8 +244,8 @@ char *xtryvasprintf (const char *fmt, va_list arg_ptr); char *get_pka_info (const char *address, unsigned char *fpr); /*-- cert.c --*/ -int get_cert(const char *name,size_t max_size,IOBUF *iobuf, - unsigned char **fpr,size_t *fpr_len,char **url); +int get_cert (const char *name, int want_ipgp, size_t max_size, IOBUF *iobuf, + unsigned char **fpr,size_t *fpr_len,char **url); /*-- convert.c --*/ int hex2bin (const char *string, void *buffer, size_t length); diff --git a/util/cert.c b/util/cert.c index 0eaead586..7c5e9cfd9 100644 --- a/util/cert.c +++ b/util/cert.c @@ -48,8 +48,8 @@ /* Returns -1 on error, 0 for no answer, 1 for PGP provided and 2 for IPGP provided. */ int -get_cert(const char *name,size_t max_size,IOBUF *iobuf, - unsigned char **fpr,size_t *fpr_len,char **url) +get_cert (const char *name, int want_ipgp, size_t max_size,IOBUF *iobuf, + unsigned char **fpr, size_t *fpr_len, char **url) { unsigned char *answer; int r,ret=-1; @@ -140,7 +140,9 @@ get_cert(const char *name,size_t max_size,IOBUF *iobuf, /* 15 bytes takes us to here */ - if(ctype==3 && iobuf && dlen) + if (want_ipgp && ctype != 6) + ; /* Skip non IPGP cert records. */ + else if (ctype==3 && iobuf && dlen) { /* PGP type */ *iobuf=iobuf_temp_with_content((char *)pt,dlen); @@ -216,7 +218,7 @@ main(int argc,char *argv[]) printf("CERT lookup on %s\n",argv[1]); - rc=get_cert(argv[1],16384,&iobuf,&fpr,&fpr_len,&url); + rc=get_cert (argv[1], 0, 16384, &iobuf, &fpr, &fpr_len, &url); if(rc==-1) printf("error\n"); else if(rc==0)