aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-02-09 22:29:43 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2010-02-09 22:43:27 +0100
commit028516ba6a26b2f8e885e7e2cd6b27854b8ba2a5 (patch)
tree7964f11a308be8be1d18c4c212e3cc600f2b0eee
parent344b27ac6ca948af889ac2858ca986dd4855af1d (diff)
downloadlibssh-028516ba6a26b2f8e885e7e2cd6b27854b8ba2a5.tar.gz
libssh-028516ba6a26b2f8e885e7e2cd6b27854b8ba2a5.tar.xz
libssh-028516ba6a26b2f8e885e7e2cd6b27854b8ba2a5.zip
aes192-ctr and aes256-ctr working on libcrypto
-rw-r--r--libssh/kex.c2
-rw-r--r--libssh/wrapper.c25
2 files changed, 25 insertions, 2 deletions
diff --git a/libssh/kex.c b/libssh/kex.c
index 135e1bbc..376ea8b8 100644
--- a/libssh/kex.c
+++ b/libssh/kex.c
@@ -52,7 +52,7 @@
#define BLOWFISH ""
#endif
#ifdef HAVE_OPENSSL_AES_H
-#define AES "aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,"
+#define AES "aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,"
#else
#define AES ""
#endif
diff --git a/libssh/wrapper.c b/libssh/wrapper.c
index b7de1532..bc0b6888 100644
--- a/libssh/wrapper.c
+++ b/libssh/wrapper.c
@@ -572,7 +572,8 @@ static void aes_decrypt(struct crypto_struct *cipher, void *in, void *out,
}
/** @internal
- * @brief encrypts/decrypts data with stream cipher AES128_ctr
+ * @brief encrypts/decrypts data with stream cipher AES_ctr128. 128 bits is actually
+ * the size of the CTR counter and incidentally the blocksize, but not the keysize.
* @param len[in] must be a multiple of AES128 block size.
*/
static void aes_ctr128_encrypt(struct crypto_struct *cipher, void *in, void *out,
@@ -690,6 +691,28 @@ static struct crypto_struct ssh_ciphertab[] = {
aes_ctr128_encrypt
},
{
+ "aes192-ctr",
+ 16,
+ sizeof(AES_KEY),
+ NULL,
+ 192,
+ aes_set_encrypt_key,
+ aes_set_encrypt_key,
+ aes_ctr128_encrypt,
+ aes_ctr128_encrypt
+ },
+ {
+ "aes256-ctr",
+ 16,
+ sizeof(AES_KEY),
+ NULL,
+ 256,
+ aes_set_encrypt_key,
+ aes_set_encrypt_key,
+ aes_ctr128_encrypt,
+ aes_ctr128_encrypt
+ },
+ {
"aes128-cbc",
16,
sizeof(AES_KEY),