From: Rudolf Polzer Date: Mon, 5 Jul 2010 09:30:17 +0000 (+0200) Subject: add a function to get a fingerprint of the public key (not id) X-Git-Tag: xonotic-v0.1.0preview~38^2~18 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7422fb620ff8311a7ed12376d0698f31a8dafd16;p=xonotic%2Fd0_blind_id.git add a function to get a fingerprint of the public key (not id) --- 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))