|
Lines 135-140
int mm_answer_sign(int, Buffer *);
Link Here
|
| 135 |
int mm_answer_pwnamallow(int, Buffer *); |
135 |
int mm_answer_pwnamallow(int, Buffer *); |
| 136 |
int mm_answer_auth2_read_banner(int, Buffer *); |
136 |
int mm_answer_auth2_read_banner(int, Buffer *); |
| 137 |
int mm_answer_authserv(int, Buffer *); |
137 |
int mm_answer_authserv(int, Buffer *); |
|
|
138 |
#ifdef WITH_SELINUX |
| 139 |
int mm_answer_authrole(int, Buffer *); |
| 140 |
#endif |
| 138 |
int mm_answer_authpassword(int, Buffer *); |
141 |
int mm_answer_authpassword(int, Buffer *); |
| 139 |
int mm_answer_bsdauthquery(int, Buffer *); |
142 |
int mm_answer_bsdauthquery(int, Buffer *); |
| 140 |
int mm_answer_bsdauthrespond(int, Buffer *); |
143 |
int mm_answer_bsdauthrespond(int, Buffer *); |
|
Lines 211-216
struct mon_table mon_dispatch_proto20[]
Link Here
|
| 211 |
{MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, |
214 |
{MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, |
| 212 |
{MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, |
215 |
{MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, |
| 213 |
{MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, |
216 |
{MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, |
|
|
217 |
#ifdef WITH_SELINUX |
| 218 |
{MONITOR_REQ_AUTHROLE, MON_ONCE, mm_answer_authrole}, |
| 219 |
#endif |
| 214 |
{MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, |
220 |
{MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, |
| 215 |
{MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, |
221 |
{MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, |
| 216 |
#ifdef USE_PAM |
222 |
#ifdef USE_PAM |
|
Lines 680-685
mm_answer_pwnamallow(int sock, Buffer *m
Link Here
|
| 680 |
else { |
686 |
else { |
| 681 |
/* Allow service/style information on the auth context */ |
687 |
/* Allow service/style information on the auth context */ |
| 682 |
monitor_permit(mon_dispatch, MONITOR_REQ_AUTHSERV, 1); |
688 |
monitor_permit(mon_dispatch, MONITOR_REQ_AUTHSERV, 1); |
|
|
689 |
#ifdef WITH_SELINUX |
| 690 |
monitor_permit(mon_dispatch, MONITOR_REQ_AUTHROLE, 1); |
| 691 |
#endif |
| 683 |
monitor_permit(mon_dispatch, MONITOR_REQ_AUTH2_READ_BANNER, 1); |
692 |
monitor_permit(mon_dispatch, MONITOR_REQ_AUTH2_READ_BANNER, 1); |
| 684 |
} |
693 |
} |
| 685 |
|
694 |
|
|
Lines 724-729
mm_answer_authserv(int sock, Buffer *m)
Link Here
|
| 724 |
return (0); |
733 |
return (0); |
| 725 |
} |
734 |
} |
| 726 |
|
735 |
|
|
|
736 |
#ifdef WITH_SELINUX |
| 737 |
int |
| 738 |
mm_answer_authrole(int sock, Buffer *m) |
| 739 |
{ |
| 740 |
monitor_permit_authentications(1); |
| 741 |
|
| 742 |
authctxt->role = buffer_get_string(m, NULL); |
| 743 |
debug3("%s: role=%s", |
| 744 |
__func__, authctxt->role); |
| 745 |
|
| 746 |
if (strlen(authctxt->role) == 0) { |
| 747 |
xfree(authctxt->role); |
| 748 |
authctxt->role = NULL; |
| 749 |
} |
| 750 |
|
| 751 |
return (0); |
| 752 |
} |
| 753 |
#endif |
| 754 |
|
| 727 |
int |
755 |
int |
| 728 |
mm_answer_authpassword(int sock, Buffer *m) |
756 |
mm_answer_authpassword(int sock, Buffer *m) |
| 729 |
{ |
757 |
{ |
|
Lines 1102-1108
static int
Link Here
|
| 1102 |
monitor_valid_userblob(u_char *data, u_int datalen) |
1130 |
monitor_valid_userblob(u_char *data, u_int datalen) |
| 1103 |
{ |
1131 |
{ |
| 1104 |
Buffer b; |
1132 |
Buffer b; |
| 1105 |
char *p; |
1133 |
char *p, *r; |
| 1106 |
u_int len; |
1134 |
u_int len; |
| 1107 |
int fail = 0; |
1135 |
int fail = 0; |
| 1108 |
|
1136 |
|
|
Lines 1128-1133
monitor_valid_userblob(u_char *data, u_i
Link Here
|
| 1128 |
if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) |
1156 |
if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) |
| 1129 |
fail++; |
1157 |
fail++; |
| 1130 |
p = buffer_get_string(&b, NULL); |
1158 |
p = buffer_get_string(&b, NULL); |
|
|
1159 |
if ((r = strchr(p, '/')) != NULL) |
| 1160 |
*r = '\0'; |
| 1131 |
if (strcmp(authctxt->user, p) != 0) { |
1161 |
if (strcmp(authctxt->user, p) != 0) { |
| 1132 |
logit("wrong user name passed to monitor: expected %s != %.100s", |
1162 |
logit("wrong user name passed to monitor: expected %s != %.100s", |
| 1133 |
authctxt->user, p); |
1163 |
authctxt->user, p); |
|
Lines 1159-1165
monitor_valid_hostbasedblob(u_char *data
Link Here
|
| 1159 |
char *chost) |
1189 |
char *chost) |
| 1160 |
{ |
1190 |
{ |
| 1161 |
Buffer b; |
1191 |
Buffer b; |
| 1162 |
char *p; |
1192 |
char *p, *r; |
| 1163 |
u_int len; |
1193 |
u_int len; |
| 1164 |
int fail = 0; |
1194 |
int fail = 0; |
| 1165 |
|
1195 |
|
|
Lines 1176-1181
monitor_valid_hostbasedblob(u_char *data
Link Here
|
| 1176 |
if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) |
1206 |
if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST) |
| 1177 |
fail++; |
1207 |
fail++; |
| 1178 |
p = buffer_get_string(&b, NULL); |
1208 |
p = buffer_get_string(&b, NULL); |
|
|
1209 |
if ((r = strchr(p, '/')) != NULL) |
| 1210 |
*r = '\0'; |
| 1179 |
if (strcmp(authctxt->user, p) != 0) { |
1211 |
if (strcmp(authctxt->user, p) != 0) { |
| 1180 |
logit("wrong user name passed to monitor: expected %s != %.100s", |
1212 |
logit("wrong user name passed to monitor: expected %s != %.100s", |
| 1181 |
authctxt->user, p); |
1213 |
authctxt->user, p); |