ClearFoundation Tracker - ClearOS
View Issue Details
0022161ClearOSapp-certificate-manager - Certificate Managerpublic2018-11-01 09:182020-05-04 05:29
NickH 
 
normaltweakalways
closedfixed 
7.5.0 
7.6.0 Updates7.6.0 
0022161: When importing, the filter for allowable Names is incorrect
When you import a certificate, you have to give it a name but the restrictions on the allowable names has been incorrectly implemented. The filter in line 747 of /usr/clearos/apps/certificate_manager/libraries/External_Certificates.php is currently:

return strlen($name) > 3 && preg_match("%^[a-zA-Z0-9\\-_]+(\\.[a-zA-Z0-9\\-_])*$%", $name);

This will allow "test", "test.1", "test.1.2.3" but not "test.123". If you have a period in the name you must have only one character after it before having another period. It looks like the test string is incorrect and needs a "+" after the last "]" to read:

return strlen($name) > 3 && preg_match("%^[a-zA-Z0-9\\-_]+(\\.[a-zA-Z0-9\\-_]+)*$%", $name);

Then it will insist on at least one character after the period, but allow as many as you want. This will allow you to input an FQDN as a name but will not allow a name ending in a period.
No tags attached.
Issue History
2018-11-01 09:18NickHNew Issue
2018-11-02 08:21user2Statusnew => confirmed
2018-11-02 08:21user2Product Version7.5.0 Updates => 7.5.0
2018-11-02 08:21user2Target Version => 7.6.0 Updates
2018-11-09 09:51user2Note Added: 0008571
2018-11-09 09:51user2Statusconfirmed => resolved
2018-11-09 09:51user2Fixed in Version => 7.6.0
2018-11-09 09:51user2Resolutionopen => fixed
2018-11-09 09:51user2Assigned To => user2
2020-05-04 05:29NickHNote Added: 0014291
2020-05-04 05:29NickHStatusresolved => closed
2020-05-04 05:29NickHAssigned Touser2 =>

Notes
(0008571)
user2   
2018-11-09 09:51   
More restrictions were lifted: alphanumeric, dash, underscore and periods are fine:

preg_match("/^[a-zA-Z0-9\-_\.]+$/", $name)
(0014291)
NickH   
2020-05-04 05:29   
Migrated to https://gitlab.com/clearos/clearfoundation/app-certificate-manager/-/issues/35 [^]