summaryrefslogtreecommitdiffstats
path: root/include/libssh
diff options
context:
space:
mode:
Diffstat (limited to 'include/libssh')
-rw-r--r--include/libssh/crypto.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h
index 61a2b27b..2e866467 100644
--- a/include/libssh/crypto.h
+++ b/include/libssh/crypto.h
@@ -59,6 +59,20 @@ enum ssh_key_exchange_e {
SSH_KEX_CURVE25519_SHA256_LIBSSH_ORG
};
+enum ssh_cipher_e {
+ SSH_CIPHER_NONE=0,
+ SSH_BLOWFISH_CBC,
+ SSH_3DES_CBC,
+ SSH_3DES_CBC_SSH1,
+ SSH_DES_CBC_SSH1,
+ SSH_AES128_CBC,
+ SSH_AES192_CBC,
+ SSH_AES256_CBC,
+ SSH_AES128_CTR,
+ SSH_AES192_CTR,
+ SSH_AES256_CTR
+};
+
struct ssh_crypto_struct {
bignum e,f,x,k,y;
#ifdef HAVE_ECDH
@@ -104,12 +118,14 @@ struct ssh_crypto_struct {
struct ssh_cipher_struct {
const char *name; /* ssh name of the algorithm */
unsigned int blocksize; /* blocksize of the algo */
- unsigned int keylen; /* length of the key structure */
+ enum ssh_cipher_e ciphertype;
#ifdef HAVE_LIBGCRYPT
+ size_t keylen; /* length of the key structure */
gcry_cipher_hd_t *key;
#elif defined HAVE_LIBCRYPTO
- void *key; /* a key buffer allocated for the algo */
- void *IV;
+ struct ssh_3des_key_schedule *des3_key;
+ const EVP_CIPHER *cipher;
+ EVP_CIPHER_CTX ctx;
#endif
unsigned int keysize; /* bytes of key used. != keylen */
/* sets the new key for immediate use */
@@ -119,6 +135,7 @@ struct ssh_cipher_struct {
unsigned long len);
void (*decrypt)(struct ssh_cipher_struct *cipher, void *in, void *out,
unsigned long len);
+ void (*cleanup)(struct ssh_cipher_struct *cipher);
};
/* vim: set ts=2 sw=2 et cindent: */