1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-03 22:13:11 +03:00

Support AES-Counter ciphers.

This commit is contained in:
Simon Josefsson
2009-11-16 16:04:00 +01:00
parent b78f854d8b
commit ebbd7c879b
7 changed files with 178 additions and 8 deletions

View File

@@ -544,8 +544,11 @@ _libssh2_cipher_init(_libssh2_cipher_ctx * h,
if (mode != GCRY_CIPHER_MODE_STREAM) {
int blklen = gcry_cipher_get_algo_blklen(cipher);
ret = gcry_cipher_setiv(*h, iv, blklen);
if (ret) {
if (mode == GCRY_CIPHER_MODE_CTR)
ret = gcry_cipher_setctr(*h, iv, blklen);
else
ret = gcry_cipher_setiv(*h, iv, blklen);
if (ret) {
gcry_cipher_close(*h);
return -1;
}