add a function to get a fingerprint of the public key (not id)
authorRudolf Polzer <divverent@alientrap.org>
Mon, 5 Jul 2010 09:30:17 +0000 (11:30 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 5 Jul 2010 09:30:17 +0000 (11:30 +0200)
d0_blind_id.c
main.c

index d2fc631..9faab7c 100644 (file)
@@ -321,7 +321,7 @@ WARN_UNUSED_RESULT BOOL d0_blind_id_fingerprint64_public_key(d0_blind_id_t *ctx,
        d0_iobuf_t *conv = NULL;
        size_t sz, n;
 
-       USING(schnorr_4_to_s);
+       USING(rsa_n); USING(rsa_e);
 
        out = d0_iobuf_open_write(outbuf, *outbuflen);
        conv = d0_iobuf_open_write(convbuf, sizeof(convbuf));
diff --git a/main.c b/main.c
index 2810003..0efb624 100644 (file)
--- a/main.c
+++ b/main.c
@@ -57,6 +57,10 @@ int main(int argc, char **argv)
        printf("keygen RSA...\n");
        if(!d0_blind_id_generate_private_key(ctx_self, 1024))
                errx(1, "keygen fail");
+       buf2size = sizeof(buf2) - 1;
+       if(!d0_blind_id_fingerprint64_public_key(ctx_self, buf2, &buf2size))
+               errx(2, "fp64 fail");
+       printf("key has fingerprint %s\n", buf2);
        bufsize = sizeof(buf); if(!d0_blind_id_write_public_key(ctx_self, buf, &bufsize))
                errx(2, "writepub fail");
        if(!d0_blind_id_read_public_key(ctx_other, buf, bufsize))