X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=rsa.c;h=0bd106ff3526935734641b239cdb3ec91649de2b;hb=3d8d8f4e66600d1a2a80ade8e1df407a18b01ac9;hp=4702fe97d9292e08d22d2bc6965b2469c26a6414;hpb=389070fed67552c613ce5afd3cdb436f8f8c538f;p=secnet.git diff --git a/rsa.c b/rsa.c index 4702fe9..0bd106f 100644 --- a/rsa.c +++ b/rsa.c @@ -36,7 +36,7 @@ struct rsapub { static const char *hexchars="0123456789abcdef"; -static string_t rsa_sign(void *sst, uint8_t *data, uint32_t datalen) +static string_t rsa_sign(void *sst, uint8_t *data, int32_t datalen) { struct rsapriv *st=sst; MP_INT a, b, u, v, tmp, tmp2; @@ -130,7 +130,7 @@ static string_t rsa_sign(void *sst, uint8_t *data, uint32_t datalen) } static rsa_checksig_fn rsa_sig_check; -static bool_t rsa_sig_check(void *sst, uint8_t *data, uint32_t datalen, +static bool_t rsa_sig_check(void *sst, uint8_t *data, int32_t datalen, cstring_t signature) { struct rsapub *st=sst; @@ -194,7 +194,7 @@ static list_t *rsapub_apply(closure_t *self, struct cloc loc, dict_t *context, i=list_elem(args,0); if (i) { if (i->type!=t_string) { - cfgfatal(i->loc,"rsa-public","first argument must be a string"); + cfgfatal(i->loc,"rsa-public","first argument must be a string\n"); } e=i->data.string; if (mpz_init_set_str(&st->e,e,10)!=0) { @@ -208,7 +208,7 @@ static list_t *rsapub_apply(closure_t *self, struct cloc loc, dict_t *context, i=list_elem(args,1); if (i) { if (i->type!=t_string) { - cfgfatal(i->loc,"rsa-public","second argument must be a string"); + cfgfatal(i->loc,"rsa-public","second argument must be a string\n"); } n=i->data.string; if (mpz_init_set_str(&st->n,n,10)!=0) { @@ -267,7 +267,7 @@ static list_t *rsapriv_apply(closure_t *self, struct cloc loc, dict_t *context, i=list_elem(args,0); if (i) { if (i->type!=t_string) { - cfgfatal(i->loc,"rsa-public","first argument must be a string"); + cfgfatal(i->loc,"rsa-public","first argument must be a string\n"); } filename=i->data.string; } else { @@ -313,7 +313,7 @@ static list_t *rsapriv_apply(closure_t *self, struct cloc loc, dict_t *context, } b=safe_malloc(length,"rsapriv_apply"); if (fread(b,length,1,f) != 1) { - cfgfatal_maybefile(f,loc,"rsa-private","error reading modulus"); + cfgfatal_maybefile(f,loc,"rsa-private","error reading modulus\n"); } mpz_init(&st->n); read_mpbin(&st->n,b,length);