Commit d8086604 authored by Ben Laurie's avatar Ben Laurie
Browse files

Fix warnings.

parent 75a86fa0
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ static int get_asym_dev_crypto(void);
static int open_dev_crypto(void);
static int get_dev_crypto(void);
static int get_cryptodev_ciphers(const int **cnids);
static int get_cryptodev_digests(const int **cnids);
/*static int get_cryptodev_digests(const int **cnids);*/
static int cryptodev_usable_ciphers(const int **nids);
static int cryptodev_usable_digests(const int **nids);
static int cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
@@ -124,7 +124,7 @@ static int cryptodev_mod_exp_dh(const DH *dh, BIGNUM *r, const BIGNUM *a,
static int cryptodev_dh_compute_key(unsigned char *key,
    const BIGNUM *pub_key, DH *dh);
static int cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p,
    void (*f)());
    void (*f)(void));
void ENGINE_load_cryptodev(void);

static const ENGINE_CMD_DEFN cryptodev_defns[] = {
@@ -149,6 +149,7 @@ static struct {
	{ 0,				NID_undef,		0,	 0, },
};

#if 0  /* not (yet?) used */
static struct {
	int	id;
	int	nid;
@@ -163,6 +164,7 @@ static struct {
	{ CRYPTO_SHA1,			NID_sha1,		20},
	{ 0,				NID_undef,		0},
};
#endif  /* 0 */

/*
 * Return a fd if /dev/crypto seems usable, 0 otherwise.
@@ -259,6 +261,7 @@ get_cryptodev_ciphers(const int **cnids)
 * returning them here is harmless, as long as we return NULL
 * when asked for a handler in the cryptodev_engine_digests routine
 */
#if 0  /* not (yet?) used */
static int
get_cryptodev_digests(const int **cnids)
{
@@ -290,6 +293,7 @@ get_cryptodev_digests(const int **cnids)
		*cnids = NULL;
	return (count);
}
#endif  /* 0 */

/*
 * Find the useable ciphers|digests from dev/crypto - this is the first
@@ -348,7 +352,7 @@ cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
	struct crypt_op cryp;
	struct dev_crypto_state *state = ctx->cipher_data;
	struct session_op *sess = &state->d_sess;
	void *iiv;
	const void *iiv;
	unsigned char save_iv[EVP_MAX_IV_LENGTH];

	if (state->d_fd < 0)
@@ -372,7 +376,7 @@ cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
	if (ctx->cipher->iv_len) {
		cryp.iv = (caddr_t) ctx->iv;
		if (!ctx->encrypt) {
			iiv = (void *) in + inl - ctx->cipher->iv_len;
			iiv = in + inl - ctx->cipher->iv_len;
			memcpy(save_iv, iiv, ctx->cipher->iv_len);
		}
	} else
@@ -387,7 +391,7 @@ cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,

	if (ctx->cipher->iv_len) {
		if (ctx->encrypt)
			iiv = (void *) out + inl - ctx->cipher->iv_len;
			iiv = out + inl - ctx->cipher->iv_len;
		else
			iiv = save_iv;
		memcpy(ctx->iv, iiv, ctx->cipher->iv_len);
@@ -401,7 +405,7 @@ cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
{
	struct dev_crypto_state *state = ctx->cipher_data;
	struct session_op *sess = &state->d_sess;
	int cipher, i;
	int cipher = -1, i;

	for (i = 0; ciphers[i].id; i++)
		if (ctx->cipher->nid == ciphers[i].nid &&
@@ -1284,7 +1288,7 @@ static DH_METHOD cryptodev_dh = {
 * but I expect we'll want some options soon.
 */
static int
cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)())
cryptodev_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
{
#ifdef HAVE_SYSLOG_R
	struct syslog_data sd = SYSLOG_DATA_INIT;