diff options
author | Jakub Jelen <jjelen@redhat.com> | 2020-04-28 11:04:59 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2020-05-05 14:23:06 +0200 |
commit | e6aee24a1e3be68417e1ac4ab4a02c65bf9db637 (patch) | |
tree | 02ec3d0ee6fb0313ddc23410da2301098ab04b0e /src/libgcrypt.c | |
parent | 46499b1b9090b1e5d6a7d84998bc23ed71b3cf9c (diff) | |
download | libssh-e6aee24a1e3be68417e1ac4ab4a02c65bf9db637.tar.gz libssh-e6aee24a1e3be68417e1ac4ab4a02c65bf9db637.tar.xz libssh-e6aee24a1e3be68417e1ac4ab4a02c65bf9db637.zip |
Add basic support for none cipher and MACs
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/libgcrypt.c')
-rw-r--r-- | src/libgcrypt.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libgcrypt.c b/src/libgcrypt.c index 85d47c3f..2383ffa0 100644 --- a/src/libgcrypt.c +++ b/src/libgcrypt.c @@ -881,6 +881,17 @@ out: } #endif /* HAVE_GCRYPT_CHACHA_POLY */ +#ifdef WITH_INSECURE_NONE +static void +none_crypt(UNUSED_PARAM(struct ssh_cipher_struct *cipher), + void *in, + void *out, + size_t len) +{ + memcpy(out, in, len); +} +#endif /* WITH_INSECURE_NONE */ + /* the table of supported ciphers */ static struct ssh_cipher_struct ssh_ciphertab[] = { #ifdef WITH_BLOWFISH_CIPHER @@ -1020,6 +1031,15 @@ static struct ssh_cipher_struct ssh_ciphertab[] = { .name = "chacha20-poly1305@openssh.com" #endif }, +#ifdef WITH_INSECURE_NONE + { + .name = "none", + .blocksize = 8, + .keysize = 0, + .encrypt = none_crypt, + .decrypt = none_crypt + }, +#endif /* WITH_INSECURE_NONE */ { .name = NULL, .blocksize = 0, |