1
0
Fork 0
qmail/case_startb.c
Alan Post 36d7678ec9 Apply Erwin Hoffmann's SMTP authentication for qmail-smtpd, qmail-remote.
From https://www.fehcom.de/qmail/smtpauth.html#PATCHES

Generic SMTP authentication for qmail-smtpd and qmail-remote.
Complies to RFC 3848 and RFC 4409.

 * Provides now CRAM-MD5 authentication for qmail-remote as well.
 * Fine tuning of SMTPAUTH annoncements for qmail-smtpd and
   SUBMISSION support.
 * Sender based authentication according to 'Mail From:' and
   authenticated smarthost relaying for qmail-remote.
 * Fixed bug (0.8.2): qmail-smtpd secretly allows auth even when
   disabled! (tx Chris P.)
 * Fixed AMD64 bug for MD5 (0.8.3) and small others (tx Alan P.)
2019-07-12 23:56:05 -06:00

21 lines
397 B
C

#include "case.h"
int case_startb(s,len,t)
register char *s;
unsigned int len;
register char *t;
{
register unsigned char x;
register unsigned char y;
for (;;) {
y = *t++ - 'A';
if (y <= 'Z' - 'A') y += 'a'; else y += 'A';
if (!y) return 1;
if (!len) return 0;
--len;
x = *s++ - 'A';
if (x <= 'Z' - 'A') x += 'a'; else x += 'A';
if (x != y) return 0;
}
}