Libreswan truncates long XAUTH passwords entered at prompt and fails to authenticate
Issue
When using libreswan to establish an IPsec tunnel using IKEv1 authenticated by XAUTH password that is not stored in the ipsec.secrets file, libreswan will prompt for the password using whack. If this password is very long (>63 characters), the password is truncated to 63 bytes and the authentication fails with a similar log message:
Oct 4 08:10:00 hostname pluto[12345]: "conn1" #1: XAUTH Message: Authentication failed
The password was verified to be correct and earlier versions of libreswan than libreswan 3.20-3.el7 authenticated the tunnel without issues.
Environment
- Red Hat Enterprise Linux 7.4
libreswan 3.20-3.el7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.