Silence the compiler warnings in libbsnmp by removing several (now)
unsed parameters. Sponsored by: The FreeBSD Foundation Reviewed by: philip@
This commit is contained in:
parent
b1fa97ea3c
commit
c913d3117c
@ -640,7 +640,7 @@ snmp_pdu_decode_secmode(struct asn_buf *b, struct snmp_pdu *pdu)
|
||||
(pdu->flags & SNMP_MSG_AUTH_FLAG) == 0)
|
||||
return (SNMP_CODE_BADSECLEVEL);
|
||||
|
||||
if ((code = snmp_pdu_calc_digest(b, pdu, digest)) !=
|
||||
if ((code = snmp_pdu_calc_digest(pdu, digest)) !=
|
||||
SNMP_CODE_OK)
|
||||
return (SNMP_CODE_FAILED);
|
||||
|
||||
@ -659,7 +659,7 @@ snmp_pdu_decode_secmode(struct asn_buf *b, struct snmp_pdu *pdu)
|
||||
(pdu->flags & SNMP_MSG_PRIV_FLAG) == 0)
|
||||
return (SNMP_CODE_BADSECLEVEL);
|
||||
|
||||
if ((code = snmp_pdu_decrypt(b, pdu)) != SNMP_CODE_OK)
|
||||
if ((code = snmp_pdu_decrypt(pdu)) != SNMP_CODE_OK)
|
||||
return (SNMP_CODE_FAILED);
|
||||
|
||||
return (code);
|
||||
@ -869,7 +869,7 @@ snmp_fix_encoding(struct asn_buf *b, struct snmp_pdu *pdu)
|
||||
if (pdu->security_model != SNMP_SECMODEL_USM)
|
||||
return (SNMP_CODE_FAILED);
|
||||
|
||||
if (snmp_pdu_encrypt(b, pdu) != SNMP_CODE_OK)
|
||||
if (snmp_pdu_encrypt(pdu) != SNMP_CODE_OK)
|
||||
return (SNMP_CODE_FAILED);
|
||||
|
||||
if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV &&
|
||||
@ -884,7 +884,7 @@ snmp_fix_encoding(struct asn_buf *b, struct snmp_pdu *pdu)
|
||||
pdu->digest_ptr -= moved;
|
||||
|
||||
if (pdu->version == SNMP_V3) {
|
||||
if ((code = snmp_pdu_calc_digest(b, pdu, pdu->msg_digest)) !=
|
||||
if ((code = snmp_pdu_calc_digest(pdu, pdu->msg_digest)) !=
|
||||
SNMP_CODE_OK)
|
||||
return (SNMP_CODE_FAILED);
|
||||
|
||||
|
@ -87,8 +87,7 @@ snmp_digest_init(const struct snmp_user *user, EVP_MD_CTX *ctx,
|
||||
}
|
||||
|
||||
enum snmp_code
|
||||
snmp_pdu_calc_digest(struct asn_buf *b, const struct snmp_pdu *pdu,
|
||||
uint8_t *digest)
|
||||
snmp_pdu_calc_digest(const struct snmp_pdu *pdu, uint8_t *digest)
|
||||
{
|
||||
uint8_t md[EVP_MAX_MD_SIZE], extkey[SNMP_EXTENDED_KEY_SIZ];
|
||||
uint8_t key1[SNMP_EXTENDED_KEY_SIZ], key2[SNMP_EXTENDED_KEY_SIZ];
|
||||
@ -140,7 +139,7 @@ failed:
|
||||
|
||||
static int32_t
|
||||
snmp_pdu_cipher_init(const struct snmp_pdu *pdu, int32_t len,
|
||||
EVP_CIPHER_CTX *ctx, const EVP_CIPHER **ctype, uint8_t *piv)
|
||||
const EVP_CIPHER **ctype, uint8_t *piv)
|
||||
{
|
||||
int i;
|
||||
uint32_t netint;
|
||||
@ -172,14 +171,14 @@ snmp_pdu_cipher_init(const struct snmp_pdu *pdu, int32_t len,
|
||||
}
|
||||
|
||||
enum snmp_code
|
||||
snmp_pdu_encrypt(struct asn_buf *b, const struct snmp_pdu *pdu)
|
||||
snmp_pdu_encrypt(const struct snmp_pdu *pdu)
|
||||
{
|
||||
int32_t err, olen;
|
||||
uint8_t iv[SNMP_PRIV_AES_IV_SIZ];
|
||||
const EVP_CIPHER *ctype;
|
||||
EVP_CIPHER_CTX ctx;
|
||||
|
||||
err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctx, &ctype, iv);
|
||||
err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctype, iv);
|
||||
if (err < 0)
|
||||
return (SNMP_CODE_EDECRYPT);
|
||||
else if (err == 0)
|
||||
@ -200,14 +199,14 @@ snmp_pdu_encrypt(struct asn_buf *b, const struct snmp_pdu *pdu)
|
||||
}
|
||||
|
||||
enum snmp_code
|
||||
snmp_pdu_decrypt(struct asn_buf *b, const struct snmp_pdu *pdu)
|
||||
snmp_pdu_decrypt(const struct snmp_pdu *pdu)
|
||||
{
|
||||
int32_t err, olen;
|
||||
uint8_t iv[SNMP_PRIV_AES_IV_SIZ];
|
||||
const EVP_CIPHER *ctype;
|
||||
EVP_CIPHER_CTX ctx;
|
||||
|
||||
err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctx, &ctype, iv);
|
||||
err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctype, iv);
|
||||
if (err < 0)
|
||||
return (SNMP_CODE_EDECRYPT);
|
||||
else if (err == 0)
|
||||
@ -310,8 +309,8 @@ snmp_get_local_keys(struct snmp_user *user, uint8_t *eid, uint32_t elen)
|
||||
enum snmp_code
|
||||
snmp_calc_keychange(struct snmp_user *user, uint8_t *keychange)
|
||||
{
|
||||
int32_t i, err, rvalue[SNMP_AUTH_HMACSHA_KEY_SIZ / 4];
|
||||
uint32_t keylen, olen;
|
||||
int32_t err, rvalue[SNMP_AUTH_HMACSHA_KEY_SIZ / 4];
|
||||
uint32_t i, keylen, olen;
|
||||
const EVP_MD *dtype;
|
||||
EVP_MD_CTX ctx;
|
||||
|
||||
@ -340,8 +339,7 @@ snmp_calc_keychange(struct snmp_user *user, uint8_t *keychange)
|
||||
#else /* !HAVE_LIBCRYPTO */
|
||||
|
||||
enum snmp_code
|
||||
snmp_pdu_calc_digest(struct asn_buf *b __unused, const struct snmp_pdu *pdu,
|
||||
uint8_t *digest __unused)
|
||||
snmp_pdu_calc_digest(const struct snmp_pdu *pdu, uint8_t *digest __unused)
|
||||
{
|
||||
if (pdu->user.auth_proto != SNMP_AUTH_NOAUTH)
|
||||
return (SNMP_CODE_BADSECLEVEL);
|
||||
@ -351,7 +349,7 @@ snmp_pdu_calc_digest(struct asn_buf *b __unused, const struct snmp_pdu *pdu,
|
||||
}
|
||||
|
||||
enum snmp_code
|
||||
snmp_pdu_encrypt(struct asn_buf *b __unused, const struct snmp_pdu *pdu)
|
||||
snmp_pdu_encrypt(const struct snmp_pdu *pdu)
|
||||
{
|
||||
if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV)
|
||||
return (SNMP_CODE_BADSECLEVEL);
|
||||
@ -360,7 +358,7 @@ snmp_pdu_encrypt(struct asn_buf *b __unused, const struct snmp_pdu *pdu)
|
||||
}
|
||||
|
||||
enum snmp_code
|
||||
snmp_pdu_decrypt(struct asn_buf *b __unused, const struct snmp_pdu *pdu)
|
||||
snmp_pdu_decrypt(const struct snmp_pdu *pdu)
|
||||
{
|
||||
if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV)
|
||||
return (SNMP_CODE_BADSECLEVEL);
|
||||
|
@ -41,10 +41,9 @@ enum asn_err snmp_parse_pdus_hdr(struct asn_buf *b, struct snmp_pdu *pdu,
|
||||
void snmp_pdu_init_secparams(struct snmp_pdu *, struct snmp_engine *,
|
||||
struct snmp_user *);
|
||||
|
||||
enum snmp_code snmp_pdu_calc_digest(struct asn_buf *, const struct snmp_pdu *,
|
||||
uint8_t *);
|
||||
enum snmp_code snmp_pdu_encrypt(struct asn_buf *, const struct snmp_pdu *);
|
||||
enum snmp_code snmp_pdu_decrypt(struct asn_buf *, const struct snmp_pdu *);
|
||||
enum snmp_code snmp_pdu_calc_digest(const struct snmp_pdu *, uint8_t *);
|
||||
enum snmp_code snmp_pdu_encrypt(const struct snmp_pdu *);
|
||||
enum snmp_code snmp_pdu_decrypt(const struct snmp_pdu *);
|
||||
|
||||
#define DEFAULT_HOST "localhost"
|
||||
#define DEFAULT_PORT "snmp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user