diff options
author | Renato Botelho <renato@netgate.com> | 2019-02-07 13:34:12 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2019-02-07 13:37:38 -0200 |
commit | a56762ba305f5eb2a44b7538ef139d2e1bbd54ff (patch) | |
tree | ddeced7ab6c7f345bd91bd4ecc8c658d4e4db2a4 | |
parent | 988640d3632d620903f89aaa87d865df8c736a10 (diff) | |
download | pfsense-a56762ba305f5eb2a44b7538ef139d2e1bbd54ff.zip pfsense-a56762ba305f5eb2a44b7538ef139d2e1bbd54ff.tar.gz |
Ticket #9308: Implement get_cert_country_codes() to get the list of country codes to be used by CAs and Certs
-rw-r--r-- | src/etc/inc/pfsense-utils.inc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index e11ccd1..f7470b4 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -2790,6 +2790,25 @@ function get_country_name($country_code = "ALL") { return ""; } +/* Return the list of country codes to be used on CAs and certs */ +function get_cert_country_codes() { + $countries = get_country_name(); + + $country_codes = array(); + foreach ($countries as $country) { + $country_codes[$country['code']] = $country['code']; + } + + /* Preserve historical order: None, US, CA, other countries */ + $first_items[''] = gettext("None"); + $first_items['US'] = $country_codes['US']; + $first_items['CA'] = $country_codes['CA']; + unset($country_codes['US']); + unset($country_codes['CA']); + + return array_merge($first_items, $country_codes); +} + /* sort by interface only, retain the original order of rules that apply to the same interface */ function filter_rules_sort() { |