diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-08-20 01:07:14 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2006-09-20 21:46:19 -0400 |
commit | 1b489e11d4df82514792f9f981f31976f8a94ddf (patch) | |
tree | fe047012069eb528fc18518fc4340a02ab9b0adc /include/net/sctp | |
parent | 07d4ee583e21830ec5604d31f65cdc60a6eca19e (diff) |
[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>
Diffstat (limited to 'include/net/sctp')
-rw-r--r-- | include/net/sctp/constants.h | 4 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 11 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 3 |
3 files changed, 4 insertions, 14 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index c51541ee0247..57166bfdf8eb 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -312,9 +312,9 @@ enum { SCTP_MAX_GABS = 16 }; | |||
312 | */ | 312 | */ |
313 | 313 | ||
314 | #if defined (CONFIG_SCTP_HMAC_MD5) | 314 | #if defined (CONFIG_SCTP_HMAC_MD5) |
315 | #define SCTP_COOKIE_HMAC_ALG "md5" | 315 | #define SCTP_COOKIE_HMAC_ALG "hmac(md5)" |
316 | #elif defined (CONFIG_SCTP_HMAC_SHA1) | 316 | #elif defined (CONFIG_SCTP_HMAC_SHA1) |
317 | #define SCTP_COOKIE_HMAC_ALG "sha1" | 317 | #define SCTP_COOKIE_HMAC_ALG "hmac(sha1)" |
318 | #else | 318 | #else |
319 | #define SCTP_COOKIE_HMAC_ALG NULL | 319 | #define SCTP_COOKIE_HMAC_ALG NULL |
320 | #endif | 320 | #endif |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 92eae0e0f3f1..1c1abce5f6b6 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -330,17 +330,6 @@ static inline void sctp_v6_exit(void) { return; } | |||
330 | 330 | ||
331 | #endif /* #if defined(CONFIG_IPV6) */ | 331 | #endif /* #if defined(CONFIG_IPV6) */ |
332 | 332 | ||
333 | /* Some wrappers, in case crypto not available. */ | ||
334 | #if defined (CONFIG_CRYPTO_HMAC) | ||
335 | #define sctp_crypto_alloc_tfm crypto_alloc_tfm | ||
336 | #define sctp_crypto_free_tfm crypto_free_tfm | ||
337 | #define sctp_crypto_hmac crypto_hmac | ||
338 | #else | ||
339 | #define sctp_crypto_alloc_tfm(x...) NULL | ||
340 | #define sctp_crypto_free_tfm(x...) | ||
341 | #define sctp_crypto_hmac(x...) | ||
342 | #endif | ||
343 | |||
344 | 333 | ||
345 | /* Map an association to an assoc_id. */ | 334 | /* Map an association to an assoc_id. */ |
346 | static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) | 335 | static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index e5aa7ff1f5b5..0412e730c765 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -87,6 +87,7 @@ struct sctp_bind_addr; | |||
87 | struct sctp_ulpq; | 87 | struct sctp_ulpq; |
88 | struct sctp_ep_common; | 88 | struct sctp_ep_common; |
89 | struct sctp_ssnmap; | 89 | struct sctp_ssnmap; |
90 | struct crypto_hash; | ||
90 | 91 | ||
91 | 92 | ||
92 | #include <net/sctp/tsnmap.h> | 93 | #include <net/sctp/tsnmap.h> |
@@ -264,7 +265,7 @@ struct sctp_sock { | |||
264 | struct sctp_pf *pf; | 265 | struct sctp_pf *pf; |
265 | 266 | ||
266 | /* Access to HMAC transform. */ | 267 | /* Access to HMAC transform. */ |
267 | struct crypto_tfm *hmac; | 268 | struct crypto_hash *hmac; |
268 | 269 | ||
269 | /* What is our base endpointer? */ | 270 | /* What is our base endpointer? */ |
270 | struct sctp_endpoint *ep; | 271 | struct sctp_endpoint *ep; |