Added support for MAC methods: hmac-md5 and hmac-md5-96

key_len should not have been in KEX_METHOD,
it's dependent on MAC method, not KEX method.

This is why the MD5 MACs were borked initially,
md5 has a key_len of 16, not 20.
This commit is contained in:
Sara Golemon
2004-12-31 00:55:52 +00:00
parent 4324a1a1d1
commit c006dd4350
4 changed files with 27 additions and 25 deletions

View File

@@ -234,9 +234,6 @@ struct _LIBSSH2_SESSION {
struct _LIBSSH2_KEX_METHOD {
char *name;
/* integrity key length */
unsigned long key_len;
/* Key exchange, populates session->* and returns 0 on success, non-0 on error */
int (*exchange_keys)(LIBSSH2_SESSION *session);
@@ -293,6 +290,9 @@ struct _LIBSSH2_MAC_METHOD {
/* The length of a given MAC packet */
int mac_len;
/* integrity key length */
int key_len;
/* Message Authentication Code Hashing algo */
int (*init)(LIBSSH2_SESSION *session, unsigned char *key, int *free_key, void **abstract);
int (*hash)(LIBSSH2_SESSION *session, unsigned char *buf, unsigned long seqno, const unsigned char *packet, unsigned long packet_len, const unsigned char *addtl, unsigned long addtl_len, void **abstract);