Standardize handling of #ifdef'd options.
authorRich Salz <rsalz@akamai.com>
Fri, 15 May 2015 17:50:38 +0000 (13:50 -0400)
committerRich Salz <rsalz@openssl.org>
Tue, 2 Jun 2015 16:40:24 +0000 (12:40 -0400)
commit9c3bcfa027cb32421ed20ab77553860b922b82fc
tree5bc2b7a055c4abbc75431212948d0693d922f3ab
parent366e2a60b2fcc727b061f1459343245476ad6c3b
Standardize handling of #ifdef'd options.

Here are the "rules" for handling flags that depend on #ifdef:

- Do not ifdef the enum.  Only ifdef the OPTIONS table.  All ifdef'd
  entries appear at the end; by convention "engine" is last.  This
  ensures that at run-time, the flag will never be recognized/allowed.
  The next two bullets entries are for silencing compiler warnings:
- In the while/switch parsing statement, use #ifdef for the body to
  disable it; leave the "case OPT_xxx:" and "break" statements outside
  the ifdef/ifndef.  See ciphers.c for example.
- If there are multiple options controlled by a single guard, OPT_FOO,
  OPT_BAR, etc., put a an #ifdef around the set, and then do "#else"
  and a series of case labels and a break. See OPENSSL_NO_AES in cms.c
  for example.

Reviewed-by: Matt Caswell <matt@openssl.org>
22 files changed:
apps/ciphers.c
apps/cms.c
apps/crl.c
apps/dgst.c
apps/dhparam.c
apps/dsa.c
apps/dsaparam.c
apps/ec.c
apps/enc.c
apps/gendsa.c
apps/genpkey.c
apps/passwd.c
apps/pkcs12.c
apps/req.c
apps/rsa.c
apps/s_client.c
apps/s_server.c
apps/s_time.c
apps/speed.c
apps/ts.c
apps/verify.c
apps/x509.c