*
*/
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
CONF *config = NULL;
BIO *bio_err = NULL;
-static void
+static void
lock_dbg_cb(int mode, int type, const char *file, int line)
{
static int modes[CRYPTO_NUM_LOCKS]; /* = {0, 0, ... } */
#define ARGV Argv
-int
+int
main(int Argc, char *ARGV[])
{
ARGS arg;
config = NCONF_new(NULL);
i = NCONF_load(config, p, &errline);
if (i == 0) {
- if (ERR_GET_REASON(ERR_peek_last_error())
- == CONF_R_NO_SUCH_FILE) {
+ if (ERR_GET_REASON(ERR_peek_last_error()) ==
+ CONF_R_NO_SUCH_FILE) {
BIO_printf(bio_err,
"WARNING: can't open config file: %s\n", p);
ERR_clear_error();
}
BIO_printf(bio_err, "bad exit\n");
ret = 1;
+
end:
if (to_free)
free(to_free);
#define LIST_PUBLIC_KEY_ALGORITHMS "list-public-key-algorithms"
-static int
+static int
do_cmd(LHASH_OF(FUNCTION) * prog, int argc, char *argv[])
{
FUNCTION f, *fp;
BIO_free_all(bio_stdout);
goto end;
} else if ((strcmp(argv[0], "quit") == 0) ||
- (strcmp(argv[0], "q") == 0) ||
- (strcmp(argv[0], "exit") == 0) ||
+ (strcmp(argv[0], "q") == 0) ||
+ (strcmp(argv[0], "exit") == 0) ||
(strcmp(argv[0], "bye") == 0)) {
ret = -1;
goto end;
} else if ((strcmp(argv[0], LIST_STANDARD_COMMANDS) == 0) ||
- (strcmp(argv[0], LIST_MESSAGE_DIGEST_COMMANDS) == 0) ||
- (strcmp(argv[0], LIST_MESSAGE_DIGEST_ALGORITHMS) == 0) ||
- (strcmp(argv[0], LIST_CIPHER_COMMANDS) == 0) ||
- (strcmp(argv[0], LIST_CIPHER_ALGORITHMS) == 0) ||
+ (strcmp(argv[0], LIST_MESSAGE_DIGEST_COMMANDS) == 0) ||
+ (strcmp(argv[0], LIST_MESSAGE_DIGEST_ALGORITHMS) == 0) ||
+ (strcmp(argv[0], LIST_CIPHER_COMMANDS) == 0) ||
+ (strcmp(argv[0], LIST_CIPHER_ALGORITHMS) == 0) ||
(strcmp(argv[0], LIST_PUBLIC_KEY_ALGORITHMS) == 0)) {
int list_type;
BIO *bio_stdout;
ret = 0;
goto end;
} else {
- BIO_printf(bio_err, "openssl:Error: '%s' is an invalid command.\n",
+ BIO_printf(bio_err,
+ "openssl:Error: '%s' is an invalid command.\n",
argv[0]);
BIO_printf(bio_err, "\nStandard commands");
i = 0;
return (ret);
}
-static int
+static int
SortFnByName(const void *_f1, const void *_f2)
{
const FUNCTION *f1 = _f1;
return strcmp(f1->name, f2->name);
}
-static void
+static void
list_pkey(BIO * out)
{
int i;
+
for (i = 0; i < EVP_PKEY_asn1_get_count(); i++) {
const EVP_PKEY_ASN1_METHOD *ameth;
int pkey_id, pkey_base_id, pkey_flags;
}
}
-static void
-list_cipher_fn(const EVP_CIPHER * c,
- const char *from, const char *to, void *arg)
+static void
+list_cipher_fn(const EVP_CIPHER * c, const char *from, const char *to,
+ void *arg)
{
if (c)
BIO_printf(arg, "%s\n", EVP_CIPHER_name(c));
}
}
-static void
+static void
list_cipher(BIO * out)
{
EVP_CIPHER_do_all_sorted(list_cipher_fn, out);
}
-static void
-list_md_fn(const EVP_MD * m,
- const char *from, const char *to, void *arg)
+static void
+list_md_fn(const EVP_MD * m, const char *from, const char *to, void *arg)
{
if (m)
BIO_printf(arg, "%s\n", EVP_MD_name(m));
}
}
-static void
+static void
list_md(BIO * out)
{
EVP_MD_do_all_sorted(list_md_fn, out);
}
-static int
+static int
function_cmp(const FUNCTION * a, const FUNCTION * b)
{
return strncmp(a->name, b->name, 8);
}
-static
-IMPLEMENT_LHASH_COMP_FN(function, FUNCTION)
- static unsigned long function_hash(const FUNCTION * a)
+
+static IMPLEMENT_LHASH_COMP_FN(function, FUNCTION)
+
+static unsigned long
+function_hash(const FUNCTION * a)
{
return lh_strhash(a->name);
}
-static
-IMPLEMENT_LHASH_HASH_FN(function, FUNCTION)
- static LHASH_OF(FUNCTION) * prog_init(void)
+
+static IMPLEMENT_LHASH_HASH_FN(function, FUNCTION)
+
+static LHASH_OF(FUNCTION) *
+prog_init(void)
{
LHASH_OF(FUNCTION) * ret;
FUNCTION *f;
size_t i;
/* Purely so it looks nice when the user hits ? */
- for (i = 0, f = functions; f->name != NULL; ++f, ++i);
+ for (i = 0, f = functions; f->name != NULL; ++f, ++i)
+ ;
qsort(functions, i, sizeof *functions, SortFnByName);
if ((ret = lh_FUNCTION_new()) == NULL)