summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-02-02 11:08:16 -0500
committerRich Salz <rsalz@openssl.org>2015-02-02 11:08:16 -0500
commit7aa0b022460e1a7bfdf5c70e8cd084d916bac012 (patch)
tree6ae80731638aff40d71fc428520d7dcaec76c60a /demos
parent5da05a26f21e7c43a156b65b13a9bc968a6c78db (diff)
Dead code cleanup: crypto/*.c, x509v3, demos
Some of the #if 0 code in demo's was kept, but given helpful #ifdef names, to show more sample code. Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'demos')
-rw-r--r--demos/bio/server-arg.c2
-rw-r--r--demos/engines/rsaref/rsaref.c3
-rw-r--r--demos/engines/zencod/hw_zencod.c2
-rw-r--r--demos/evp/aesgcm.c12
-rw-r--r--demos/selfsign.c4
5 files changed, 5 insertions, 18 deletions
diff --git a/demos/bio/server-arg.c b/demos/bio/server-arg.c
index 1d0e1db234..7ba54dbe50 100644
--- a/demos/bio/server-arg.c
+++ b/demos/bio/server-arg.c
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
ERR_print_errors_fp(stderr);
goto err;
}
-#if 0
+#ifdef ITERATE_CERTS
/*
* Demo of how to iterate over all certificates in an SSL_CTX structure.
*/
diff --git a/demos/engines/rsaref/rsaref.c b/demos/engines/rsaref/rsaref.c
index b6429de1a7..d5a6e6c833 100644
--- a/demos/engines/rsaref/rsaref.c
+++ b/demos/engines/rsaref/rsaref.c
@@ -36,9 +36,6 @@ static const char *engine_rsaref_name = "RSAref engine support";
static int rsaref_destroy(ENGINE *e);
static int rsaref_init(ENGINE *e);
static int rsaref_finish(ENGINE *e);
-#if 0
-static int rsaref_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) ());
-#endif
/*****************************************************************************
* Engine commands
diff --git a/demos/engines/zencod/hw_zencod.c b/demos/engines/zencod/hw_zencod.c
index 26ec3f6d1f..1c76284544 100644
--- a/demos/engines/zencod/hw_zencod.c
+++ b/demos/engines/zencod/hw_zencod.c
@@ -82,7 +82,7 @@
# define ZEN_LIBRARY "zenbridge"
-# if 0
+# ifdef ZENCOD_TRACING
# define PERROR(s) perror(s)
# define CHEESE() fputs("## [ZenEngine] ## " __FUNCTION__ "\n", stderr)
# else
diff --git a/demos/evp/aesgcm.c b/demos/evp/aesgcm.c
index 9159c5c00f..72028a04a0 100644
--- a/demos/evp/aesgcm.c
+++ b/demos/evp/aesgcm.c
@@ -85,13 +85,6 @@ void aes_gcm_decrypt(void)
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, sizeof(gcm_iv), NULL);
/* Specify key and IV */
EVP_DecryptInit_ex(ctx, NULL, NULL, gcm_key, gcm_iv);
-#if 0
- /*
- * Set expected tag value. A restriction in OpenSSL 1.0.1c and earlier
- * required the tag before any AAD or ciphertext
- */
- EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(gcm_tag), gcm_tag);
-#endif
/* Zero or more calls to specify any AAD */
EVP_DecryptUpdate(ctx, NULL, &outlen, gcm_aad, sizeof(gcm_aad));
/* Decrypt plaintext */
@@ -99,10 +92,7 @@ void aes_gcm_decrypt(void)
/* Output decrypted block */
printf("Plaintext:\n");
BIO_dump_fp(stdout, outbuf, outlen);
- /*
- * Set expected tag value. Works in OpenSSL 1.0.1d and later
- * In versions prior to OpenSSL 1.1.0 you should use EVP_CTRL_GCM_SET_TAG
- */
+ /* Set expected tag value. */
EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, sizeof(gcm_tag), gcm_tag);
/* Finalise: note get no output for GCM */
rv = EVP_DecryptFinal_ex(ctx, outbuf, &outlen);
diff --git a/demos/selfsign.c b/demos/selfsign.c
index 49228b9c16..0cc265c597 100644
--- a/demos/selfsign.c
+++ b/demos/selfsign.c
@@ -136,7 +136,7 @@ int days;
X509_add_ext(x, ex, -1);
X509_EXTENSION_free(ex);
-#if 0
+#ifdef ADD_CA_CONSTRAINT
/* might want something like this too.... */
ex = X509V3_EXT_conf_nid(NULL, NULL, NID_basic_constraints,
"critical,CA:TRUE");
@@ -145,7 +145,7 @@ int days;
X509_EXTENSION_free(ex);
#endif
-#ifdef CUSTOM_EXT
+#ifdef ADD_A_CUSTOM_EXTENSION
/* Maybe even add our own extension based on existing */
{
int nid;