Skip to content

Commit

Permalink
Merge pull request #450 from jaredhendrickson13/next_patch
Browse files Browse the repository at this point in the history
v1.7.2
  • Loading branch information
jaredhendrickson13 authored Apr 8, 2024
2 parents a550cf2 + 04efa3b commit f3eda7c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
13 changes: 13 additions & 0 deletions pfSense-pkg-API/files/etc/inc/api/framework/APITools.inc
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,19 @@ function sort_nat_rules($top=false, $data=null, $field=null) {
$sort_arr[] = $fre;
}
}


switch($field) {
case "onetoone":
config_set_path("nat/onetoone", $sort_arr);
break;
case "outbound":
config_set_path("nat/outbound/rule", $sort_arr);
break;
default:
config_set_path("nat/rule", $sort_arr);
}

if (!empty($sort_arr)) {
$acl = $sort_arr;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ class APIServicesIPsecPhase2Create extends APIModel {
$this->errors[] = APIResponse\get(2252);
}
}
else {
elseif ($this->__is_hash_algo_required()) {
$this->errors[] = APIResponse\get(2251);
}
}
Expand Down Expand Up @@ -577,4 +577,14 @@ class APIServicesIPsecPhase2Create extends APIModel {
$this->validated_data["keepalive"] = "disabled";
}
}

private function __is_hash_algo_required() {
foreach ($this->validated_data["encryption-algorithm-option"] as $enc_conf) {
if ($enc_conf["name"] === "aes") {
return true;
}
}

return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ class APIServicesIPsecPhase2Update extends APIModel {
$this->errors[] = APIResponse\get(2252);
}
}
else {
elseif($this->__is_hash_algo_required()) {
$this->errors[] = APIResponse\get(2251);
}
}
Expand Down Expand Up @@ -597,4 +597,14 @@ class APIServicesIPsecPhase2Update extends APIModel {
$this->validated_data["keepalive"] = "disabled";
}
}

private function __is_hash_algo_required() {
foreach ($this->validated_data["encryption-algorithm-option"] as $enc_conf) {
if ($enc_conf["name"] === "aes") {
return true;
}
}

return false;
}
}

0 comments on commit f3eda7c

Please sign in to comment.