I would also like to suggest to replace that `1024` in the code with a define, it makes it easier to change if proves to be a small number.
Then the functions exported to the config should be also prefixed with `sec_` or `secf_` (e.g., secf_check_ua(...)) -- in the past few years, the functions exported by modules to config use a common prefix to be suggestive where they belong to.