[packages_10.03.2] ipsec-tools: merge r28102, r28911, r28960
[10.03/packages.git] / net / ipsec-tools / patches / 001-ipsec-tools-def-psk.patch
1 diff -brau ipsec-tools-0.7.3.o/src/racoon/oakley.c ipsec-tools-0.7.3/src/racoon/oakley.c
2 --- a/src/racoon/oakley.c       2009-08-13 11:18:45.000000000 +0200
3 +++ b/src/racoon/oakley.c       2011-06-06 09:36:11.000000000 +0200
4 @@ -2498,8 +2498,21 @@
5                                 plog(LLV_ERROR, LOCATION, iph1->remote,
6                                         "couldn't find the pskey for %s.\n",
7                                         saddrwop2str(iph1->remote));
8 +                       }
9 +               }
10 +               if (iph1->authstr == NULL) {
11 +                       /*
12 +                        * If we could not locate a psk above try and locate
13 +                        * the default psk, ie, "*".
14 +                        */
15 +                       iph1->authstr = privsep_getpsk("*", 1);
16 +                       if (iph1->authstr == NULL) {
17 +                               plog(LLV_ERROR, LOCATION, iph1->remote,
18 +                                       "couldn't find the the default pskey either.\n");
19                                 goto end;
20                         }
21 +                       plog(LLV_NOTIFY, LOCATION, iph1->remote,
22 +                                       "Using default PSK.\n");
23                 }
24                 plog(LLV_DEBUG, LOCATION, NULL, "the psk found.\n");
25                 /* should be secret PSK */