chiark / gitweb /
messages: add some missing newlines
[secnet.git] / rsa.c
diff --git a/rsa.c b/rsa.c
index 3c82a40cfdc7f57876991073adbdbcc7cf2c765f..0bd106ff3526935734641b239cdb3ec91649de2b 100644 (file)
--- 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);
@@ -487,7 +487,6 @@ assume_valid:
     return new_closure(&st->cl);
 }
 
-init_module rsa_module;
 void rsa_module(dict_t *dict)
 {
     add_closure(dict,"rsa-private",rsapriv_apply);