aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/crypto.h
diff options
context:
space:
mode:
authorDirkjan Bussink <d.bussink@gmail.com>2014-04-20 10:04:21 +0000
committerAndreas Schneider <asn@cryptomilk.org>2014-04-22 10:56:46 +0200
commit164b8e99cce70c83d2ef3e2c2b832a514a0ac908 (patch)
treed748e7afc7447354c9493bb7957f264d1140affa /include/libssh/crypto.h
parent4a089026647073be32ddb0885c12f47496bc709b (diff)
downloadlibssh-164b8e99cce70c83d2ef3e2c2b832a514a0ac908.tar.gz
libssh-164b8e99cce70c83d2ef3e2c2b832a514a0ac908.tar.xz
libssh-164b8e99cce70c83d2ef3e2c2b832a514a0ac908.zip
Add logic to support SHA2 HMAC algorithms
BUG: https://red.libssh.org/issues/91 Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh/crypto.h')
-rw-r--r--include/libssh/crypto.h6
1 files changed, 5 insertions, 1 deletions
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 */