[SCTP]: Use HMAC template and hash interface
This patch converts SCTP to use the new HMAC template and hash interface. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -312,9 +312,9 @@ enum { SCTP_MAX_GABS = 16 };
|
||||
*/
|
||||
|
||||
#if defined (CONFIG_SCTP_HMAC_MD5)
|
||||
#define SCTP_COOKIE_HMAC_ALG "md5"
|
||||
#define SCTP_COOKIE_HMAC_ALG "hmac(md5)"
|
||||
#elif defined (CONFIG_SCTP_HMAC_SHA1)
|
||||
#define SCTP_COOKIE_HMAC_ALG "sha1"
|
||||
#define SCTP_COOKIE_HMAC_ALG "hmac(sha1)"
|
||||
#else
|
||||
#define SCTP_COOKIE_HMAC_ALG NULL
|
||||
#endif
|
||||
|
@@ -330,17 +330,6 @@ static inline void sctp_v6_exit(void) { return; }
|
||||
|
||||
#endif /* #if defined(CONFIG_IPV6) */
|
||||
|
||||
/* Some wrappers, in case crypto not available. */
|
||||
#if defined (CONFIG_CRYPTO_HMAC)
|
||||
#define sctp_crypto_alloc_tfm crypto_alloc_tfm
|
||||
#define sctp_crypto_free_tfm crypto_free_tfm
|
||||
#define sctp_crypto_hmac crypto_hmac
|
||||
#else
|
||||
#define sctp_crypto_alloc_tfm(x...) NULL
|
||||
#define sctp_crypto_free_tfm(x...)
|
||||
#define sctp_crypto_hmac(x...)
|
||||
#endif
|
||||
|
||||
|
||||
/* Map an association to an assoc_id. */
|
||||
static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc)
|
||||
|
@@ -87,6 +87,7 @@ struct sctp_bind_addr;
|
||||
struct sctp_ulpq;
|
||||
struct sctp_ep_common;
|
||||
struct sctp_ssnmap;
|
||||
struct crypto_hash;
|
||||
|
||||
|
||||
#include <net/sctp/tsnmap.h>
|
||||
@@ -264,7 +265,7 @@ struct sctp_sock {
|
||||
struct sctp_pf *pf;
|
||||
|
||||
/* Access to HMAC transform. */
|
||||
struct crypto_tfm *hmac;
|
||||
struct crypto_hash *hmac;
|
||||
|
||||
/* What is our base endpointer? */
|
||||
struct sctp_endpoint *ep;
|
||||
|
Reference in New Issue
Block a user