Lines Matching +full:2 +full:- +full:way
1 /*-
10 * 2. Redistributions in binary form must reproduce the above copyright
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
70 #include "misc-proto.h"
71 #include "auth-proto.h"
73 #define typemask(x) ((x) > 0 ? 1 << ((x)-1) : 0)
184 findauthenticator(int type, int way) in findauthenticator() argument
188 while (ap->type && (ap->type != type || ap->way != way)) in findauthenticator()
190 return(ap->type ? ap : 0); in findauthenticator()
204 while (ap->type) { in auth_init()
205 if (!ap->init || (*ap->init)(ap, server)) { in auth_init()
206 i_support |= typemask(ap->type); in auth_init()
210 ap->type, ap->way); in auth_init()
214 Name, ap->type, ap->way); in auth_init()
237 *maskp = -1; in getauthmask()
265 int i, mask = -1; in auth_onoff()
273 for (ap = authenticators; ap->type; ap++) { in auth_onoff()
274 if ((mask & (i = typemask(ap->type))) != 0) in auth_onoff()
277 printf("\t%s\n", AUTHTYPE_NAME(ap->type)); in auth_onoff()
310 if (i_wont_support == -1) in auth_status()
316 for (ap = authenticators; ap->type; ap++) { in auth_status()
317 if ((mask & (i = typemask(ap->type))) != 0) in auth_status()
320 printf("%s: %s\n", AUTHTYPE_NAME(ap->type), in auth_status()
321 (i_wont_support & typemask(ap->type)) ? in auth_status()
342 while (ap->type) { in auth_request()
343 if (i_support & ~i_wont_support & typemask(ap->type)) { in auth_request()
346 Name, ap->type, ap->way); in auth_request()
348 *e++ = ap->type; in auth_request()
349 *e++ = ap->way; in auth_request()
355 net_write(str_request, e - str_request); in auth_request()
356 printsub('>', &str_request[2], e - str_request - 2); in auth_request()
403 * This is probably a no-op, but we just make sure in auth_send()
408 while ((auth_send_cnt -= 2) >= 0) { in auth_send()
415 if (ap && ap->send) { in auth_send()
420 if ((*ap->send)(ap)) { in auth_send()
429 auth_send_data += 2; in auth_send()
438 auth_send_data += 2; in auth_send()
441 printsub('>', &str_none[2], sizeof(str_none) - 2); in auth_send()
462 if (cnt < 2) in auth_is()
471 if (ap->is) in auth_is()
472 (*ap->is)(ap, data+2, cnt-2); in auth_is()
483 if (cnt < 2) in auth_reply()
487 if (ap->reply) in auth_reply()
488 (*ap->reply)(ap, data+2, cnt-2); in auth_reply()
504 if ((size_t)cnt > sizeof(savename) - 1) { in auth_name()
507 Name, cnt, (u_int)sizeof(savename)-1); in auth_name()
523 unsigned char *ee = &str_request[sizeof(str_request)-2]; in auth_sendname()
525 while (--len >= 0) { in auth_sendname()
533 net_write(str_request, e - str_request); in auth_sendname()
534 printsub('>', &str_request[2], e - &str_request[2]); in auth_sendname()
579 if (authenticated->status) in auth_wait()
580 validuser = (*authenticated->status)(authenticated, in auth_wait()
590 if ((ap = findauthenticator(data[1], data[2])) && ap->printsub) in auth_printsub()
591 (*ap->printsub)(data, cnt, buf, buflen); in auth_printsub()
602 cnt -= 3; in auth_gen_printsub()
604 buf[buflen-1] = '\0'; in auth_gen_printsub()
605 buf[buflen-2] = '*'; in auth_gen_printsub()
606 buflen -= 2; in auth_gen_printsub()
607 for (; cnt > 0; cnt--, data++) { in auth_gen_printsub()
609 for (cp = tbuf; *cp && buflen > 0; --buflen) in auth_gen_printsub()