aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sctp/Kconfig27
-rw-r--r--net/sctp/protocol.c4
2 files changed, 27 insertions, 4 deletions
diff --git a/net/sctp/Kconfig b/net/sctp/Kconfig
index a9edd2e205f4..c26210618e14 100644
--- a/net/sctp/Kconfig
+++ b/net/sctp/Kconfig
@@ -66,12 +66,36 @@ config SCTP_DBG_OBJCNT
66 'cat /proc/net/sctp/sctp_dbg_objcnt' 66 'cat /proc/net/sctp/sctp_dbg_objcnt'
67 67
68 If unsure, say N 68 If unsure, say N
69choice
70 prompt "Default SCTP cookie HMAC encoding"
71 default SCTP_COOKIE_HMAC_MD5
72 help
73 This option sets the default sctp cookie hmac algorithm
74 when in doubt select 'md5'
75
76config SCTP_DEFAULT_COOKIE_HMAC_MD5
77 bool "Enable optional MD5 hmac cookie generation"
78 help
79 Enable optional MD5 hmac based SCTP cookie generation
80 select SCTP_COOKIE_HMAC_MD5
81
82config SCTP_DEFAULT_COOKIE_HMAC_SHA1
83 bool "Enable optional SHA1 hmac cookie generation"
84 help
85 Enable optional SHA1 hmac based SCTP cookie generation
86 select SCTP_COOKIE_HMAC_SHA1
87
88config SCTP_DEFAULT_COOKIE_HMAC_NONE
89 bool "Use no hmac alg in SCTP cookie generation"
90 help
91 Use no hmac algorithm in SCTP cookie generation
92
93endchoice
69 94
70config SCTP_COOKIE_HMAC_MD5 95config SCTP_COOKIE_HMAC_MD5
71 bool "Enable optional MD5 hmac cookie generation" 96 bool "Enable optional MD5 hmac cookie generation"
72 help 97 help
73 Enable optional MD5 hmac based SCTP cookie generation 98 Enable optional MD5 hmac based SCTP cookie generation
74 default y
75 select CRYPTO_HMAC if SCTP_COOKIE_HMAC_MD5 99 select CRYPTO_HMAC if SCTP_COOKIE_HMAC_MD5
76 select CRYPTO_MD5 if SCTP_COOKIE_HMAC_MD5 100 select CRYPTO_MD5 if SCTP_COOKIE_HMAC_MD5
77 101
@@ -79,7 +103,6 @@ config SCTP_COOKIE_HMAC_SHA1
79 bool "Enable optional SHA1 hmac cookie generation" 103 bool "Enable optional SHA1 hmac cookie generation"
80 help 104 help
81 Enable optional SHA1 hmac based SCTP cookie generation 105 Enable optional SHA1 hmac based SCTP cookie generation
82 default y
83 select CRYPTO_HMAC if SCTP_COOKIE_HMAC_SHA1 106 select CRYPTO_HMAC if SCTP_COOKIE_HMAC_SHA1
84 select CRYPTO_SHA1 if SCTP_COOKIE_HMAC_SHA1 107 select CRYPTO_SHA1 if SCTP_COOKIE_HMAC_SHA1
85 108
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 2c7785bacf74..f898b1c58bd2 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1191,9 +1191,9 @@ static int __net_init sctp_net_init(struct net *net)
1191 net->sctp.cookie_preserve_enable = 1; 1191 net->sctp.cookie_preserve_enable = 1;
1192 1192
1193 /* Default sctp sockets to use md5 as their hmac alg */ 1193 /* Default sctp sockets to use md5 as their hmac alg */
1194#if defined (CONFIG_CRYPTO_MD5) 1194#if defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_MD5)
1195 net->sctp.sctp_hmac_alg = "md5"; 1195 net->sctp.sctp_hmac_alg = "md5";
1196#elif defined (CONFIG_CRYPTO_SHA1) 1196#elif defined (CONFIG_SCTP_DEFAULT_COOKIE_HMAC_SHA1)
1197 net->sctp.sctp_hmac_alg = "sha1"; 1197 net->sctp.sctp_hmac_alg = "sha1";
1198#else 1198#else
1199 net->sctp.sctp_hmac_alg = NULL; 1199 net->sctp.sctp_hmac_alg = NULL;