Skip to content

Commit

Permalink
imap authplain support
Browse files Browse the repository at this point in the history
  • Loading branch information
rootTHC committed Dec 1, 2024
1 parent e8d567e commit 15b82e3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crc32.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef __DS_CRC32_H__
#define __DS_CRC32_H__ 1

#define CRC32_INITIAL (0xffffffffUL)
#define CRC32_INITIAL ((uint32_t)0xffffffff)
#define CRC32_INITIAL_STATE (~CRC32_INITIAL)

#include <stdint.h>
Expand Down
6 changes: 6 additions & 0 deletions dsniff.magic
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
0 string POST\ / http
0 string CONNECT\ http

1 string \ ID\ imap
2 string \ ID\ imap
3 string \ ID\ imap
4 string \ ID\ imap
5 string \ ID\ imap

1 string \ LOGIN\ imap
2 string \ LOGIN\ imap
3 string \ LOGIN\ imap
Expand Down
6 changes: 6 additions & 0 deletions dsniff_magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ static char *mgx[] = {\
"0 string POST\\ / http", \
"0 string CONNECT\\ http", \
"", \
"1 string \\ ID\\ imap", \
"2 string \\ ID\\ imap", \
"3 string \\ ID\\ imap", \
"4 string \\ ID\\ imap", \
"5 string \\ ID\\ imap", \
"", \
"1 string \\ LOGIN\\ imap", \
"2 string \\ LOGIN\\ imap", \
"3 string \\ LOGIN\\ imap", \
Expand Down
1 change: 0 additions & 1 deletion magic.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ mconvert(union VALUETYPE *p, struct magic *m)
case STRING:
{
char *ptr;

/* Null terminate and eat the return */
p->s[sizeof(p->s) - 1] = '\0';
if ((ptr = strchr(p->s, '\n')) != NULL)
Expand Down
2 changes: 1 addition & 1 deletion record.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ record(in_addr_t src, in_addr_t dst, int proto, u_short sport, u_short dport,
if (!Opt_show_dups) {
// Check for duplicates.
crc = dc_meta.crc;
// Add entire buffer unless decodeing function already added 'uniq' items.
// Add entire buffer unless decoding function already added 'uniq' items.
if (crc == CRC32_INITIAL_STATE)
crc = crc32_update(buf, len, crc);
crc = crc32_update(&src, sizeof src, crc);
Expand Down
2 changes: 1 addition & 1 deletion trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ trigger_set_magic(int proto, int num, u_char *buf, int len)
char *name;

if ((name = magic_match(buf, len)) == NULL)
return (NULL);
return NULL;

t = NULL;
tr.num = num;
Expand Down

0 comments on commit 15b82e3

Please sign in to comment.