From 7422fb620ff8311a7ed12376d0698f31a8dafd16 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 5 Jul 2010 11:30:17 +0200 Subject: [PATCH] add a function to get a fingerprint of the public key (not id) --- d0_blind_id.c | 2 +- main.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/d0_blind_id.c b/d0_blind_id.c index d2fc631..9faab7c 100644 --- a/d0_blind_id.c +++ b/d0_blind_id.c @@ -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 --- 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)) -- 2.39.2