diff options
-rw-r--r-- | lib/libkeynote/keynote-keygen.c | 6 | ||||
-rw-r--r-- | lib/libkeynote/keynote-sign.c | 38 | ||||
-rw-r--r-- | lib/libkeynote/keynote.1 | 21 |
3 files changed, 48 insertions, 17 deletions
diff --git a/lib/libkeynote/keynote-keygen.c b/lib/libkeynote/keynote-keygen.c index edb4ac7805a..4bb5c99d68f 100644 --- a/lib/libkeynote/keynote-keygen.c +++ b/lib/libkeynote/keynote-keygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-keygen.c,v 1.8 1999/10/26 22:31:38 angelos Exp $ */ +/* $OpenBSD: keynote-keygen.c,v 1.9 1999/11/03 03:17:58 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -53,8 +53,8 @@ keygenusage(void) { fprintf(stderr, "Arguments:\n"); fprintf(stderr, "\t<AlgorithmName> <keysize> " - "<PublicKeyFile> <PrivateKeyFile> [<printf-offset> " - "<print-length>]\n"); + "<PublicKeyFile> <PrivateKeyFile> [<print-offset>] " + "[<print-length>]\n"); } /* diff --git a/lib/libkeynote/keynote-sign.c b/lib/libkeynote/keynote-sign.c index fa494c8c2af..ca5253470b3 100644 --- a/lib/libkeynote/keynote-sign.c +++ b/lib/libkeynote/keynote-sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-sign.c,v 1.9 1999/10/26 22:31:38 angelos Exp $ */ +/* $OpenBSD: keynote-sign.c,v 1.10 1999/11/03 03:17:58 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -51,7 +51,7 @@ signusage(void) { fprintf(stderr, "Arguments:\n"); fprintf(stderr, "\t[-v] <AlgorithmName> <AssertionFile> " - "<PrivateKeyFile>\n"); + "<PrivateKeyFile> [<print-offset>] [<print-length>]\n"); } void @@ -63,23 +63,35 @@ keynote_sign(int argc, char *argv[]) struct stat sb; if ((argc != 4) && - (argc != 5)) + (argc != 5) && + (argc != 6) && + (argc != 7)) { signusage(); exit(-1); } - if (argc == 5) + if (!strcmp("-v", argv[1])) + flg = 1; + + if (argc > 4 + flg) { - if (!strcmp("-v", argv[1])) - flg = 1; - else - { - fprintf(stderr, - "Invalid first argument [%s] or too many arguments\n", - argv[1]); - exit(-1); - } + begin = atoi(argv[4 + flg]); + if (begin <= -1) + { + fprintf(stderr, "Erroneous value for print-offset parameter.\n"); + exit(-1); + } + } + + if (argc > 5 + flg) + { + prlen = atoi(argv[5 + flg]); + if (prlen <= 0) + { + fprintf(stderr, "Erroneous value for print-length parameter.\n"); + exit(-1); + } } /* Fix algorithm name */ diff --git a/lib/libkeynote/keynote.1 b/lib/libkeynote/keynote.1 index 6b5ea0f51ca..b56cc655de2 100644 --- a/lib/libkeynote/keynote.1 +++ b/lib/libkeynote/keynote.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: keynote.1,v 1.11 1999/10/11 00:08:28 angelos Exp $ +.\" $OpenBSD: keynote.1,v 1.12 1999/11/03 03:17:58 angelos Exp $ .\" .\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) .\" @@ -43,6 +43,8 @@ operations .Ar AlgorithmName .Ar AssertionFile .Ar PrivateKeyFile +.Op print-offset +.Op print-length .Nm keynote sigver .Op AssertionFile @@ -160,6 +162,23 @@ signature using the .Fa Authorizer field key. .Pp +The optional parameters +.Fa print-offset +and +.Fa print-length +specify the offset from the beginning of the line where the signature +will be printed, and the number of characters of the signature that will +be printed per line. +.Fa print-length +includes +.Fa AlgorithmName +for the first line and has to be longer (by at least 2) than +.Fa AlgorithmName . +.Fa print-length +also accounts for the line-continuation character (backslash) at +the end of each line, and the doublequotes at the beginning and end +of the signature encoding. Default values are 12 and 50 respectively. +.Pp .Sh SIGNATURE VERIFICATION "keynote sigver" reads the assertion contained in .Fa AssertionFile |