34 #include "libssh/wrapper.h"
43 struct ssh_crypto_struct {
45 unsigned char session_id[SHA_DIGEST_LEN];
47 unsigned char encryptIV[SHA_DIGEST_LEN*2];
48 unsigned char decryptIV[SHA_DIGEST_LEN*2];
50 unsigned char decryptkey[SHA_DIGEST_LEN*2];
51 unsigned char encryptkey[SHA_DIGEST_LEN*2];
53 unsigned char encryptMAC[SHA_DIGEST_LEN];
54 unsigned char decryptMAC[SHA_DIGEST_LEN];
55 unsigned char hmacbuf[EVP_MAX_MD_SIZE];
56 struct crypto_struct *in_cipher, *out_cipher;
57 ssh_string server_pubkey;
58 const char *server_pubkey_type;
61 int delayed_compress_in;
62 int delayed_compress_out;
63 void *compress_out_ctx;
64 void *compress_in_ctx;
67 struct crypto_struct {
69 unsigned int blocksize;
72 gcry_cipher_hd_t *key;
73 #elif defined HAVE_LIBCRYPTO
79 int (*set_encrypt_key)(
struct crypto_struct *cipher,
void *key,
void *IV);
80 int (*set_decrypt_key)(
struct crypto_struct *cipher,
void *key,
void *IV);
81 void (*cbc_encrypt)(
struct crypto_struct *cipher,
void *in,
void *out,
83 void (*cbc_decrypt)(
struct crypto_struct *cipher,
void *in,
void *out,
85 #elif defined HAVE_LIBCRYPTO
87 int (*set_encrypt_key)(
struct crypto_struct *cipher,
void *key);
88 int (*set_decrypt_key)(
struct crypto_struct *cipher,
void *key);
89 void (*cbc_encrypt)(
struct crypto_struct *cipher,
void *in,
void *out,
90 unsigned long len,
void *IV);
91 void (*cbc_decrypt)(
struct crypto_struct *cipher,
void *in,
void *out,
92 unsigned long len,
void *IV);