Skip to content

Commit

Permalink
esp, ah: modernize the crypto algorithm selections
Browse files Browse the repository at this point in the history
The crypto algorithms selected by the ESP and AH kconfig options are
out-of-date with the guidance of RFC 8221, which lists the legacy
algorithms MD5 and DES as "MUST NOT" be implemented, and some more
modern algorithms like AES-GCM and HMAC-SHA256 as "MUST" be implemented.
But the options select the legacy algorithms, not the modern ones.

Therefore, modify these options to select the MUST algorithms --
and *only* the MUST algorithms.

Also improve the help text.

Note that other algorithms may still be explicitly enabled in the
kconfig, and the choice of which to actually use is still controlled by
userspace.  This change only modifies the list of algorithms for which
kernel support is guaranteed to be present.

Suggested-by: Herbert Xu <[email protected]>
Suggested-by: Steffen Klassert <[email protected]>
Acked-by: Herbert Xu <[email protected]>
Cc: Corentin Labbe <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
  • Loading branch information
ebiggers authored and klassert committed Jun 15, 2020
1 parent 37ea0f1 commit be01369
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
18 changes: 16 additions & 2 deletions net/ipv4/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,29 @@ config INET_AH
tristate "IP: AH transformation"
select XFRM_AH
---help---
Support for IPsec AH.
Support for IPsec AH (Authentication Header).

AH can be used with various authentication algorithms. Besides
enabling AH support itself, this option enables the generic
implementations of the algorithms that RFC 8221 lists as MUST be
implemented. If you need any other algorithms, you'll need to enable
them in the crypto API. You should also enable accelerated
implementations of any needed algorithms when available.

If unsure, say Y.

config INET_ESP
tristate "IP: ESP transformation"
select XFRM_ESP
---help---
Support for IPsec ESP.
Support for IPsec ESP (Encapsulating Security Payload).

ESP can be used with various encryption and authentication algorithms.
Besides enabling ESP support itself, this option enables the generic
implementations of the algorithms that RFC 8221 lists as MUST be
implemented. If you need any other algorithms, you'll need to enable
them in the crypto API. You should also enable accelerated
implementations of any needed algorithms when available.

If unsure, say Y.

Expand Down
18 changes: 16 additions & 2 deletions net/ipv6/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,29 @@ config INET6_AH
tristate "IPv6: AH transformation"
select XFRM_AH
---help---
Support for IPsec AH.
Support for IPsec AH (Authentication Header).

AH can be used with various authentication algorithms. Besides
enabling AH support itself, this option enables the generic
implementations of the algorithms that RFC 8221 lists as MUST be
implemented. If you need any other algorithms, you'll need to enable
them in the crypto API. You should also enable accelerated
implementations of any needed algorithms when available.

If unsure, say Y.

config INET6_ESP
tristate "IPv6: ESP transformation"
select XFRM_ESP
---help---
Support for IPsec ESP.
Support for IPsec ESP (Encapsulating Security Payload).

ESP can be used with various encryption and authentication algorithms.
Besides enabling ESP support itself, this option enables the generic
implementations of the algorithms that RFC 8221 lists as MUST be
implemented. If you need any other algorithms, you'll need to enable
them in the crypto API. You should also enable accelerated
implementations of any needed algorithms when available.

If unsure, say Y.

Expand Down
15 changes: 9 additions & 6 deletions net/xfrm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,29 @@ config XFRM_STATISTICS

If unsure, say N.

# This option selects XFRM_ALGO along with the AH authentication algorithms that
# RFC 8221 lists as MUST be implemented.
config XFRM_AH
tristate
select XFRM_ALGO
select CRYPTO
select CRYPTO_HMAC
select CRYPTO_MD5
select CRYPTO_SHA1
select CRYPTO_SHA256

# This option selects XFRM_ALGO along with the ESP encryption and authentication
# algorithms that RFC 8221 lists as MUST be implemented.
config XFRM_ESP
tristate
select XFRM_ALGO
select CRYPTO
select CRYPTO_AES
select CRYPTO_AUTHENC
select CRYPTO_HMAC
select CRYPTO_MD5
select CRYPTO_CBC
select CRYPTO_SHA1
select CRYPTO_DES
select CRYPTO_ECHAINIV
select CRYPTO_GCM
select CRYPTO_HMAC
select CRYPTO_SEQIV
select CRYPTO_SHA256

config XFRM_IPCOMP
tristate
Expand Down

0 comments on commit be01369

Please sign in to comment.