diff options
-rw-r--r-- | include/net/sctp/constants.h | 9 | ||||
-rw-r--r-- | net/sctp/Kconfig | 6 | ||||
-rw-r--r-- | net/sctp/auth.c | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index f30b537d6952..05f22a6afbcd 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -441,11 +441,14 @@ enum { | |||
441 | SCTP_AUTH_HMAC_ID_RESERVED_0, | 441 | SCTP_AUTH_HMAC_ID_RESERVED_0, |
442 | SCTP_AUTH_HMAC_ID_SHA1, | 442 | SCTP_AUTH_HMAC_ID_SHA1, |
443 | SCTP_AUTH_HMAC_ID_RESERVED_2, | 443 | SCTP_AUTH_HMAC_ID_RESERVED_2, |
444 | SCTP_AUTH_HMAC_ID_SHA256 | 444 | #if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE) |
445 | SCTP_AUTH_HMAC_ID_SHA256, | ||
446 | #endif | ||
447 | __SCTP_AUTH_HMAC_MAX | ||
445 | }; | 448 | }; |
446 | 449 | ||
447 | #define SCTP_AUTH_HMAC_ID_MAX SCTP_AUTH_HMAC_ID_SHA256 | 450 | #define SCTP_AUTH_HMAC_ID_MAX __SCTP_AUTH_HMAC_MAX - 1 |
448 | #define SCTP_AUTH_NUM_HMACS (SCTP_AUTH_HMAC_ID_SHA256 + 1) | 451 | #define SCTP_AUTH_NUM_HMACS __SCTP_AUTH_HMAC_MAX |
449 | #define SCTP_SHA1_SIG_SIZE 20 | 452 | #define SCTP_SHA1_SIG_SIZE 20 |
450 | #define SCTP_SHA256_SIG_SIZE 32 | 453 | #define SCTP_SHA256_SIG_SIZE 32 |
451 | 454 | ||
diff --git a/net/sctp/Kconfig b/net/sctp/Kconfig index 8210f549c492..5390bc792159 100644 --- a/net/sctp/Kconfig +++ b/net/sctp/Kconfig | |||
@@ -6,9 +6,9 @@ menuconfig IP_SCTP | |||
6 | tristate "The SCTP Protocol (EXPERIMENTAL)" | 6 | tristate "The SCTP Protocol (EXPERIMENTAL)" |
7 | depends on INET && EXPERIMENTAL | 7 | depends on INET && EXPERIMENTAL |
8 | depends on IPV6 || IPV6=n | 8 | depends on IPV6 || IPV6=n |
9 | select CRYPTO if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5 | 9 | select CRYPTO |
10 | select CRYPTO_HMAC if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5 | 10 | select CRYPTO_HMAC |
11 | select CRYPTO_SHA1 if SCTP_HMAC_SHA1 | 11 | select CRYPTO_SHA1 |
12 | select CRYPTO_MD5 if SCTP_HMAC_MD5 | 12 | select CRYPTO_MD5 if SCTP_HMAC_MD5 |
13 | ---help--- | 13 | ---help--- |
14 | Stream Control Transmission Protocol | 14 | Stream Control Transmission Protocol |
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 6d89e35307aa..97e6ebd14500 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c | |||
@@ -54,11 +54,13 @@ static struct sctp_hmac sctp_hmac_list[SCTP_AUTH_NUM_HMACS] = { | |||
54 | /* id 2 is reserved as well */ | 54 | /* id 2 is reserved as well */ |
55 | .hmac_id = SCTP_AUTH_HMAC_ID_RESERVED_2, | 55 | .hmac_id = SCTP_AUTH_HMAC_ID_RESERVED_2, |
56 | }, | 56 | }, |
57 | #if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE) | ||
57 | { | 58 | { |
58 | .hmac_id = SCTP_AUTH_HMAC_ID_SHA256, | 59 | .hmac_id = SCTP_AUTH_HMAC_ID_SHA256, |
59 | .hmac_name="hmac(sha256)", | 60 | .hmac_name="hmac(sha256)", |
60 | .hmac_len = SCTP_SHA256_SIG_SIZE, | 61 | .hmac_len = SCTP_SHA256_SIG_SIZE, |
61 | } | 62 | } |
63 | #endif | ||
62 | }; | 64 | }; |
63 | 65 | ||
64 | 66 | ||