X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=pubkeys.c;h=6dc741b7f5f9e63480b09151c1d684c6d5a5c0bc;hb=48806d6368c45ec463e11c4dfdb3eaa309554453;hp=62f55259ef3efebd7ab9e1793155a72334582135;hpb=03a2ae9e4e7faba159bc944f51b01aba949de16d;p=secnet.git diff --git a/pubkeys.c b/pubkeys.c index 62f5525..6dc741b 100644 --- a/pubkeys.c +++ b/pubkeys.c @@ -49,15 +49,8 @@ const struct sigscheme_info *sigscheme_lookup(const char *name) static list_t *makepublic_apply(closure_t *self, struct cloc loc, dict_t *context, list_t *args) { -#define ARG(ix,vn,what) \ - item_t *vn##_i=list_elem(args,ix); \ - if (!vn##_i) cfgfatal(loc,"make-public","need " what); \ - if (vn##_i->type!=t_string) cfgfatal(vn##_i->loc,"make-public", \ - what "must be string"); \ - const char *vn=vn##_i->data.string - - ARG(0,algname,"algorithm name"); - ARG(1,b91d,"base91s-encoded public key"); + CL_GET_STR_ARG(0,algname,"algorithm name"); + CL_GET_STR_ARG(1,b91d,"base91s-encoded public key"); const struct sigscheme_info *sch=sigscheme_lookup(algname); if (!sch) cfgfatal(algname_i->loc,"make-public", @@ -85,12 +78,6 @@ static list_t *makepublic_apply(closure_t *self, struct cloc loc, bool_t ok=sch->loadpub(sch,&buf,&pubkey,&cl,&log.log,loc); if (!ok) cfgfatal(loc,"make-public","public key loading failed"); - if (pubkey->sethash) { - struct hash_if *defhash= - find_cl_if(context,"hash",CL_HASH,True,"make-public",loc); - pubkey->sethash(pubkey->st,defhash); - } - BUF_FREE(&buf); buffer_destroy(&buf); return new_closure(cl);