The iPhone OS has a strange set of VPN features.  Using L2TP over IPsec 
it only supports main mode with pre-shared keys (no certificates). 
Since L2TP provides the per-user authentication we want to use a single 
pre-shared key for all VPN users, but this is hard to do with 
ipsec-tools since racoon only supports pskey lookup by address when 
identity protection is used and we do not know the address of the client 
in advance.  The attached patch adds a wildcard match to the psk.txt 
reading code, specifying an id of * will match any client.

(John Keith Hohm <john@hohm.net>)

Index: pkg-ipsec-tools/src/racoon/localconf.c
===================================================================
--- pkg-ipsec-tools.orig/src/racoon/localconf.c	2014-04-25 23:35:22.635728960 -0700
+++ pkg-ipsec-tools/src/racoon/localconf.c	2014-04-25 23:36:02.787928062 -0700
@@ -207,7 +207,8 @@
 		if (*p == '\0')
 			continue;	/* no 2nd parameter */
 		p--;
-		if (strncmp(buf, str, len) == 0 && buf[len] == '\0') {
+		if (strncmp(buf, "*", 2) == 0 ||
+		(strncmp(buf, str, len) == 0 && buf[len] == '\0')) {
 			p++;
 			keylen = 0;
 			for (q = p; *q != '\0' && *q != '\n'; q++)
