]> git.rm.cloudns.org Git - xonotic/d0_blind_id.git/commitdiff
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 d2fc63112071d32ea4c0ac9f3deb1366f84da9b8..9faab7cbcc27e3cc86d425e08e24e482c787771f 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 28100033aafc80bbf5df2256d328a6892fe6b7f1..0efb624e7d59b42599c342137394e786495dda5a 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))