[Swan] Support for SHA 256-512

Tuomo Soini tis at foobar.fi
Wed Jun 3 11:56:02 UTC 2020


On Wed, 3 Jun 2020 16:07:16 +0530
Shweta Kalyani <shwetakalyani at gmail.com> wrote:

> Hello,
> 
> I wanted to check if SHA 256 and 512 is supported for IKEv1 and IKEv2
> for esp tunnels.
> Following is my conf in which phase 1 passes(ike_sa=1) but fails in
> phase 2. I have enabled USE_SHA2=true when building libreswan.
> Would appreciate your response on this.
> 
> Thanks,
> Shweta
> 
> ipsec.conf:
> # cat /etc/config/ipsec.conf
> version 2
> config setup
> protostack = netkey
> klipsdebug = none
> plutodebug = none
> uniqueids = yes
> hidetos = no
> 
> conn Tunnel37_1
> ikev2 = no
> type = tunnel
> left = 10.10.50.67
> right = 10.10.50.37
> leftnexthop = 10.10.50.1
> leftsubnet = 192.168.2.0/24
> rightsubnet = 192.168.6.0/24
> auto = start
> keyexchange = ike
> authby = secret
> keyingtries = 0
> esp = 3DES-SHA2_256
> pfs = yes
> rekey = yes
> leftid = 10.10.50.67
> rightid = 10.10.50.37
> ike = 3DES-SHA2_256-MODP1024
> ikelifetime = 28800s
> keylife = 86400s
> rekeymargin = 10m
> rekeyfuzz = 20%

You have perfect forward secrecy enabled (pfs=yes), I'd try with pfs=no

I must say your crypto settings are totally insecure. You should not
use 3des and especially you should not use modp1024 (diffie-hellman
group 2). All IKEv1 implementations I know of can do diffie-hellman
group 5 (modp1536) which is way more secure. We don't even support
modp1024 any more on current release.

aes128-sha2_256;modp1536 would be a lot more secure combination and
similar settings for IPsec SA (which they called phase2).

-- 
Tuomo Soini <tis at foobar.fi>
Foobar Linux services
+358 40 5240030
Foobar Oy <https://foobar.fi/>


More information about the Swan mailing list