File: decode_ssh.c

package info (click to toggle)
dsniff 2.5a2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,104 kB
  • sloc: ansic: 13,081; sh: 152; makefile: 140
file content (34 lines) | stat: -rw-r--r-- 556 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "config.h"

#include <sys/types.h>

#include <stdio.h>
#include <string.h>
#include <stdint.h>

#include <strlcpy.h>
#include <ctype.h>

#include "options.h"
#include "decode.h"

extern struct _dc_meta dc_meta;

int
decode_ssh(u_char *buf, int len, u_char *obuf, int olen) {
	u_char *ptr = "";

	if (!Opt_verbose)
		return 0;

	if (strncmp(buf, "SSH-", 4) != 0)
		return 0;

	if (dc_meta.rbuf != NULL)
		ptr = ascii_string(dc_meta.rbuf, dc_meta.rlen);

	snprintf(obuf, olen, "%s >>> %s", ascii_string(buf, len), ptr);
	
	return (strlen(obuf));
}