From e1ef7925a259e7deede30d7e0c8ba1740164f732 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 24 Aug 2003 19:19:43 +0000 Subject: [PATCH] More fixes for FST-0001 passwword checks --- TODO | 6 +-- html/known_bugs.html | 7 ++- lib/packet.c | 110 ++++++++++++++++++++----------------------- mbcico/filelist.c | 4 ++ 4 files changed, 62 insertions(+), 65 deletions(-) diff --git a/TODO b/TODO index c649eeaa..9b699d11 100644 --- a/TODO +++ b/TODO @@ -109,11 +109,7 @@ mbcico: transfers. Changes are under test now. Feedback needed! N: Implement binkp resync when getting files. Transmit works. - - N: FTS-0001 sessions always are secure, the password check is not - good. - - N: The FTS-0001 incoming hello packet is not after a session. + Under test now! mbfile: L: Add a check to see if the magic filenames are (still) valid. diff --git a/html/known_bugs.html b/html/known_bugs.html index 8b26fce1..643cdcf2 100644 --- a/html/known_bugs.html +++ b/html/known_bugs.html @@ -12,7 +12,7 @@
-
Last update 21-Jan-2002
+
Last update 24-Aug-2003

 

MBSE BBS - Known bugs.

@@ -28,6 +28,11 @@ slow links and over PPP. This is not a MBSE BBS problem.

  • Problems with D'Bridge [1a] mailers.
  • mbsetup crashes at several places if in system aka's the domain name is 12 characters long. + +
  • If you have regular sessions with a node wich only supports FTS-0001 +sessions and you use a session password you must also set a mail password +and these passwords must be the same. This is a side effect of the way FTS-0001 +handshake works, by sending a small mail packet wich contains the password. BackGo Back diff --git a/lib/packet.c b/lib/packet.c index a999b466..cf88946f 100644 --- a/lib/packet.c +++ b/lib/packet.c @@ -62,21 +62,16 @@ FILE *openpkt(FILE *pkt, faddr *addr, char flavor, int session) if (pkt == NULL) { if (pktfp) { - Syslog('P', "packet opened, check address"); if (metric(addr,&pktroute) == 0) { if ((CFG.maxpktsize == 0L) || ((fstat(fileno(pktfp),&st) == 0) && (st.st_size < CFG.maxpktsize))) { - Syslog('P', "return existing fp"); return pktfp; } - Syslog('P', "packet too big, open new"); closepkt(); } else { - Syslog('P', "address changed, closing fp"); closepkt(); } } - Syslog('P', "open new packet file"); pktroute.zone = addr->zone; pktroute.net = addr->net; pktroute.node = addr->node; @@ -109,8 +104,6 @@ FILE *openpkt(FILE *pkt, faddr *addr, char flavor, int session) pos = ftell(pkt); if (pos <= 0L) { - Syslog('P', "creating new .pkt"); - Syslog('s', "openpkt() create .pkt in %s mode", session?"session":"mail"); /* * Write .PKT header, see FSC-0039 rev. 4 @@ -121,60 +114,60 @@ FILE *openpkt(FILE *pkt, faddr *addr, char flavor, int session) if (ptm->tm_sec > 59) ptm->tm_sec = 59; - bestaka = bestaka_s(addr); - buffer[0x00] = (bestaka->node & 0x00ff); - buffer[0x01] = (bestaka->node & 0xff00) >> 8; - buffer[0x02] = (addr->node & 0x00ff); - buffer[0x03] = (addr->node & 0xff00) >> 8; - buffer[0x04] = ((ptm->tm_year + 1900) & 0x00ff); - buffer[0x05] = ((ptm->tm_year + 1900) & 0xff00) >> 8; - buffer[0x06] = ptm->tm_mon; - buffer[0x08] = ptm->tm_mday; - buffer[0x0a] = ptm->tm_hour; - buffer[0x0c] = ptm->tm_min; - buffer[0x0e] = ptm->tm_sec; - buffer[0x12] = 2; - buffer[0x14] = (bestaka->net & 0x00ff); - buffer[0x15] = (bestaka->net & 0xff00) >> 8; - buffer[0x16] = (addr->net & 0x00ff); - buffer[0x17] = (addr->net & 0xff00) >> 8; - buffer[0x18] = (PRODCODE & 0x00ff); - buffer[0x19] = (VERSION_MAJOR & 0x00ff); + bestaka = bestaka_s(addr); + buffer[0x00] = (bestaka->node & 0x00ff); + buffer[0x01] = (bestaka->node & 0xff00) >> 8; + buffer[0x02] = (addr->node & 0x00ff); + buffer[0x03] = (addr->node & 0xff00) >> 8; + buffer[0x04] = ((ptm->tm_year + 1900) & 0x00ff); + buffer[0x05] = ((ptm->tm_year + 1900) & 0xff00) >> 8; + buffer[0x06] = ptm->tm_mon; + buffer[0x08] = ptm->tm_mday; + buffer[0x0a] = ptm->tm_hour; + buffer[0x0c] = ptm->tm_min; + buffer[0x0e] = ptm->tm_sec; + buffer[0x12] = 2; + buffer[0x14] = (bestaka->net & 0x00ff); + buffer[0x15] = (bestaka->net & 0xff00) >> 8; + buffer[0x16] = (addr->net & 0x00ff); + buffer[0x17] = (addr->net & 0xff00) >> 8; + buffer[0x18] = (PRODCODE & 0x00ff); + buffer[0x19] = (VERSION_MAJOR & 0x00ff); - memset(&str, 0, 8); - if (session) { - if (noderecord(addr) && strlen(nodes.Epasswd)) - sprintf(str, "%s", nodes.Spasswd); - } else { - if (noderecord(addr) && strlen(nodes.Epasswd)) - sprintf(str, "%s", nodes.Epasswd); - } - for (i = 0; i < 8; i++) - buffer[0x1a + i] = toupper(str[i]); /* FSC-0039 only talks about A-Z, 0-9, so force uppercase */ + memset(&str, 0, 8); + if (session) { + if (noderecord(addr) && strlen(nodes.Spasswd)) + sprintf(str, "%s", nodes.Spasswd); + } else { + if (noderecord(addr) && strlen(nodes.Epasswd)) + sprintf(str, "%s", nodes.Epasswd); + } + for (i = 0; i < 8; i++) + buffer[0x1a + i] = toupper(str[i]); /* FSC-0039 only talks about A-Z, 0-9, so force uppercase */ - buffer[0x22] = (bestaka->zone & 0x00ff); - buffer[0x23] = (bestaka->zone & 0xff00) >> 8; - buffer[0x24] = (addr->zone & 0x00ff); - buffer[0x25] = (addr->zone & 0xff00) >> 8; - buffer[0x29] = 1; - buffer[0x2a] = (PRODCODE & 0xff00) >> 8; - buffer[0x2b] = (VERSION_MINOR & 0x00ff); - buffer[0x2c] = 1; - buffer[0x2e] = buffer[0x22]; - buffer[0x2f] = buffer[0x23]; - buffer[0x30] = buffer[0x24]; - buffer[0x31] = buffer[0x25]; - buffer[0x32] = (bestaka->point & 0x00ff); - buffer[0x33] = (bestaka->point & 0xff00) >> 8; - buffer[0x34] = (addr->point & 0x00ff); - buffer[0x35] = (addr->point & 0xff00) >> 8; - buffer[0x36] = 'm'; - buffer[0x37] = 'b'; - buffer[0x38] = 's'; - buffer[0x39] = 'e'; + buffer[0x22] = (bestaka->zone & 0x00ff); + buffer[0x23] = (bestaka->zone & 0xff00) >> 8; + buffer[0x24] = (addr->zone & 0x00ff); + buffer[0x25] = (addr->zone & 0xff00) >> 8; + buffer[0x29] = 1; + buffer[0x2a] = (PRODCODE & 0xff00) >> 8; + buffer[0x2b] = (VERSION_MINOR & 0x00ff); + buffer[0x2c] = 1; + buffer[0x2e] = buffer[0x22]; + buffer[0x2f] = buffer[0x23]; + buffer[0x30] = buffer[0x24]; + buffer[0x31] = buffer[0x25]; + buffer[0x32] = (bestaka->point & 0x00ff); + buffer[0x33] = (bestaka->point & 0xff00) >> 8; + buffer[0x34] = (addr->point & 0x00ff); + buffer[0x35] = (addr->point & 0xff00) >> 8; + buffer[0x36] = 'm'; + buffer[0x37] = 'b'; + buffer[0x38] = 's'; + buffer[0x39] = 'e'; - fseek(pkt, 0L, SEEK_SET); - fwrite(buffer, 1, 0x3a, pkt); + fseek(pkt, 0L, SEEK_SET); + fwrite(buffer, 1, 0x3a, pkt); } return pkt; @@ -186,7 +179,6 @@ void closepkt(void) { unsigned char buffer[2]; - Syslog('P', "closepkt entered"); memset(&buffer, 0, sizeof(buffer)); if (pktfp) { diff --git a/mbcico/filelist.c b/mbcico/filelist.c index 83886883..3dd0a7fc 100644 --- a/mbcico/filelist.c +++ b/mbcico/filelist.c @@ -328,11 +328,14 @@ file_list *create_filelist(fa_list *al, char *fl, int create) */ tmpfl = fl; while ((flavor = *tmpfl++)) { + + Syslog('o', "Check flavor %c", flavor); /* * Check normal mail packets */ nm = pktname(tmpa->addr,flavor); if ((nm != NULL) && (stat(nm,&stbuf) == 0)) { + Syslog('o', "found %s", nm); packets++; add_list(&st, nm, tmpkname(), KFS, 0L, NULL, 1); } @@ -358,6 +361,7 @@ file_list *create_filelist(fa_list *al, char *fl, int create) } } + Syslog('o', "B4 FTS-0001 checkpoint"); /* * For FTS-0001 we need to create at least one packet. */