diff options
author | Jakub Jelen <jjelen@redhat.com> | 2018-10-04 15:21:36 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-10-09 13:05:38 +0200 |
commit | 72bd2fe1972673ca173cba635472d6e7ad5783d1 (patch) | |
tree | 2638bdacd54eab4db36b38ccb2004e1e8792b905 /include/libssh/crypto.h | |
parent | a2120e168b70218a82617b630e2030ff126a21ec (diff) | |
download | libssh-72bd2fe1972673ca173cba635472d6e7ad5783d1.tar.gz libssh-72bd2fe1972673ca173cba635472d6e7ad5783d1.tar.xz libssh-72bd2fe1972673ca173cba635472d6e7ad5783d1.zip |
libmbedtls: Support OpenSSH-compatible AES-GCM ciphers using mbedTLS
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh/crypto.h')
-rw-r--r-- | include/libssh/crypto.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h index 8777f0c9..9eea580b 100644 --- a/include/libssh/crypto.h +++ b/include/libssh/crypto.h @@ -29,6 +29,8 @@ #ifdef HAVE_LIBGCRYPT #include <gcrypt.h> +#elif defined(HAVE_LIBMBEDCRYPTO) +#include <mbedtls/gcm.h> #endif #include "libssh/wrapper.h" @@ -152,6 +154,10 @@ struct ssh_cipher_struct { mbedtls_cipher_context_t encrypt_ctx; mbedtls_cipher_context_t decrypt_ctx; mbedtls_cipher_type_t type; +#ifdef MBEDTLS_GCM_C + mbedtls_gcm_context gcm_ctx; + unsigned char last_iv[AES_GCM_IVLEN]; +#endif /* MBEDTLS_GCM_C */ #endif struct chacha20_poly1305_keysched *chacha20_schedule; unsigned int keysize; /* bytes of key used. != keylen */ |