dsniff  2.4b2
About: A collection of tools for network auditing
  Fossies Dox: dsniff-2.4b2.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

ssh.c File Reference
#include "config.h"
#include <sys/param.h>
#include <sys/types.h>
#include <arpa/nameser.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "hex.h"
#include "options.h"
#include "sshcrypto.h"
#include "ssh.h"
Include dependency graph for ssh.c:

Go to the source code of this file.

Macros

#define SKIP(p, i, l)   { (p) += (l); if (((i) -= (l)) < 0) return (-1); }
 

Functions

static void put_bn (BIGNUM *bn, u_char **pp)
 
static void get_bn (BIGNUM *bn, u_char **pp, int *lenp)
 
static u_char * ssh_session_id (u_char *cookie, BIGNUM *hostkey_n, BIGNUM *servkey_n)
 
static u_int ssh_crc32 (const unsigned char *p, u_int len)
 
static ssize_t atomicio (ssize_t(*f)(), int fd, void *_s, size_t n)
 
void SSH_init (void)
 
SSH_CTXSSH_CTX_new (void)
 
SSHSSH_new (SSH_CTX *ctx)
 
void SSH_set_fd (SSH *ssh, int fd)
 
int SSH_accept (SSH *ssh)
 
int SSH_connect (SSH *ssh)
 
int SSH_recv (SSH *ssh, u_char *buf, int size)
 
int SSH_send (SSH *ssh, u_char *buf, int len)
 
void SSH_close (SSH *ssh)
 

Variables

static u_int crc32_tab []
 
static u_char pkt [4+8+262144]
 

Macro Definition Documentation

◆ SKIP

#define SKIP (   p,
  i,
  l 
)    { (p) += (l); if (((i) -= (l)) < 0) return (-1); }

Definition at line 226 of file ssh.c.

Function Documentation

◆ atomicio()

static ssize_t atomicio ( ssize_t(*)()  f,
int  fd,
void *  _s,
size_t  n 
)
static

Definition at line 157 of file ssh.c.

Referenced by SSH_recv(), and SSH_send().

◆ get_bn()

static void get_bn ( BIGNUM *  bn,
u_char **  pp,
int *  lenp 
)
static

Definition at line 100 of file ssh.c.

References errx().

Referenced by SSH_accept(), and SSH_connect().

◆ put_bn()

static void put_bn ( BIGNUM *  bn,
u_char **  pp 
)
static

Definition at line 90 of file ssh.c.

Referenced by SSH_accept(), and SSH_connect().

◆ SSH_accept()

◆ SSH_close()

void SSH_close ( SSH ssh)

Definition at line 578 of file ssh.c.

References ssh::fd.

Referenced by mitm_child().

◆ SSH_connect()

◆ ssh_crc32()

static u_int ssh_crc32 ( const unsigned char *  p,
u_int  len 
)
static

Definition at line 144 of file ssh.c.

References crc32_tab.

Referenced by SSH_recv(), and SSH_send().

◆ SSH_CTX_new()

SSH_CTX* SSH_CTX_new ( void  )

◆ SSH_init()

void SSH_init ( void  )

Definition at line 178 of file ssh.c.

Referenced by mitm_init().

◆ SSH_new()

SSH* SSH_new ( SSH_CTX ctx)

Definition at line 207 of file ssh.c.

References ssh::ctx, and ssh::fd.

Referenced by mitm_child().

◆ SSH_recv()

int SSH_recv ( SSH ssh,
u_char *  buf,
int  size 
)

Definition at line 489 of file ssh.c.

References atomicio(), ssh::decrypt, ssh::dstate, ssh::fd, hex_print(), Opt_debug, ssh_crc32(), and warnx().

Referenced by mitm_child(), SSH_accept(), and SSH_connect().

◆ SSH_send()

int SSH_send ( SSH ssh,
u_char *  buf,
int  len 
)

Definition at line 533 of file ssh.c.

References atomicio(), ssh::encrypt, ssh::estate, ssh::fd, pkt, ssh_crc32(), and SSH_MAX_PKTLEN.

Referenced by mitm_child(), SSH_accept(), and SSH_connect().

◆ ssh_session_id()

static u_char* ssh_session_id ( u_char *  cookie,
BIGNUM *  hostkey_n,
BIGNUM *  servkey_n 
)
static

Definition at line 120 of file ssh.c.

Referenced by SSH_accept(), and SSH_connect().

◆ SSH_set_fd()

void SSH_set_fd ( SSH ssh,
int  fd 
)

Definition at line 221 of file ssh.c.

References ssh::fd.

Referenced by mitm_child().

Variable Documentation

◆ crc32_tab

u_int crc32_tab[]
static

Definition at line 32 of file ssh.c.

Referenced by ssh_crc32().

◆ pkt

u_char pkt[4+8+ 262144]
static