version 1.6, 2001/05/22 00:37:20 |
version 1.6.8.1, 2004/03/04 18:18:14 |
|
|
|
|
This document is intended for those who wish to read the ssh source |
This document is intended for those who wish to read the ssh source |
code. This tries to give an overview of the structure of the code. |
code. This tries to give an overview of the structure of the code. |
|
|
Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi> |
Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi> |
Updated 17 Nov 1995. |
Updated 17 Nov 1995. |
Updated 19 Oct 1999 for OpenSSH-1.2 |
Updated 19 Oct 1999 for OpenSSH-1.2 |
|
|
these programs. |
these programs. |
|
|
Buffer manipulation routines |
Buffer manipulation routines |
|
|
- These provide an arbitrary size buffer, where data can be appended. |
- These provide an arbitrary size buffer, where data can be appended. |
Data can be consumed from either end. The code is used heavily |
Data can be consumed from either end. The code is used heavily |
throughout ssh. The basic buffer manipulation functions are in |
throughout ssh. The basic buffer manipulation functions are in |
|
|
data types is in bufaux.c. |
data types is in bufaux.c. |
|
|
Compression Library |
Compression Library |
|
|
- Ssh uses the GNU GZIP compression library (ZLIB). |
- Ssh uses the GNU GZIP compression library (ZLIB). |
|
|
Encryption/Decryption |
Encryption/Decryption |
|
|
code is linked into the server. The routines also manipulate |
code is linked into the server. The routines also manipulate |
known hosts files using code in hostfile.c. Code in canohost.c |
known hosts files using code in hostfile.c. Code in canohost.c |
is used to retrieve the canonical host name of the remote host. |
is used to retrieve the canonical host name of the remote host. |
Code in match.c is used to match host names. |
Code in match.c is used to match host names. |
|
|
- In the client end, authentication code is in sshconnect.c. It |
- In the client end, authentication code is in sshconnect.c. It |
reads Passwords/passphrases using code in readpass.c. It reads |
reads Passwords/passphrases using code in readpass.c. It reads |
|
|
operations, and finally the server enters the normal session |
operations, and finally the server enters the normal session |
mode by calling server_loop in serverloop.c. This does the real |
mode by calling server_loop in serverloop.c. This does the real |
work, calling functions in other modules. |
work, calling functions in other modules. |
|
|
- The code for the server is in sshd.c. It contains a lot of |
- The code for the server is in sshd.c. It contains a lot of |
stuff, including: |
stuff, including: |
- server main program |
- server main program |
- waiting for connections |
- waiting for connections |
- processing new connection |
- processing new connection |
- authentication |
- authentication |
|
|
|
|
- There are several other files in the distribution that contain |
- There are several other files in the distribution that contain |
various auxiliary routines: |
various auxiliary routines: |
ssh.h the main header file for ssh (various definitions) |
ssh.h the main header file for ssh (various definitions) |
getput.h byte-order independent storage of integers |
getput.h byte-order independent storage of integers |
includes.h includes most system headers. Lots of #ifdefs. |
includes.h includes most system headers. Lots of #ifdefs. |
tildexpand.c expand tilde in file names |
tildexpand.c expand tilde in file names |
uidswap.c uid-swapping |
uidswap.c uid-swapping |
xmalloc.c "safe" malloc routines |
xmalloc.c "safe" malloc routines |