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.h
Go to the documentation of this file.
1 /*
2  * ssh.h
3  *
4  * Minimal SSH-1 protocol implementation.
5  *
6  * Copyright (c) 2000 Dug Song <dugsong@monkey.org>
7  *
8  * $Id: ssh.h,v 1.3 2001/03/15 08:33:06 dugsong Exp $
9  */
10 
11 #ifndef SSH_H
12 #define SSH_H
13 
14 #define SSH_MAX_PADLEN 8
15 #define SSH_MAX_PKTLEN 262144
16 
17 /* Authentication types. */
18 #define SSH_AUTH_PASSWORD 3
19 
20 /* Cipher types. */
21 #define SSH_CIPHER_NONE 0
22 #define SSH_CIPHER_3DES 3
23 #define SSH_CIPHER_BLOWFISH 6
24 
25 /* Message types. */
26 #define SSH_MSG_DISCONNECT 1
27 #define SSH_SMSG_PUBLIC_KEY 2
28 #define SSH_CMSG_SESSION_KEY 3
29 #define SSH_CMSG_USER 4
30 #define SSH_CMSG_AUTH_PASSWORD 9
31 #define SSH_SMSG_SUCCESS 14
32 #define SSH_SMSG_FAILURE 15
33 #define SSH_CMSG_STDIN_DATA 16
34 #define SSH_SMSG_STDOUT_DATA 17
35 #define SSH_SMSG_STDERR_DATA 18
36 #define SSH_SMSG_EXITSTATUS 20
37 
38 typedef struct ssh_ctx {
39  int authmask;
40  int encmask;
41  RSA *servkey;
42  RSA *hostkey;
43 } SSH_CTX;
44 
45 typedef struct ssh {
46  int fd;
48  u_char sesskey[32];
49  void *estate;
50  void *dstate;
51  void (*encrypt)(u_char *src, u_char *dst, int len, void *state);
52  void (*decrypt)(u_char *src, u_char *dst, int len, void *state);
53 } SSH;
54 
55 void SSH_init(void);
56 
57 SSH_CTX *SSH_CTX_new(void);
58 
59 SSH *SSH_new(SSH_CTX *ctx);
60 
61 void SSH_set_fd(SSH *ssh, int fd);
62 
63 int SSH_accept(SSH *ssh);
64 
65 int SSH_connect(SSH *ssh);
66 
67 int SSH_recv(SSH *ssh, u_char *buf, int size);
68 
69 int SSH_send(SSH *ssh, u_char *buf, int len);
70 
71 void SSH_close(SSH *ssh);
72 
73 #endif /* SSH_H */
SSH_close
void SSH_close(SSH *ssh)
Definition: ssh.c:578
ssh::encrypt
void(* encrypt)(u_char *src, u_char *dst, int len, void *state)
Definition: ssh.h:51
SSH_CTX_new
SSH_CTX * SSH_CTX_new(void)
Definition: ssh.c:192
ssh::fd
int fd
Definition: ssh.h:46
ssh_ctx::encmask
int encmask
Definition: ssh.h:40
SSH_init
void SSH_init(void)
Definition: ssh.c:178
SSH_CTX
struct ssh_ctx SSH_CTX
ssh
Definition: ssh.h:45
SSH_set_fd
void SSH_set_fd(SSH *ssh, int fd)
Definition: ssh.c:221
SSH_recv
int SSH_recv(SSH *ssh, u_char *buf, int size)
Definition: ssh.c:489
ssh::estate
void * estate
Definition: ssh.h:49
ssh::dstate
void * dstate
Definition: ssh.h:50
SSH_new
SSH * SSH_new(SSH_CTX *ctx)
Definition: ssh.c:207
ssh::sesskey
u_char sesskey[32]
Definition: ssh.h:48
SSH_send
int SSH_send(SSH *ssh, u_char *buf, int len)
Definition: ssh.c:533
ssh_ctx
Definition: ssh.h:38
buf
Definition: buf.h:14
ssh::ctx
SSH_CTX * ctx
Definition: ssh.h:47
SSH_connect
int SSH_connect(SSH *ssh)
Definition: ssh.c:352
SSH
struct ssh SSH
ssh_ctx::servkey
RSA * servkey
Definition: ssh.h:41
ssh::decrypt
void(* decrypt)(u_char *src, u_char *dst, int len, void *state)
Definition: ssh.h:52
ssh_ctx::authmask
int authmask
Definition: ssh.h:39
ssh_ctx::hostkey
RSA * hostkey
Definition: ssh.h:42
SSH_accept
int SSH_accept(SSH *ssh)
Definition: ssh.c:229