X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/3563e36580c7dad68cd6d3f7eb82eef570fc0c76..a9fcea0e5ef17bab8eaca2236016e109ab62488e:/keyutil.c diff --git a/keyutil.c b/keyutil.c index 4bd42fe..025c8f2 100644 --- a/keyutil.c +++ b/keyutil.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: keyutil.c,v 1.19 2004/04/03 03:31:01 mdw Exp $ + * $Id: keyutil.c,v 1.22 2004/04/03 15:45:06 mdw Exp $ * * Simple key manager program * @@ -30,6 +30,15 @@ /*----- Revision history --------------------------------------------------* * * $Log: keyutil.c,v $ + * Revision 1.22 2004/04/03 15:45:06 mdw + * Oops. Fix formatting. :-S + * + * Revision 1.21 2004/04/03 15:15:19 mdw + * Fix stupid error in previous rashly-committed version. + * + * Revision 1.20 2004/04/03 15:14:28 mdw + * Handle points at infinity properly in listings. + * * Revision 1.19 2004/04/03 03:31:01 mdw * Allow explicit group parameters for DH groups. * @@ -908,7 +917,8 @@ static int cmd_add(int argc, char *argv[]) { "subgroup", 0, 0, 'S' }, { 0, 0, 0, 0 } }; - int i = mdwopt(argc, argv, "+a:b:B:p:e:c:t:R:C:A:s:n:lqrLS", opt, 0, 0, 0); + int i = mdwopt(argc, argv, "+a:b:B:p:e:c:t:R:C:A:s:n:lqrLS", + opt, 0, 0, 0); if (i < 0) break; @@ -1271,9 +1281,13 @@ static void showkeydata(key_data *k, int ind, listopts *o, dstr *d) /* --- Elliptic curve points --- */ case KENC_EC: - fputs(" 0x", stdout); mp_writefile(k->u.e.x, stdout, 16); - fputs(", 0x", stdout); mp_writefile(k->u.e.y, stdout, 16); - putchar('\n'); + if (EC_ATINF(&k->u.e)) + fputs(" inf\n", stdout); + else { + fputs(" 0x", stdout); mp_writefile(k->u.e.x, stdout, 16); + fputs(", 0x", stdout); mp_writefile(k->u.e.y, stdout, 16); + putchar('\n'); + } break; /* --- Structured keys --- *