Lines Matching +full:ep +full:- +full:side

1 /*-
93 #define typemask(x) ((x) > 0 ? 1 << ((x)-1) : 0)
143 Encryptions *ep = encryptions; in findencryption() local
147 while (ep->type && ep->type != type) in findencryption()
148 ++ep; in findencryption()
149 return(ep->type ? ep : 0); in findencryption()
155 Encryptions *ep = encryptions; in finddecryption() local
159 while (ep->type && ep->type != type) in finddecryption()
160 ++ep; in finddecryption()
161 return(ep->type ? ep : 0); in finddecryption()
182 Encryptions *ep = encryptions; in encrypt_init() local
195 while (ep->type) { in encrypt_init()
198 Name, ENCTYPE_NAME(ep->type)); in encrypt_init()
199 i_support_encrypt |= typemask(ep->type); in encrypt_init()
200 i_support_decrypt |= typemask(ep->type); in encrypt_init()
201 if ((i_wont_support_decrypt & typemask(ep->type)) == 0) in encrypt_init()
202 if ((str_send[str_suplen++] = ep->type) == IAC) in encrypt_init()
204 if (ep->init) in encrypt_init()
205 (*ep->init)(Server); in encrypt_init()
206 ++ep; in encrypt_init()
215 Encryptions *ep = encryptions; in encrypt_list_types() local
218 while (ep->type) { in encrypt_list_types()
219 printf("\t%s (%d)\r\n", ENCTYPE_NAME(ep->type), ep->type); in encrypt_list_types()
220 ++ep; in encrypt_list_types()
240 Encryptions *ep; in EncryptDisable() local
246 } else if ((ep = (Encryptions *)genget(type, (char **)encryptions, in EncryptDisable()
249 } else if (Ambiguous((char **)ep)) { in EncryptDisable()
253 if (decrypt_mode == ep->type) in EncryptDisable()
255 i_wont_support_decrypt |= typemask(ep->type); in EncryptDisable()
259 if (encrypt_mode == ep->type) in EncryptDisable()
261 i_wont_support_encrypt |= typemask(ep->type); in EncryptDisable()
273 Encryptions *ep; in EncryptType() local
279 } else if ((ep = (Encryptions *)genget(type, (char **)encryptions, in EncryptType()
282 } else if (Ambiguous((char **)ep)) { in EncryptType()
286 decrypt_mode = ep->type; in EncryptType()
287 i_wont_support_decrypt &= ~typemask(ep->type); in EncryptType()
291 encrypt_mode = ep->type; in EncryptType()
292 i_wont_support_encrypt &= ~typemask(ep->type); in EncryptType()
424 printsub('>', &str_send[2], str_suplen - 2); in encrypt_send_support()
478 Encryptions *ep; in encrypt_support() local
481 * Forget anything the other side has previously told us. in encrypt_support()
485 while (cnt-- > 0) { in encrypt_support()
499 ep = findencryption(use_type); in encrypt_support()
500 if (!ep) in encrypt_support()
502 type = ep->start ? (*ep->start)(DIR_ENCRYPT, Server) : 0; in encrypt_support()
504 printf(">>>%s: (*ep->start)() returned %d\r\n", in encrypt_support()
517 Encryptions *ep; in encrypt_is() local
520 if (--cnt < 0) in encrypt_is()
525 if (!(ep = finddecryption(type))) { in encrypt_is()
534 if (!ep->is) { in encrypt_is()
543 ret = (*ep->is)(data, cnt); in encrypt_is()
545 printf("(*ep->is)(%p, %d) returned %s(%d)\n", data, cnt, in encrypt_is()
561 Encryptions *ep; in encrypt_reply() local
564 if (--cnt < 0) in encrypt_reply()
567 if (!(ep = findencryption(type))) { in encrypt_reply()
576 if (!ep->reply) { in encrypt_reply()
585 ret = (*ep->reply)(data, cnt); in encrypt_reply()
587 printf("(*ep->reply)(%p, %d) returned %s(%d)\n", in encrypt_reply()
609 Encryptions *ep; in encrypt_start() local
615 * decryption scheme. Send a REQUEST-END to in encrypt_start()
623 if ((ep = finddecryption(decrypt_mode))) { in encrypt_start()
624 decrypt_input = ep->input; in encrypt_start()
645 Encryptions *ep = encryptions; in encrypt_session_key() local
649 while (ep->type) { in encrypt_session_key()
650 if (ep->session) in encrypt_session_key()
651 (*ep->session)(key, server); in encrypt_session_key()
652 ++ep; in encrypt_session_key()
670 * Called when ENCRYPT REQUEST-END is received.
679 * Called when ENCRYPT REQUEST-START is received. If we receive
681 * other side wants us to start encrypting data as soon as we
712 Encryptions *ep; in encrypt_keyid() local
713 int dir = kp->dir; in encrypt_keyid()
719 if (!(ep = (*kp->getcrypt)(*kp->modep))) { in encrypt_keyid()
722 kp->keylen = 0; in encrypt_keyid()
727 if (kp->keylen == 0) in encrypt_keyid()
729 kp->keylen = 0; in encrypt_keyid()
730 if (ep->keyid) in encrypt_keyid()
731 (void)(*ep->keyid)(dir, kp->keyid, &kp->keylen); in encrypt_keyid()
733 } else if ((len != kp->keylen) || in encrypt_keyid()
734 (memcmp(keyid, kp->keyid, len) != 0)) { in encrypt_keyid()
738 kp->keylen = len; in encrypt_keyid()
739 memmove(kp->keyid, keyid, len); in encrypt_keyid()
740 if (ep->keyid) in encrypt_keyid()
741 (void)(*ep->keyid)(dir, kp->keyid, &kp->keylen); in encrypt_keyid()
743 if (ep->keyid) in encrypt_keyid()
744 ret = (*ep->keyid)(dir, kp->keyid, &kp->keylen); in encrypt_keyid()
746 encrypt_start_output(*kp->modep); in encrypt_keyid()
750 encrypt_send_keyid(dir, kp->keyid, kp->keylen, 0); in encrypt_keyid()
762 memmove(kp->keyid, keyid, keylen); in encrypt_send_keyid()
763 kp->keylen = keylen; in encrypt_send_keyid()
766 for (strp = &str_keyid[4]; keylen > 0; --keylen) { in encrypt_send_keyid()
772 net_write(str_keyid, strp - str_keyid); in encrypt_send_keyid()
773 printsub('>', &str_keyid[2], strp - str_keyid - 2); in encrypt_send_keyid()
797 Encryptions *ep; in encrypt_start_output() local
801 if (!(ep = findencryption(type))) { in encrypt_start_output()
811 if (ep->start) { in encrypt_start_output()
812 i = (*ep->start)(DIR_ENCRYPT, Server); in encrypt_start_output()
831 net_write(str_start, p - str_start); in encrypt_start_output()
833 printsub('>', &str_start[2], p - &str_start[2]); in encrypt_start_output()
840 encrypt_output = ep->output; in encrypt_start_output()
859 printsub('>', &str_end[2], sizeof(str_end) - 2); in encrypt_send_end()
885 net_write(str_start, p - str_start); in encrypt_send_request_start()
886 printsub('>', &str_start[2], p - &str_start[2]); in encrypt_send_request_start()
896 printsub('>', &str_end[2], sizeof(str_end) - 2); in encrypt_send_request_end()
919 cnt -= 2; in encrypt_gen_printsub()
921 buf[buflen-1] = '\0'; in encrypt_gen_printsub()
922 buf[buflen-2] = '*'; in encrypt_gen_printsub()
923 buflen -= 2;; in encrypt_gen_printsub()
924 for (; cnt > 0; cnt--, data++) { in encrypt_gen_printsub()
926 for (cp = tbuf; *cp && buflen > 0; --buflen) in encrypt_gen_printsub()
937 Encryptions *ep; in encrypt_printsub() local
940 for (ep = encryptions; ep->type && ep->type != type; ep++) in encrypt_printsub()
943 if (ep->printsub) in encrypt_printsub()
944 (*ep->printsub)(data, cnt, buf, buflen); in encrypt_printsub()