• Seeking help modifying Diablo source to prevent miscategorization of ar

    From Jesse Rehmer@21:1/5 to All on Mon Mar 20 00:50:54 2023
    I recently switched to Diablo on the transit layer, but am observing it is rejecting messages that contain PGP as binary articles. This is preventing valid messages, such as NoCeM notices and messages that aren't encrypted but contain a PGP Signature, to be rejected in some cases, or not propagated to peers (due to "arttypes !binary" in the dnewsfeed definition).

    In lib/arttype.c, I see there is a specific check to identify an article with an article type of pgp, but this only checks for "-----BEGIN PGP
    MESSAGE-----".

    Looking at the contents of articles I am rejecting or not propagating, I believe the check should also look the following:

    "-----BEGIN PGP SIGNED MESSAGE-----"
    and
    "-----BEGIN PGP SIGNATURE-----"

    but I am not a developer and can't quite cobble anything together from the existing code that works to add these additional values.

    If anyone out there is willing to help me with a patch, I will be forever grateful!

    This is the portion of lib/arttype.c that is causing the misidentification:

    /*
    * We look for binary formats first, since these eat
    * up CPU like there is no tomorrow. We may miss
    * some flags if we detect a binary file, the
    * alternative is to remove the return(Type)'s and
    * eat CPU for the entire binary.
    */

    linetype = classifyLineAsTypes(ptr, len);

    if (linetype & UUE) {
    Base64 = 0;
    BinHex = 0;
    UUencode++;
    if (UUencode > 8) {
    Type |= ARTTYPE_UUENCODE | ARTTYPE_BINARY;
    return(Type);
    }
    } else if (linetype & BHX) {
    UUencode = 0;
    Base64 = 0;
    BinHex++;
    if (BinHex > 8) {
    Type |= ARTTYPE_BINHEX | ARTTYPE_BINARY;
    return(Type);
    }
    } else if (linetype & B64) {
    UUencode = 0;
    BinHex = 0;
    Base64++;
    if (Base64 > 8) {
    Type |= ARTTYPE_BASE64 | ARTTYPE_BINARY;
    return(Type);
    }
    } else {
    if (*ptr == '-' &&
    strncmp(ptr, "-----BEGIN PGP MESSAGE-----", 27) == 0)
    Type |= ARTTYPE_PGPMESSAGE;
    UUencode = 0;
    Base64 = 0;
    BinHex = 0;
    }
    }

    Warm Regards,

    Jesse Rehmer

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)