~ubuntu-branches/ubuntu/hardy/openswan/hardy-updates

« back to all changes in this revision

Viewing changes to contrib/cisco/pcf2os.pl

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayrhofer
  • Date: 2005-01-27 16:10:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050127161011-idgybmyz3vwhpfiq
Tags: 2.3.0-2
Urgency HIGH due to security issue and problems with build-deps in sarge.
* Fix the security issue. Please see
  http://www.idefense.com/application/poi/display?id=190&
      type=vulnerabilities&flashstatus=false
  for more details. Thanks to Martin Schulze for informing me about
  this issue.
  Closes: #292458: Openswan XAUTH/PAM Buffer Overflow Vulnerability
* Added a Build-Dependency to lynx.
  Closes: #291143: openswan: FTBFS: Missing build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
#
 
3
# (C) 2004 Ken Bantoft <ken@xelerance.com>
 
4
#
 
5
# This script converts most Cisco VPN client .pcf files to Openswan's
 
6
# ipsec.conf and ipsec.secrets format
 
7
#
 
8
 
 
9
die "Usage: ./pcf2os.pl cisco-config.pcf\n\n"  if ! $ARGV[0];
 
10
 
 
11
open(PCF,$ARGV[0]);
 
12
while(<PCF>) {
 
13
        chop;
 
14
# print "[$_]";
 
15
        if (m/^description/i) {
 
16
        s/.*=//;
 
17
        s/\ /\_/g;
 
18
        $desc=$_;
 
19
}
 
20
if  (m/^host/i) {
 
21
        s/.*=//;
 
22
        $right=$_;
 
23
}
 
24
 
 
25
if (m/^groupname/i) {
 
26
        s/.*=//;
 
27
        $groupname=$_;
 
28
}       
 
29
 
 
30
if (m/^grouppwd/i) {
 
31
        s/.*=//;
 
32
        $grouppassword=$_;
 
33
}       
 
34
 
 
35
 
 
36
 
 
37
}
 
38
close(PCF);
 
39
 
 
40
print "ipsec.conf\n\n";
 
41
print "conn $desc\n";
 
42
print "     ike=3des-md5-modp1024\n";
 
43
print "     aggrmode=yes\n";
 
44
print "     authby=secret\n";
 
45
print "     left=%defaultroute\n";
 
46
print "     leftid=\@$groupname\n";
 
47
print "     leftxauthclient=yes\n";
 
48
print "     leftmodecfgclient=yes\n";
 
49
print "     right=$right\n";
 
50
print "     rightxauthserver=yes\n";
 
51
print "     rightmodecfgserver=yes\n";
 
52
print "     pfs=no\n";
 
53
print "     auto=add\n";
 
54
 
 
55
print "\n\n";
 
56
print "ipsec.secrets:\n\n";
 
57
print "\@$groupname $right : PSK \"$grouppassword\"\n";
 
58