unsigned.
/* -*-c-*-
*
- * $Id: dsig.c,v 1.5 2000/10/08 12:12:09 mdw Exp $
+ * $Id: dsig.c,v 1.6 2000/12/06 20:33:27 mdw Exp $
*
* Verify signatures on distribuitions of files
*
/*----- Revision history --------------------------------------------------*
*
* $Log: dsig.c,v $
+ * Revision 1.6 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.5 2000/10/08 12:12:09 mdw
* Shut up some warnings.
*
static int sign(int argc, char *argv[])
{
- enum {
- f_raw = 1,
- f_bin = 2,
- f_bogus = 4
- };
+#define f_raw 1u
+#define f_bin 2u
+#define f_bogus 4u
unsigned f = 0;
const char *kt = 0;
if (f & f_bogus)
die(EXIT_FAILURE, "error(s) occurred while creating signature");
return (EXIT_SUCCESS);
+
+#undef f_raw
+#undef f_bin
+#undef f_bogus
}
/*----- Signature verification --------------------------------------------*/
static int verify(int argc, char *argv[])
{
- enum {
- f_bogus = 1,
- f_bin = 2,
- f_ok = 4
- };
+#define f_bogus 1u
+#define f_bin 2u
+#define f_ok 4u
unsigned f = 0;
unsigned verb = 1;
puts("OK signature verified");
}
return (f & f_bogus ? EXIT_FAILURE : EXIT_SUCCESS);
+
+#undef f_bogus
+#undef f_bin
+#undef f_ok
}
/*----- Main code ---------------------------------------------------------*/
cmd *c = 0, *cc = 0;
size_t n;
- enum {
- f_bogus = 1
- };
+#define f_bogus 1u
/* --- Initialize the library --- */
if (!cc)
die(EXIT_FAILURE, "unknown command `%s'", argv[0]);
return (cc->func(argc, argv));
+
+#undef f_bogus
}
/*----- That's all, folks -------------------------------------------------*/
/* -*-c-*-
*
- * $Id: fipstest.h,v 1.2 2000/08/11 21:34:34 mdw Exp $
+ * $Id: fipstest.h,v 1.3 2000/12/06 20:33:27 mdw Exp $
*
* FIPS140 randomness tests
*
/*----- Revision history --------------------------------------------------*
*
* $Log: fipstest.h,v $
+ * Revision 1.3 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.2 2000/08/11 21:34:34 mdw
* Change to use the new thresholds given in the draft FIPS140-2.
*
#define FIPSTEST_BUFSZ 2500
-enum {
- FIPSTEST_OK = 0,
- FIPSTEST_MONOBIT = 1,
- FIPSTEST_POKER = 2,
- FIPSTEST_RUNS = 4,
- FIPSTEST_LONGRUNS = 8
-};
+#define FIPSTEST_OK 0u
+#define FIPSTEST_MONOBIT 1u
+#define FIPSTEST_POKER 2u
+#define FIPSTEST_RUNS 4u
+#define FIPSTEST_LONGRUNS 8u
/*----- Functions provided ------------------------------------------------*/
/* -*-c-*-
*
- * $Id: hashsum.c,v 1.4 2000/08/04 23:23:44 mdw Exp $
+ * $Id: hashsum.c,v 1.5 2000/12/06 20:33:27 mdw Exp $
*
* Hash files using some secure hash function
*
/*----- Revision history --------------------------------------------------*
*
* $Log: hashsum.c,v $
+ * Revision 1.5 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.4 2000/08/04 23:23:44 mdw
* Various <ctype.h> fixes.
*
0
};
-enum {
- f_binary = 1,
- f_bogus = 2,
- f_verbose = 4,
- f_check = 8,
- f_files = 16,
- f_raw = 32,
- f_oddhash = 64,
- f_escape = 128
-};
+#define f_binary 1u
+#define f_bogus 2u
+#define f_verbose 4u
+#define f_check 8u
+#define f_files 16u
+#define f_raw 32u
+#define f_oddhash 64u
+#define f_escape 128u
/*----- Support functions -------------------------------------------------*/
/* -*-c-*-
*
- * $Id: key.h,v 1.6 2000/06/17 11:27:43 mdw Exp $
+ * $Id: key.h,v 1.7 2000/12/06 20:33:27 mdw Exp $
*
* Simple key management
*
/*----- Revision history --------------------------------------------------*
*
* $Log: key.h,v $
+ * Revision 1.7 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.6 2000/06/17 11:27:43 mdw
* Add key fetching interface.
*
/* --- Key file flags --- */
-enum {
- KF_WRITE = 1, /* File opened for writing */
- KF_MODIFIED = 2 /* File has been modified */
-};
+#define KF_WRITE 1u /* File opened for writing */
+#define KF_MODIFIED 2u /* File has been modified */
/* --- Iterating over keys --- *
*
/* -*-c-*-
*
- * $Id: keyutil.c,v 1.10 2000/10/08 12:02:21 mdw Exp $
+ * $Id: keyutil.c,v 1.11 2000/12/06 20:33:27 mdw Exp $
*
* Simple key manager program
*
/*----- Revision history --------------------------------------------------*
*
* $Log: keyutil.c,v $
+ * Revision 1.11 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.10 2000/10/08 12:02:21 mdw
* Use @MP_EQ@ instead of @MP_CMP@.
*
key *p; /* Parameters key-data */
} keyopts;
-enum {
- f_bogus = 1, /* Error in parsing */
- f_lock = 2, /* Passphrase-lock private key */
- f_quiet = 4, /* Don't show a progress indicator */
- f_limlee = 8, /* Generate Lim-Lee primes */
- f_subgroup = 16 /* Generate a subgroup */
-};
+#define f_bogus 1u /* Error in parsing */
+#define f_lock 2u /* Passphrase-lock private key */
+#define f_quiet 4u /* Don't show a progress indicator */
+#define f_limlee 8u /* Generate Lim-Lee primes */
+#define f_subgroup 16u /* Generate a subgroup */
/* --- @dolock@ --- *
*
/* --- Listing flags --- */
-enum {
- f_newline = 2, /* Write newline before next entry */
- f_attr = 4, /* Written at least one attribute */
- f_utc = 8 /* Emit UTC time, not local time */
-};
+#define f_newline 2u /* Write newline before next entry */
+#define f_attr 4u /* Written at least one attribute */
+#define f_utc 8u /* Emit UTC time, not local time */
/* --- @showkeydata@ --- *
*
{
unsigned f = 0;
- enum {
- f_bogus = 1
- };
+#define f_bogus 1u
/* --- Initialization --- */
/* -*-c-*-
*
- * $Id: limlee.h,v 1.2 2000/08/18 19:16:51 mdw Exp $
+ * $Id: limlee.h,v 1.3 2000/12/06 20:33:27 mdw Exp $
*
* Generate Lim-Lee primes
*
/*----- Revision history --------------------------------------------------*
*
* $Log: limlee.h,v $
+ * Revision 1.3 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.2 2000/08/18 19:16:51 mdw
* New stepper interface for constructing Lim-Lee primes.
*
/* --- Flags --- */
-enum {
- LIMLEE_KEEPFACTORS = 1
-};
+#define LIMLEE_KEEPFACTORS 1u
/*----- The Lim-Lee stepper function --------------------------------------*/
/* -*-c-*-
*
- * $Id: lmem.h,v 1.3 2000/07/29 21:58:15 mdw Exp $
+ * $Id: lmem.h,v 1.4 2000/12/06 20:33:27 mdw Exp $
*
* Locked memory allocation
*
/*----- Revision history --------------------------------------------------*
*
* $Log: lmem.h,v $
+ * Revision 1.4 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.3 2000/07/29 21:58:15 mdw
* (l_destroy): New function for destroying locked memory blocks.
*
unsigned f; /* Various flags */
} l_node;
-enum {
- LF_ALLOC = 1
-};
+#define LF_ALLOC 1u
/* --- Locked memory buffer state --- */
int err; char *emsg; /* Error indicators */
} lmem;
-enum {
- LF_LOCKED = 1
-};
+#define LF_LOCKED 1u
/*----- Functions provided ------------------------------------------------*/
/* -*-c-*-
*
- * $Id: mkphrase.c,v 1.1 2000/08/06 10:50:55 mdw Exp $
+ * $Id: mkphrase.c,v 1.2 2000/12/06 20:33:27 mdw Exp $
*
* Generate passphrases from word lists
*
/*----- Revision history --------------------------------------------------*
*
* $Log: mkphrase.c,v $
+ * Revision 1.2 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.1 2000/08/06 10:50:55 mdw
* (mkphrase): New program for generating random passphrases with measured
* strength.
dstr dd = DSTR_INIT;
unsigned i;
- enum {
- f_bogus = 1,
- f_showp = 2
- };
+#define f_bogus 1u
+#define f_showp 2u
ego(argv[0]);
for (;;) {
/* -*-c-*-
*
- * $Id: passphrase.c,v 1.2 2000/06/17 11:49:37 mdw Exp $
+ * $Id: passphrase.c,v 1.3 2000/12/06 20:33:27 mdw Exp $
*
* Reading of passphrases (Unix-specific)
*
/*----- Revision history --------------------------------------------------*
*
* $Log: passphrase.c,v $
+ * Revision 1.3 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.2 2000/06/17 11:49:37 mdw
* New pixie protocol allowing application to request passphrases and send
* them to the pixie.
static int fd = -1;
static unsigned flags = 0;
-enum {
- f_fail = 1
-};
+#define f_fail 1u
/*----- Main code ---------------------------------------------------------*/
/* -*-c-*-
*
- * $Id: pixie.c,v 1.6 2000/10/08 12:06:46 mdw Exp $
+ * $Id: pixie.c,v 1.7 2000/12/06 20:33:27 mdw Exp $
*
* Passphrase pixie for Catacomb
*
/*----- Revision history --------------------------------------------------*
*
* $Log: pixie.c,v $
+ * Revision 1.7 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.6 2000/10/08 12:06:46 mdw
* Change size passed to socket function to be a @size_t@. Insert missing
* type name for flag declaration.
static lmem lm;
static unsigned flags = 0;
-enum {
- F_SYSLOG = 1,
- F_FETCH = 2
-};
+#define F_SYSLOG 1u
+#define F_FETCH 2u
/*----- Event logging -----------------------------------------------------*/
size_t sz;
unsigned f = 0;
- enum {
- f_bogus = 1,
- f_client = 2,
- f_stdin = 4,
- f_daemon = 8,
- f_syslog = 16
- };
+#define f_bogus 1u
+#define f_client 2u
+#define f_stdin 4u
+#define f_daemon 8u
+#define f_syslog 16u
/* --- Initialize libraries --- */
/* -*-c-*-
*
- * $Id: rspit.c,v 1.12 2000/10/08 15:49:18 mdw Exp $
+ * $Id: rspit.c,v 1.13 2000/12/06 20:33:27 mdw Exp $
*
* Spit out random numbers
*
/*----- Revision history --------------------------------------------------*
*
* $Log: rspit.c,v $
+ * Revision 1.13 2000/12/06 20:33:27 mdw
+ * Make flags be macros rather than enumerations, to ensure that they're
+ * unsigned.
+ *
* Revision 1.12 2000/10/08 15:49:18 mdw
* Remove failed kludge for shutting up a warning.
*
static unsigned flags = 0;
-enum {
- f_progress = 1,
- f_file = 2,
- f_fips = 4,
- f_maurer = 8,
- f_timer = 16,
- f_discard = 32
-};
+#define f_progress 1u
+#define f_file 2u
+#define f_fips 4u
+#define f_maurer 8u
+#define f_timer 16u
+#define f_discard 32u
/*----- Help options ------------------------------------------------------*/