1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-12 15:41:16 +03:00

libmbedtls: Support OpenSSH-compatible AES-GCM ciphers using mbedTLS

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2018-10-04 15:21:36 +02:00
committed by Andreas Schneider
parent a2120e168b
commit 72bd2fe197
6 changed files with 188 additions and 14 deletions

View File

@@ -31,6 +31,7 @@
#include "libssh/crypto.h"
#include "libssh/wrapper.h"
#include "libssh/string.h"
#include "libssh/misc.h"
#ifdef HAVE_LIBGCRYPT
#include <gcrypt.h>
@@ -429,19 +430,6 @@ aes_aead_get_length(struct ssh_cipher_struct *cipher,
return SSH_OK;
}
/* Increment 64b integer in network byte order */
static void
uint64_inc(unsigned char *counter)
{
int i;
for (i = 7; i >= 0; i--) {
counter[i]++;
if (counter[i])
return;
}
}
static void
aes_gcm_encrypt(struct ssh_cipher_struct *cipher,
void *in,