Lines 60-65
uclparse_chap(struct auth_group *auth_group, const ucl_object_t *obj)
Link Here
|
60 |
const struct auth *ca; |
60 |
const struct auth *ca; |
61 |
const ucl_object_t *user, *secret; |
61 |
const ucl_object_t *user, *secret; |
62 |
|
62 |
|
|
|
63 |
assert(auth_group != NULL); |
63 |
user = ucl_object_find_key(obj, "user"); |
64 |
user = ucl_object_find_key(obj, "user"); |
64 |
if (!user || user->type != UCL_STRING) { |
65 |
if (!user || user->type != UCL_STRING) { |
65 |
log_warnx("chap section in auth-group \"%s\" is missing " |
66 |
log_warnx("chap section in auth-group \"%s\" is missing " |
Lines 90-95
uclparse_chap_mutual(struct auth_group *auth_group, const ucl_object_t *obj)
Link Here
|
90 |
const ucl_object_t *user, *secret, *mutual_user; |
91 |
const ucl_object_t *user, *secret, *mutual_user; |
91 |
const ucl_object_t *mutual_secret; |
92 |
const ucl_object_t *mutual_secret; |
92 |
|
93 |
|
|
|
94 |
assert(auth_group != NULL); |
93 |
user = ucl_object_find_key(obj, "user"); |
95 |
user = ucl_object_find_key(obj, "user"); |
94 |
if (!user || user->type != UCL_STRING) { |
96 |
if (!user || user->type != UCL_STRING) { |
95 |
log_warnx("chap-mutual section in auth-group \"%s\" is missing " |
97 |
log_warnx("chap-mutual section in auth-group \"%s\" is missing " |
Lines 714-719
uclparse_target(const char *name, const ucl_object_t *top)
Link Here
|
714 |
} |
716 |
} |
715 |
|
717 |
|
716 |
if (!strcmp(key, "auth-group")) { |
718 |
if (!strcmp(key, "auth-group")) { |
|
|
719 |
const char *ag; |
720 |
|
717 |
if (target->t_auth_group != NULL) { |
721 |
if (target->t_auth_group != NULL) { |
718 |
if (target->t_auth_group->ag_name != NULL) |
722 |
if (target->t_auth_group->ag_name != NULL) |
719 |
log_warnx("auth-group for target \"%s\" " |
723 |
log_warnx("auth-group for target \"%s\" " |
Lines 725-732
uclparse_target(const char *name, const ucl_object_t *top)
Link Here
|
725 |
"target \"%s\"", target->t_name); |
729 |
"target \"%s\"", target->t_name); |
726 |
return (1); |
730 |
return (1); |
727 |
} |
731 |
} |
728 |
target->t_auth_group = auth_group_find(conf, |
732 |
ag = ucl_object_tostring(obj); |
729 |
ucl_object_tostring(obj)); |
733 |
if (!ag) { |
|
|
734 |
log_warnx("auth-group must be a string"); |
735 |
return (1); |
736 |
} |
737 |
target->t_auth_group = auth_group_find(conf, ag); |
730 |
if (target->t_auth_group == NULL) { |
738 |
if (target->t_auth_group == NULL) { |
731 |
log_warnx("unknown auth-group \"%s\" for target " |
739 |
log_warnx("unknown auth-group \"%s\" for target " |
732 |
"\"%s\"", ucl_object_tostring(obj), |
740 |
"\"%s\"", ucl_object_tostring(obj), |
Lines 759-764
uclparse_target(const char *name, const ucl_object_t *top)
Link Here
|
759 |
} |
767 |
} |
760 |
|
768 |
|
761 |
if (!strcmp(key, "chap")) { |
769 |
if (!strcmp(key, "chap")) { |
|
|
770 |
if (target->t_auth_group != NULL) { |
771 |
if (target->t_auth_group->ag_name != NULL) { |
772 |
log_warnx("cannot use both auth-group " |
773 |
"and chap for target \"%s\"", |
774 |
target->t_name); |
775 |
return (1); |
776 |
} |
777 |
} else { |
778 |
target->t_auth_group = auth_group_new(conf, NULL); |
779 |
if (target->t_auth_group == NULL) { |
780 |
return (1); |
781 |
} |
782 |
target->t_auth_group->ag_target = target; |
783 |
} |
762 |
if (uclparse_chap(target->t_auth_group, obj) != 0) |
784 |
if (uclparse_chap(target->t_auth_group, obj) != 0) |
763 |
return (1); |
785 |
return (1); |
764 |
} |
786 |
} |
765 |
- |
|
|