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

Add basic support for none cipher and MACs

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2020-04-28 11:04:59 +02:00
committed by Andreas Schneider
parent 46499b1b90
commit e6aee24a1e
9 changed files with 85 additions and 6 deletions

View File

@@ -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,