MCPcopy Create free account
hub / github.com/3proxy/3proxy / dnsauth

Function dnsauth

src/auth.c:758–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758int dnsauth(struct clientparam * param){
759 char buf[128];
760 char addr[16];
761 char dig[]="0123456789abcdef";
762
763 unsigned u;
764 int i;
765
766 if(*SAFAMILY(&param->sincr)!=AF_INET){
767 char *s = buf;
768 for(i=15; i>=0; i--){
769 unsigned char c=((unsigned char *)SAADDR(&param->sincr))[i];
770 *s++ = dig[(c&0xf)];
771 *s++ = '.';
772 *s++ = dig[(c>>4)];
773 *s++ = '.';
774 }
775 sprintf(s, "ip6.arpa");
776 }
777 else {
778 u = ntohl(*(unsigned long *)SAADDR(&param->sincr));
779
780 sprintf(buf, "%u.%u.%u.%u.in-addr.arpa",
781 ((u&0x000000FF)),
782 ((u&0x0000FF00)>>8),
783 ((u&0x00FF0000)>>16),
784 ((u&0xFF000000)>>24));
785
786 }
787 if(!udpresolve(*SAFAMILY(&param->sincr), (unsigned char *)buf, (unsigned char *)addr, NULL, param, 1)) return 6;
788 if(!memcmp(SAADDR(&param->sincr), addr, SAADDRLEN(&param->sincr))) return 6;
789
790 return param->username? 0:4;
791}
792
793int strongauth(struct clientparam * param){
794 struct passwords * pwl;

Callers

nothing calls this directly

Calls 1

udpresolveFunction · 0.85

Tested by

no test coverage detected