Skip to content

Commit

Permalink
ipsec: add brainpool ec groups
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Aug 2, 2018
1 parent 50a49ee commit 062a016
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 65 deletions.
9 changes: 9 additions & 0 deletions src/etc/inc/plugins.inc.d/ipsec.inc
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,15 @@ function ipsec_convert_to_modp($index)
case '24':
$convertion = "modp2048s256";
break;
case '28':
$convertion = "ecp256bp";
break;
case '29':
$convertion = "ecp384bp";
break;
case '30':
$convertion = "ecp512bp";
break;
}

return $convertion;
Expand Down
36 changes: 20 additions & 16 deletions src/www/vpn_ipsec.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,25 +186,29 @@ function ipsec_idinfo_to_text(& $idinfo) {
$service_hook = 'ipsec';

include("head.inc");

$dhgroups = array(
0 => gettext('off'),
1 => '1 (768 bits)',
2 => '2 (1024 bits)',
5 => '5 (1536 bits)',
14 => '14 (2048 bits)',
15 => '15 (3072 bits)',
16 => '16 (4096 bits)',
17 => '17 (6144 bits)',
18 => '18 (8192 bits)',
19 => '19 (256 bit elliptic curve)',
20 => '20 (384 bit elliptic curve)',
21 => '21 (521 bit elliptic curve)',
22 => '22 (1024(sub 160) bits)',
23 => '23 (2048(sub 224) bits)',
24 => '24 (2048(sub 256) bits)'
0 => gettext('off'),
1 => '1 (768 bits)',
2 => '2 (1024 bits)',
5 => '5 (1536 bits)',
14 => '14 (2048 bits)',
15 => '15 (3072 bits)',
16 => '16 (4096 bits)',
17 => '17 (6144 bits)',
18 => '18 (8192 bits)',
19 => '19 (NIST EC 256 bits)',
20 => '20 (NIST EC 384 bits)',
21 => '21 (NIST EC 521 bits)',
22 => '22 (1024(sub 160) bits)',
23 => '23 (2048(sub 224) bits)',
24 => '24 (2048(sub 256) bits)',
28 => '28 (Brainpool EC 256 bits)',
29 => '29 (Brainpool EC 384 bits)',
30 => '30 (Brainpool EC 512 bits)',
);
?>

?>
<body>
<script>
$( document ).ready(function() {
Expand Down
35 changes: 19 additions & 16 deletions src/www/vpn_ipsec_mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,23 +506,26 @@ function print_legacy_box($msg, $name, $value)
<select name="pfs_group" class="selectpicker" id="pfs_group">
<?php
$p2_dhgroups = array(
0 => gettext('off'),
1 => '1 (768 bit)',
2 => '2 (1024 bit)',
5 => '5 (1536 bit)',
14 => '14 (2048 bit)',
15 => '15 (3072 bit)',
16 => '16 (4096 bit)',
17 => '17 (6144 bit)',
18 => '18 (8192 bit)',
19 => '19 (256 bit elliptic curve)',
20 => '20 (384 bit elliptic curve)',
21 => '21 (521 bit elliptic curve)',
22 => '22 (1024(sub 160) bit)',
23 => '23 (2048(sub 224) bit)',
24 => '24 (2048(sub 256) bit)'
0 => gettext('off'),
1 => '1 (768 bits)',
2 => '2 (1024 bits)',
5 => '5 (1536 bits)',
14 => '14 (2048 bits)',
15 => '15 (3072 bits)',
16 => '16 (4096 bits)',
17 => '17 (6144 bits)',
18 => '18 (8192 bits)',
19 => '19 (NIST EC 256 bits)',
20 => '20 (NIST EC 384 bits)',
21 => '21 (NIST EC 521 bits)',
22 => '22 (1024(sub 160) bits)',
23 => '23 (2048(sub 224) bits)',
24 => '24 (2048(sub 256) bits)',
28 => '28 (Brainpool EC 256 bits)',
29 => '29 (Brainpool EC 384 bits)',
30 => '30 (Brainpool EC 512 bits)',
);
foreach ($p2_dhgroups as $keygroup => $keygroupname) :?>
foreach ($p2_dhgroups as $keygroup => $keygroupname): ?>
<option value="<?=$keygroup;
?>" <?= $pconfig['pfs_group'] == $keygroup ? "selected=\"selected\"" : "" ; ?>>
<?=$keygroupname;?>
Expand Down
35 changes: 19 additions & 16 deletions src/www/vpn_ipsec_phase1.php
Original file line number Diff line number Diff line change
Expand Up @@ -932,23 +932,26 @@ function ipsec_ikeid_next() {
<select name="dhgroup">
<?php
$p1_dhgroups = array(
0 => gettext('off'),
1 => '1 (768 bit)',
2 => '2 (1024 bit)',
5 => '5 (1536 bit)',
14 => '14 (2048 bit)',
15 => '15 (3072 bit)',
16 => '16 (4096 bit)',
17 => '17 (6144 bit)',
18 => '18 (8192 bit)',
19 => '19 (256 bit elliptic curve)',
20 => '20 (384 bit elliptic curve)',
21 => '21 (521 bit elliptic curve)',
22 => '22 (1024(sub 160) bit)',
23 => '23 (2048(sub 224) bit)',
24 => '24 (2048(sub 256) bit)'
0 => gettext('off'),
1 => '1 (768 bits)',
2 => '2 (1024 bits)',
5 => '5 (1536 bits)',
14 => '14 (2048 bits)',
15 => '15 (3072 bits)',
16 => '16 (4096 bits)',
17 => '17 (6144 bits)',
18 => '18 (8192 bits)',
19 => '19 (NIST EC 256 bits)',
20 => '20 (NIST EC 384 bits)',
21 => '21 (NIST EC 521 bits)',
22 => '22 (1024(sub 160) bits)',
23 => '23 (2048(sub 224) bits)',
24 => '24 (2048(sub 256) bits)',
28 => '28 (Brainpool EC 256 bits)',
29 => '29 (Brainpool EC 384 bits)',
30 => '30 (Brainpool EC 512 bits)',
);
foreach ($p1_dhgroups as $keygroup => $keygroupname) :
foreach ($p1_dhgroups as $keygroup => $keygroupname):
?>
<option value="<?=$keygroup;?>" <?= $keygroup == $pconfig['dhgroup'] ? "selected=\"selected\"" : "";?>>
<?=$keygroupname;?>
Expand Down
36 changes: 19 additions & 17 deletions src/www/vpn_ipsec_phase2.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,24 +674,26 @@ function getIndexByUniqueId($uniqid)
<select name="pfsgroup">
<?php
$p2_dhgroups = array(
0 => gettext('off'),
1 => '1 (768 bit)',
2 => '2 (1024 bit)',
5 => '5 (1536 bit)',
14 => '14 (2048 bit)',
15 => '15 (3072 bit)',
16 => '16 (4096 bit)',
17 => '17 (6144 bit)',
18 => '18 (8192 bit)',
19 => '19 (256 bit elliptic curve)',
20 => '20 (384 bit elliptic curve)',
21 => '21 (521 bit elliptic curve)',
22 => '22 (1024(sub 160) bit)',
23 => '23 (2048(sub 224) bit)',
24 => '24 (2048(sub 256) bit)'
0 => gettext('off'),
1 => '1 (768 bits)',
2 => '2 (1024 bits)',
5 => '5 (1536 bits)',
14 => '14 (2048 bits)',
15 => '15 (3072 bits)',
16 => '16 (4096 bits)',
17 => '17 (6144 bits)',
18 => '18 (8192 bits)',
19 => '19 (NIST EC 256 bits)',
20 => '20 (NIST EC 384 bits)',
21 => '21 (NIST EC 521 bits)',
22 => '22 (1024(sub 160) bits)',
23 => '23 (2048(sub 224) bits)',
24 => '24 (2048(sub 256) bits)',
28 => '28 (Brainpool EC 256 bits)',
29 => '29 (Brainpool EC 384 bits)',
30 => '30 (Brainpool EC 512 bits)',
);

foreach ($p2_dhgroups as $keygroup => $keygroupname) :?>
foreach ($p2_dhgroups as $keygroup => $keygroupname): ?>
<option value="<?=$keygroup;?>" <?= $keygroup == $pconfig['pfsgroup'] ? "selected=\"selected\"" : "";?>>
<?=$keygroupname;?>
</option>
Expand Down

0 comments on commit 062a016

Please sign in to comment.