Lines Matching refs:policy
60 #define POLICY_CONF_FILE "/etc/security/policy.conf"
111 static void free_crypt_policy(struct crypt_policy_s *policy);
116 const struct crypt_policy_s *policy);
207 * Other wise check the policy in policy.conf to ensure that it is
220 struct crypt_policy_s *policy = NULL;
232 policy = getcryptpolicy();
233 if (policy == NULL) {
239 if (!alg_valid(algname, policy)) {
241 algname = strdup(policy->cp_default);
260 free_crypt_policy(policy);
367 * getcryptpolicy - read /etc/security/policy.conf into a crypt_policy_s
374 struct crypt_policy_s *policy;
380 policy = malloc(sizeof (struct crypt_policy_s));
381 if (policy == NULL) {
384 policy->cp_default = NULL;
385 policy->cp_allow = NULL;
386 policy->cp_deny = NULL;
392 if (policy->cp_default != NULL) {
395 policy->cp_default = getval(line);
400 if (policy->cp_deny != NULL) {
402 } else if (policy->cp_allow != NULL) {
406 policy->cp_allow = getval(line);
411 if (policy->cp_allow != NULL) {
413 } else if (policy->cp_deny != NULL) {
417 policy->cp_deny = getval(line);
423 if (policy->cp_default == NULL) {
424 policy->cp_default = strdup(CRYPT_UNIX);
425 if (policy->cp_default == NULL)
426 free_crypt_policy(policy);
429 return (policy);
434 * alg_valid - is this algorithm valid given the policy ?
437 alg_valid(const char *algname, const struct crypt_policy_s *policy)
444 if ((algname == NULL) || (policy == NULL)) {
448 if (strcmp(algname, policy->cp_default) == 0) {
452 if (policy->cp_deny != NULL) {
453 list = policy->cp_deny;
455 } else if (policy->cp_allow != NULL) {
456 list = policy->cp_allow;
482 * as per the policy.
707 free_crypt_policy(struct crypt_policy_s *policy)
709 if (policy == NULL)
712 if (policy->cp_default != NULL) {
713 bzero(policy->cp_default, strlen(policy->cp_default));
714 free(policy->cp_default);
715 policy->cp_default = NULL;
718 if (policy->cp_allow != NULL) {
719 bzero(policy->cp_allow, strlen(policy->cp_allow));
720 free(policy->cp_allow);
721 policy->cp_allow = NULL;
724 if (policy->cp_deny != NULL) {
725 bzero(policy->cp_deny, strlen(policy->cp_deny));
726 free(policy->cp_deny);
727 policy->cp_deny = NULL;
730 free(policy);