From 044a9304e3215c1933f6afde35aab594d8631639 Mon Sep 17 00:00:00 2001 From: Tim Kosse Date: Mon, 9 Apr 2018 09:38:52 +0200 Subject: [PATCH] Use aes256-ctr when exporting new-style OpenSSH keys. This mimics behavior of OpenSSH 7.6 or later. --- import.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/import.c b/import.c index ace5d860..a071e80f 100644 --- a/import.c +++ b/import.c @@ -1803,7 +1803,7 @@ int openssh_new_write(const Filename *filename, struct ssh2_userkey *key, unsigned char *q; for (i = 0; i < (int)sizeof(bcrypt_salt); i++) bcrypt_salt[i] = random_byte(); - p += put_string_z(p, "aes256-cbc"); + p += put_string_z(p, "aes256-ctr"); p += put_string_z(p, "bcrypt"); q = p; p += 4; @@ -1866,8 +1866,8 @@ int openssh_new_write(const Filename *filename, struct ssh2_userkey *key, ctx = aes_make_context(); aes256_key(ctx, keybuf); aes_iv(ctx, keybuf + 32); - aes_ssh2_encrypt_blk(ctx, private_section_start, - p - private_section_start); + aes_ssh2_sdctr(ctx, private_section_start, + p - private_section_start); aes_free_context(ctx); smemclr(keybuf, sizeof(keybuf));