Date: Thu, 16 Dec 2010 11:20:37 +0000 (UTC) From: Shteryana Shopova <syrinx@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216482 - head/contrib/bsnmp/lib Message-ID: <201012161120.oBGBKbSa047358@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: syrinx Date: Thu Dec 16 11:20:37 2010 New Revision: 216482 URL: http://svn.freebsd.org/changeset/base/216482 Log: Silence the compiler warnings in libbsnmp by removing several (now) unsed parameters. Sponsored by: The FreeBSD Foundation Reviewed by: philip@ Modified: head/contrib/bsnmp/lib/snmp.c head/contrib/bsnmp/lib/snmpcrypto.c head/contrib/bsnmp/lib/snmppriv.h Modified: head/contrib/bsnmp/lib/snmp.c ============================================================================== --- head/contrib/bsnmp/lib/snmp.c Thu Dec 16 10:58:45 2010 (r216481) +++ head/contrib/bsnmp/lib/snmp.c Thu Dec 16 11:20:37 2010 (r216482) @@ -640,7 +640,7 @@ snmp_pdu_decode_secmode(struct asn_buf * (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 * (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, str 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, str 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); Modified: head/contrib/bsnmp/lib/snmpcrypto.c ============================================================================== --- head/contrib/bsnmp/lib/snmpcrypto.c Thu Dec 16 10:58:45 2010 (r216481) +++ head/contrib/bsnmp/lib/snmpcrypto.c Thu Dec 16 11:20:37 2010 (r216482) @@ -87,8 +87,7 @@ snmp_digest_init(const struct snmp_user } 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_p } 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, cons } 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 *us 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 *us #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 _ } 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 __unu } 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); Modified: head/contrib/bsnmp/lib/snmppriv.h ============================================================================== --- head/contrib/bsnmp/lib/snmppriv.h Thu Dec 16 10:58:45 2010 (r216481) +++ head/contrib/bsnmp/lib/snmppriv.h Thu Dec 16 11:20:37 2010 (r216482) @@ -41,10 +41,9 @@ enum asn_err snmp_parse_pdus_hdr(struct 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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012161120.oBGBKbSa047358>