int body_found = 0;
uint32_t tlen;
-#ifdef HAVE_NSS
- if (MimeDecGetConfig()->body_md5) {
- if (state->body_begin == 1) {
- if (state->md5_ctx == NULL) {
- state->md5_ctx = HASH_Create(HASH_AlgMD5);
- HASH_Begin(state->md5_ctx);
- }
- }
- HASH_Update(state->md5_ctx, buf, len + state->current_line_delimiter_len);
- }
-#endif
-
/* pass empty lines on if we're parsing the body, otherwise we have no use
* for them, and in fact they would disrupt the state tracking */
if (len == 0) {
MAX_LINE_LEN);
}
+ if ((state->state_flag != HEADER_READY && state->state_flag != HEADER_STARTED) ||
+ (state->stack->top->data->ctnt_flags & CTNT_IS_BODYPART)) {
+#ifdef HAVE_NSS
+ if (MimeDecGetConfig()->body_md5) {
+ if (state->body_begin == 1) {
+ if (state->md5_ctx == NULL) {
+ state->md5_ctx = HASH_Create(HASH_AlgMD5);
+ HASH_Begin(state->md5_ctx);
+ }
+ }
+ HASH_Update(state->md5_ctx, buf, len + state->current_line_delimiter_len);
+ }
+#endif
+ }
+
/* Looking for headers */
if (state->state_flag == HEADER_READY ||
state->state_flag == HEADER_STARTED) {