dtmail: remove DEAD_WOOD code

This commit is contained in:
Chase
2025-11-27 13:48:24 -05:00
committed by Jon Trulson
parent e945fc8b08
commit f38cd20c5c
70 changed files with 3 additions and 2130 deletions

View File

@@ -187,70 +187,6 @@ MIMEBodyPart::~MIMEBodyPart(void)
{
}
#ifdef DEAD_WOOD
DtMailChecksumState
MIMEBodyPart::checksum(DtMailEnv & error)
{
error.clear();
// Look for the Content-MD5 header. If it is not present, then
// the state is unknown and we can punt.
//
DtMailEnv my_error;
DtMailValueSeq value;
_body_env->getHeader(my_error, "Content-MD5", DTM_FALSE, value);
if (my_error.isSet()) {
return(DtMailCheckUnknown);
}
if (_body_type == NULL) {
getDtType(error);
if (error.isSet()) {
return(DtMailCheckUnknown);
}
}
char stored_digest[32];
int stored_size = 0;
RFCMIME::readBase64(stored_digest, stored_size,
*(value[0]), strlen(*(value[0])));
if (stored_size != 16) {
// The MD5 sum must be 16 bytes, or we have a bad checksum.
//
return(DtMailCheckBad);
}
// See if we call this text. We need to handle md5 checksums
// different for text. They must be computed with CRLF line
// termination.
//
char * text_type = DtDtsDataTypeToAttributeValue(_body_type,
DtDTS_DA_IS_TEXT,
NULL);
unsigned char digest[16];
if (text_type && strcasecmp(text_type, "true") == 0) {
RFCMIME::md5PlainText(_body, _body_decoded_len, digest);
}
else {
MD5_CTX context;
MD5Init(&context);
MD5Update(&context, (unsigned char *)_body, _body_decoded_len);
MD5Final(digest, &context);
}
free(text_type);
if (memcmp(digest, stored_digest, sizeof(digest)) == 0) {
return(DtMailCheckGood);
}
else {
return(DtMailCheckBad);
}
}
#endif /* DEAD_WOOD */
static int
countTypes(char ** types)
{