1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

libcrypto: Implement OpenSSH-compatible AES-GCM ciphers using OpenSSL

The commit also propares the internals throughout the code base
for the inclusion of a new AEAD cipher, because previously, the
source code counted only with chacha20-poly1305 cipher, which
is very specific in many cases.

The SSH_HMAC_AEAD_GCM mac algorithm is not actually used, but the name
needed to be defined so we can match in the algorithms selection per
OpenSSH specification (MACs are ignored in case GCM is select as a cipher [1]).

If the provided OpenSSL does not provide  EVP_aes_128_gcm()  function,
the AES-GCM ciphers will not be compiled in.

[1] https://cvsweb.openbsd.org/src/usr.bin/ssh/PROTOCOL.chacha20poly1305?annotate=HEAD

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2018-10-08 13:24:49 +02:00
committed by Andreas Schneider
parent 777786d76c
commit 46090facba
9 changed files with 297 additions and 10 deletions

View File

@@ -198,8 +198,9 @@ int ssh_packet_hmac_verify(ssh_session session,
unsigned int len;
uint32_t seq;
/* AEAD type have no mac checking */
if (type == SSH_HMAC_AEAD_POLY1305) {
/* AEAD types have no mac checking */
if (type == SSH_HMAC_AEAD_POLY1305 ||
type == SSH_HMAC_AEAD_GCM) {
return SSH_OK;
}