pki: Fix possible information leak via uninitialized stack buffer

Fixes T190

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 178b53f924)
This commit is contained in:
Andreas Schneider
2019-10-31 10:20:00 +01:00
parent 8f20ece14f
commit 8600015b3e

View File

@@ -440,9 +440,9 @@ static int pki_private_key_encrypt(ssh_buffer privkey_buffer,
{
struct ssh_cipher_struct *ciphers = ssh_get_ciphertab();
struct ssh_cipher_struct cipher;
uint8_t key_material[128];
uint8_t key_material[128] = {0};
size_t key_material_len;
char passphrase_buffer[128];
char passphrase_buffer[128] = {0};
int rc;
int i;
int cmp;