From 164b8e99cce70c83d2ef3e2c2b832a514a0ac908 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Sun, 20 Apr 2014 10:04:21 +0000 Subject: Add logic to support SHA2 HMAC algorithms BUG: https://red.libssh.org/issues/91 Reviewed-by: Andreas Schneider --- include/libssh/crypto.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/libssh/crypto.h') diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h index eaff2ffd..56561805 100644 --- a/include/libssh/crypto.h +++ b/include/libssh/crypto.h @@ -46,6 +46,8 @@ #include "libssh/kex.h" #include "libssh/curve25519.h" +#define DIGEST_MAX_LEN 64 + enum ssh_key_exchange_e { /* diffie-hellman-group1-sha1 */ SSH_KEX_DH_GROUP1_SHA1=1, @@ -79,8 +81,10 @@ struct ssh_crypto_struct { unsigned char *encryptkey; unsigned char *encryptMAC; unsigned char *decryptMAC; - unsigned char hmacbuf[EVP_MAX_MD_SIZE]; + unsigned char hmacbuf[DIGEST_MAX_LEN]; struct ssh_cipher_struct *in_cipher, *out_cipher; /* the cipher structures/objects */ + enum ssh_hmac_e in_hmac, out_hmac; /* the MAC algorithms used */ + ssh_string server_pubkey; const char *server_pubkey_type; int do_compress_out; /* idem */ -- cgit