summaryrefslogtreecommitdiffstats
path: root/crypto.c
diff options
context:
space:
mode:
authorAdriaan de Jong <dejong@fox-it.com>2011-06-23 10:18:36 +0200
committerDavid Sommerseth <davids@redhat.com>2011-10-19 22:05:45 +0200
commit7151f3f78ea49e3ce98619884aa4e2aa57cb90fb (patch)
treee28ecc5b45501d5c95fb73fc82c3b2abc0121307 /crypto.c
parent23ee3563de28820919fe83f8f5b7289dc4ed42ae (diff)
downloadopenvpn-7151f3f78ea49e3ce98619884aa4e2aa57cb90fb.tar.gz
openvpn-7151f3f78ea49e3ce98619884aa4e2aa57cb90fb.tar.xz
openvpn-7151f3f78ea49e3ce98619884aa4e2aa57cb90fb.zip
Refactored show_available_* functions
Signed-off-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'crypto.c')
-rw-r--r--crypto.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/crypto.c b/crypto.c
index a1986e0..409c298 100644
--- a/crypto.c
+++ b/crypto.c
@@ -1451,91 +1451,6 @@ key_len_err:
return 0;
}
-void
-show_available_ciphers ()
-{
- int nid;
-
-
-#ifndef ENABLE_SMALL
- printf ("The following ciphers and cipher modes are available\n"
- "for use with " PACKAGE_NAME ". Each cipher shown below may be\n"
- "used as a parameter to the --cipher option. The default\n"
- "key size is shown as well as whether or not it can be\n"
- "changed with the --keysize directive. Using a CBC mode\n"
- "is recommended.\n\n");
-#endif
-
- for (nid = 0; nid < 10000; ++nid) /* is there a better way to get the size of the nid list? */
- {
- const EVP_CIPHER *cipher = EVP_get_cipherbynid (nid);
- if (cipher && cipher_ok (OBJ_nid2sn (nid)))
- {
- const unsigned int mode = EVP_CIPHER_mode (cipher);
- if (mode == EVP_CIPH_CBC_MODE
-#ifdef ALLOW_NON_CBC_CIPHERS
- || mode == EVP_CIPH_CFB_MODE || mode == EVP_CIPH_OFB_MODE
-#endif
- )
- printf ("%s %d bit default key (%s)\n",
- OBJ_nid2sn (nid),
- EVP_CIPHER_key_length (cipher) * 8,
- ((EVP_CIPHER_flags (cipher) & EVP_CIPH_VARIABLE_LENGTH) ?
- "variable" : "fixed"));
- }
- }
- printf ("\n");
-}
-
-void
-show_available_digests ()
-{
- int nid;
-
-#ifndef ENABLE_SMALL
- printf ("The following message digests are available for use with\n"
- PACKAGE_NAME ". A message digest is used in conjunction with\n"
- "the HMAC function, to authenticate received packets.\n"
- "You can specify a message digest as parameter to\n"
- "the --auth option.\n\n");
-#endif
-
- for (nid = 0; nid < 10000; ++nid)
- {
- const EVP_MD *digest = EVP_get_digestbynid (nid);
- if (digest)
- {
- printf ("%s %d bit digest size\n",
- OBJ_nid2sn (nid), EVP_MD_size (digest) * 8);
- }
- }
- printf ("\n");
-}
-
-void
-show_available_engines ()
-{
-#if CRYPTO_ENGINE
- ENGINE *e;
-
- printf ("OpenSSL Crypto Engines\n\n");
-
- ENGINE_load_builtin_engines ();
-
- e = ENGINE_get_first ();
- while (e)
- {
- printf ("%s [%s]\n",
- ENGINE_get_name (e),
- ENGINE_get_id (e));
- e = ENGINE_get_next (e);
- }
- ENGINE_cleanup ();
-#else
- printf ("Sorry, OpenSSL hardware crypto engine functionality is not available.\n");
-#endif
-}
-
/*
* Enable crypto acceleration, if available
*/