#include <stdio.h>
#include "md5.h"
#include "libcomm.h"
Functions | |
void | free_authinfo (struct AUTHINFO *destroy) |
Free the memory space which is used by an AUTHINFO structure. More... | |
int | socket_md5auth (int fd, char *netname, char *name, struct AUTHINFO **plocallogin, struct AUTHINFO **premotelogin) |
Do both side authentification. More... | |
AUTHINFO * | getauthinfo (char *netname, char *name) |
Load authentication informations (netname, name, passwd, keyencrypt, keydecrypt) from authfile. More... |
|
Free the memory space which is used by an AUTHINFO structure.
|
|
Load authentication informations (netname, name, passwd, keyencrypt, keydecrypt) from authfile.
|
|
Do both side authentification. This function is usually called just after a socket stream is established. The function must be called on both sides. Both sides following these steps: 1. get auth info ([login] name, passwd) by using getauthinfo() from name or netname for remote login 2. generate random numbers 3. exchange (first send, then receive) login names 4. exchange random numbers 5. calculate md5 checksum over the random numbers (received from other side) and the remote passwd. 6. exchange md5 checksums 7. get auth info from name (received from other side) for local login 8. calculate md5 checksum over the local random numbers and the local passwd. 9. check login -- compare the received md5sum (6.) with the generated one (8.); send acknowledgement 10. receive remote acknowledgement 11. return suitable values
|