diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-03-08 21:50:13 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-03-08 21:50:13 +0000 |
commit | f8e7acf81378394257822bff9fdcccb059d0b286 (patch) | |
tree | a88ddb082768696ff57c05e3b4321b5016a2978b /lib | |
parent | 85521a8799c3c203f00282511cabe9c65b45dacf (diff) |
exit(-1) -> exit(1)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkeynote/keynote-keygen.c | 42 | ||||
-rw-r--r-- | lib/libkeynote/keynote-main.c | 6 | ||||
-rw-r--r-- | lib/libkeynote/keynote-sign.c | 32 | ||||
-rw-r--r-- | lib/libkeynote/keynote-sigver.c | 16 | ||||
-rw-r--r-- | lib/libkeynote/keynote-verify.c | 64 | ||||
-rw-r--r-- | lib/libkeynote/sample-app.c | 10 |
6 files changed, 85 insertions, 85 deletions
diff --git a/lib/libkeynote/keynote-keygen.c b/lib/libkeynote/keynote-keygen.c index b3a2a2236af..5ff49c5bb04 100644 --- a/lib/libkeynote/keynote-keygen.c +++ b/lib/libkeynote/keynote-keygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-keygen.c,v 1.11 2000/09/27 00:09:54 angelos Exp $ */ +/* $OpenBSD: keynote-keygen.c,v 1.12 2001/03/08 21:50:11 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -130,7 +130,7 @@ keynote_keygen(int argc, char *argv[]) if (algname == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } strcpy(algname, argv[1]); @@ -145,7 +145,7 @@ keynote_keygen(int argc, char *argv[]) if (begin <= -1) { fprintf(stderr, "Erroneous value for print-offset parameter.\n"); - exit(-1); + exit(1); } } @@ -155,7 +155,7 @@ keynote_keygen(int argc, char *argv[]) if (prlen <= 0) { fprintf(stderr, "Erroneous value for print-length parameter.\n"); - exit(-1); + exit(1); } } @@ -163,7 +163,7 @@ keynote_keygen(int argc, char *argv[]) { fprintf(stderr, "Parameter ``print-length'' should be larger " "than the length of AlgorithmName (%d)\n", strlen(algname)); - exit(-1); + exit(1); } #if defined(CRYPTO) || defined(PGPLIB) @@ -173,7 +173,7 @@ keynote_keygen(int argc, char *argv[]) if (len <= 0) { fprintf(stderr, "Invalid specified keysize %d\n", len); - exit(-1); + exit(1); } if ((alg == KEYNOTE_ALGORITHM_DSA) && @@ -183,7 +183,7 @@ keynote_keygen(int argc, char *argv[]) if (RAND_bytes(seed, SEED_LEN) == 0) { fprintf(stderr, "Failed to acquire %d random bytes\n", SEED_LEN); - exit(-1); + exit(1); } dsa = DSA_generate_parameters(len, seed, SEED_LEN, &counter, &h, NULL @@ -195,13 +195,13 @@ keynote_keygen(int argc, char *argv[]) if (dsa == (DSA *) NULL) { ERR_print_errors_fp(stderr); - exit(-1); + exit(1); } if (DSA_generate_key(dsa) != 1) { ERR_print_errors_fp(stderr); - exit(-1); + exit(1); } dc.dec_algorithm = KEYNOTE_ALGORITHM_DSA; @@ -211,7 +211,7 @@ keynote_keygen(int argc, char *argv[]) if (foo == (char *) NULL) { fprintf(stderr, "Error encoding key (errno %d)\n", keynote_errno); - exit(-1); + exit(1); } if (!strcmp(argv[3], "-")) @@ -222,7 +222,7 @@ keynote_keygen(int argc, char *argv[]) if (fp == (FILE *) NULL) { perror(argv[3]); - exit(-1); + exit(1); } } @@ -236,7 +236,7 @@ keynote_keygen(int argc, char *argv[]) if (foo == (char *) NULL) { fprintf(stderr, "Error encoding key (errno %d)\n", keynote_errno); - exit(-1); + exit(1); } if (!strcmp(argv[4], "-")) @@ -251,7 +251,7 @@ keynote_keygen(int argc, char *argv[]) if (fp == (FILE *) NULL) { perror(argv[4]); - exit(-1); + exit(1); } } @@ -260,7 +260,7 @@ keynote_keygen(int argc, char *argv[]) if (privalgname == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } sprintf(privalgname, "%s%s", KEYNOTE_PRIVATE_KEY_PREFIX, algname); print_key(fp, privalgname, foo, begin, prlen); @@ -286,7 +286,7 @@ keynote_keygen(int argc, char *argv[]) if (rsa == (RSA *) NULL) { ERR_print_errors_fp(stderr); - exit(-1); + exit(1); } dc.dec_algorithm = KEYNOTE_ALGORITHM_RSA; @@ -296,7 +296,7 @@ keynote_keygen(int argc, char *argv[]) if (foo == (char *) NULL) { fprintf(stderr, "Error encoding key (errno %d)\n", keynote_errno); - exit(-1); + exit(1); } if (!strcmp(argv[3], "-")) @@ -307,7 +307,7 @@ keynote_keygen(int argc, char *argv[]) if (fp == (FILE *) NULL) { perror(argv[3]); - exit(-1); + exit(1); } } @@ -321,7 +321,7 @@ keynote_keygen(int argc, char *argv[]) if (foo == (char *) NULL) { fprintf(stderr, "Error encoding key (errno %d)\n", keynote_errno); - exit(-1); + exit(1); } if (!strcmp(argv[4], "-")) @@ -336,7 +336,7 @@ keynote_keygen(int argc, char *argv[]) if (fp == (FILE *) NULL) { perror(argv[4]); - exit(-1); + exit(1); } } @@ -345,7 +345,7 @@ keynote_keygen(int argc, char *argv[]) if (privalgname == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } sprintf(privalgname, "%s%s", KEYNOTE_PRIVATE_KEY_PREFIX, algname); print_key(fp, privalgname, foo, begin, prlen); @@ -362,5 +362,5 @@ keynote_keygen(int argc, char *argv[]) #endif /* CRYPTO */ fprintf(stderr, "Unknown/unsupported algorithm [%s]\n", algname); - exit(-1); + exit(1); } diff --git a/lib/libkeynote/keynote-main.c b/lib/libkeynote/keynote-main.c index c18ae6965b8..757ac0f8a03 100644 --- a/lib/libkeynote/keynote-main.c +++ b/lib/libkeynote/keynote-main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-main.c,v 1.6 1999/10/01 01:08:30 angelos Exp $ */ +/* $OpenBSD: keynote-main.c,v 1.7 2001/03/08 21:50:11 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -62,7 +62,7 @@ main(int argc, char *argv[]) if (argc < 2) { mainusage(); - exit(-1); + exit(1); } if (!strcmp(argv[1], "sign")) @@ -78,5 +78,5 @@ main(int argc, char *argv[]) keynote_keygen(argc - 1, argv + 1); mainusage(); - exit(-1); + exit(1); } diff --git a/lib/libkeynote/keynote-sign.c b/lib/libkeynote/keynote-sign.c index ca5253470b3..c577e06e73a 100644 --- a/lib/libkeynote/keynote-sign.c +++ b/lib/libkeynote/keynote-sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-sign.c,v 1.10 1999/11/03 03:17:58 angelos Exp $ */ +/* $OpenBSD: keynote-sign.c,v 1.11 2001/03/08 21:50:12 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -68,7 +68,7 @@ keynote_sign(int argc, char *argv[]) (argc != 7)) { signusage(); - exit(-1); + exit(1); } if (!strcmp("-v", argv[1])) @@ -80,7 +80,7 @@ keynote_sign(int argc, char *argv[]) if (begin <= -1) { fprintf(stderr, "Erroneous value for print-offset parameter.\n"); - exit(-1); + exit(1); } } @@ -90,7 +90,7 @@ keynote_sign(int argc, char *argv[]) if (prlen <= 0) { fprintf(stderr, "Erroneous value for print-length parameter.\n"); - exit(-1); + exit(1); } } @@ -103,7 +103,7 @@ keynote_sign(int argc, char *argv[]) if (algname == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } strcpy(algname, argv[1 + flg]); @@ -117,19 +117,19 @@ keynote_sign(int argc, char *argv[]) if (fd < 0) { perror(argv[2 + flg]); - exit(-1); + exit(1); } if (fstat(fd, &sb) < 0) { perror("fstat()"); - exit(-1); + exit(1); } if (sb.st_size == 0) /* Paranoid */ { fprintf(stderr, "Error: zero-sized assertion-file.\n"); - exit(-1); + exit(1); } buflen = sb.st_size + 1; @@ -137,13 +137,13 @@ keynote_sign(int argc, char *argv[]) if (buf == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } if (read(fd, buf, buflen - 1) < 0) { perror("read()"); - exit(-1); + exit(1); } close(fd); @@ -153,32 +153,32 @@ keynote_sign(int argc, char *argv[]) if (fd < 0) { perror(argv[3 + flg]); - exit(-1); + exit(1); } if (fstat(fd, &sb) < 0) { perror("fstat()"); - exit(-1); + exit(1); } if (sb.st_size == 0) /* Paranoid */ { fprintf(stderr, "Illegal key-file size 0\n"); - exit(-1); + exit(1); } buf2 = (char *) calloc(sb.st_size + 1, sizeof(char)); if (buf2 == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } if (read(fd, buf2, sb.st_size) < 0) { perror("read()"); - exit(-1); + exit(1); } close(fd); @@ -206,7 +206,7 @@ keynote_sign(int argc, char *argv[]) fprintf(stderr, "Unknown error while creating signature.\n"); } - exit(-1); + exit(1); } /* Print signature string */ diff --git a/lib/libkeynote/keynote-sigver.c b/lib/libkeynote/keynote-sigver.c index 760eb793e32..5fa864bcfa7 100644 --- a/lib/libkeynote/keynote-sigver.c +++ b/lib/libkeynote/keynote-sigver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-sigver.c,v 1.10 1999/11/05 00:27:18 angelos Exp $ */ +/* $OpenBSD: keynote-sigver.c,v 1.11 2001/03/08 21:50:12 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -71,32 +71,32 @@ keynote_sigver(int argc, char *argv[]) if (fd < 0) { perror(argv[1]); - exit(-1); + exit(1); } if (fstat(fd, &sb) < 0) { perror("fstat()"); - exit(-1); + exit(1); } if (sb.st_size == 0) /* Paranoid */ { fprintf(stderr, "Illegal assertion-file size 0\n"); - exit(-1); + exit(1); } buf = (char *) calloc(sb.st_size + 1, sizeof(char)); if (buf == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } if (read(fd, buf, sb.st_size) < 0) { perror("read()"); - exit(-1); + exit(1); } close(fd); @@ -106,14 +106,14 @@ keynote_sigver(int argc, char *argv[]) { fprintf(stderr, "Out of memory while allocating memory for " "assertions.\n"); - exit(-1); + exit(1); } if (n == 0) { fprintf(stderr, "No assertions found in %s.\n", argv[1]); free(assertlist); - exit(-1); + exit(1); } free(buf); diff --git a/lib/libkeynote/keynote-verify.c b/lib/libkeynote/keynote-verify.c index 0f234c9ed1a..0ab02fc3ca4 100644 --- a/lib/libkeynote/keynote-verify.c +++ b/lib/libkeynote/keynote-verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keynote-verify.c,v 1.8 1999/10/26 22:31:38 angelos Exp $ */ +/* $OpenBSD: keynote-verify.c,v 1.9 2001/03/08 21:50:12 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -85,13 +85,13 @@ keynote_verify(int argc, char *argv[]) if (argc == 1) { verifyusage(); - exit(-1); + exit(1); } if ((buf = (char *) calloc(cl, sizeof(char))) == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } #ifdef LoopTesting @@ -101,7 +101,7 @@ keynote_verify(int argc, char *argv[]) if ((retv = (char **) calloc(numretv, sizeof(char *))) == (char **) NULL) { perror("calloc()"); - exit(-1); + exit(1); } /* "ac" and "av" are used for stress-testing, ignore otherwise */ @@ -123,7 +123,7 @@ keynote_verify(int argc, char *argv[]) { case 'e': if (read_environment(optarg) == -1) - exit(-1); + exit(1); se = 1; break; @@ -133,13 +133,13 @@ keynote_verify(int argc, char *argv[]) if ((fd = open(optarg, O_RDONLY, 0)) < 0) { perror(optarg); - exit(-1); + exit(1); } if (fstat(fd, &sb) < 0) { perror("fstat()"); - exit(-1); + exit(1); } if (sb.st_size > cl - 1) @@ -150,7 +150,7 @@ keynote_verify(int argc, char *argv[]) if (buf == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } } @@ -158,7 +158,7 @@ keynote_verify(int argc, char *argv[]) if (i < 0) { perror("read()"); - exit(-1); + exit(1); } close(fd); @@ -172,11 +172,11 @@ keynote_verify(int argc, char *argv[]) case ERROR_SYNTAX: fprintf(stderr, "Syntax error adding authorizer " "%s\n", optarg); - exit(-1); + exit(1); case ERROR_MEMORY: perror("Out of memory.\n"); - exit(-1); + exit(1); default: fprintf(stderr, "Unknown error (%d).\n", @@ -194,7 +194,7 @@ keynote_verify(int argc, char *argv[]) { fprintf(stderr, "Do not define two sets of return values.\n"); - exit(-1); + exit(1); } sn = 1; @@ -216,7 +216,7 @@ keynote_verify(int argc, char *argv[]) * little sloppy. */ perror("calloc()"); - exit(-1); + exit(1); } memcpy(foov, retv, numretv * sizeof(char **)); @@ -230,7 +230,7 @@ keynote_verify(int argc, char *argv[]) { /* Comment from above applies here as well */ perror("calloc()"); - exit(-1); + exit(1); } /* Copy */ @@ -243,7 +243,7 @@ keynote_verify(int argc, char *argv[]) if (retv[numret] == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } numret++; @@ -253,13 +253,13 @@ keynote_verify(int argc, char *argv[]) if ((fd = open(optarg, O_RDONLY, 0)) < 0) { perror(optarg); - exit(-1); + exit(1); } if (fstat(fd, &sb) < 0) { perror("fstat()"); - exit(-1); + exit(1); } if (sb.st_size > cl - 1) @@ -270,7 +270,7 @@ keynote_verify(int argc, char *argv[]) if (buf == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } } @@ -278,7 +278,7 @@ keynote_verify(int argc, char *argv[]) if (i < 0) { perror("read()"); - exit(-1); + exit(1); } close(fd); @@ -298,7 +298,7 @@ keynote_verify(int argc, char *argv[]) case '?': default: verifyusage(); - exit(-1); + exit(1); } } @@ -314,26 +314,26 @@ keynote_verify(int argc, char *argv[]) { fprintf(stderr, "Should set return values before evaluations begin.\n"); - exit(-1); + exit(1); } if (se == 0) { fprintf(stderr, "Should set environment before evaluations begin.\n"); - exit(-1); + exit(1); } if (sk == 0) { fprintf(stderr, "Should specify at least one action authorizer.\n"); - exit(-1); + exit(1); } if (sl == 0) { fprintf(stderr, "Should specify at least one trusted assertion (POLICY).\n"); - exit(-1); + exit(1); } while (argc--) @@ -341,13 +341,13 @@ keynote_verify(int argc, char *argv[]) if ((fd = open(argv[argc], O_RDONLY, 0)) < 0) { perror(argv[argc]); - exit(-1); + exit(1); } if (fstat(fd, &sb) < 0) { perror("fstat()"); - exit(-1); + exit(1); } if (sb.st_size > cl - 1) @@ -358,7 +358,7 @@ keynote_verify(int argc, char *argv[]) if (buf == (char *) NULL) { perror("calloc()"); - exit(-1); + exit(1); } } @@ -366,7 +366,7 @@ keynote_verify(int argc, char *argv[]) if (i < 0) { perror("read()"); - exit(-1); + exit(1); } close(fd); @@ -390,23 +390,23 @@ keynote_verify(int argc, char *argv[]) { case ERROR_MEMORY: printf("<out of memory>\n"); - exit(-1); + exit(1); case ERROR_SYNTAX: printf("<uninitialized authorizers or all POLICY " "assertions are malformed!>\n"); - exit(-1); + exit(1); case ERROR_NOTFOUND: printf("<session or other information not found!>\n"); - exit(-1); + exit(1); case 0: /* No errors */ break; default: printf("<should never happen (%d)!>\n", keynote_errno); - exit(-1); + exit(1); } printf("%s\n", retv[p]); diff --git a/lib/libkeynote/sample-app.c b/lib/libkeynote/sample-app.c index 59f12a706e5..e270656182d 100644 --- a/lib/libkeynote/sample-app.c +++ b/lib/libkeynote/sample-app.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sample-app.c,v 1.1 1999/11/05 00:27:18 angelos Exp $ */ +/* $OpenBSD: sample-app.c,v 1.2 2001/03/08 21:50:12 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) * @@ -128,7 +128,7 @@ main(int argc, char **argv) if (sessionid == -1) { fprintf(stderr, "Failed to create a new session.\n"); - exit(-1); + exit(1); } /* @@ -142,7 +142,7 @@ main(int argc, char **argv) if (decomposed == NULL) { fprintf(stderr, "Failed to allocate memory for policy assertions.\n"); - exit(-1); + exit(1); } /* @@ -154,7 +154,7 @@ main(int argc, char **argv) { free(decomposed); fprintf(stderr, "No policy assertions provided.\n"); - exit(-1); + exit(1); } /* @@ -222,7 +222,7 @@ main(int argc, char **argv) { fprintf(stderr, "Failed to allocate memory for credential " "assertions.\n"); - exit(-1); + exit(1); } /* |