]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dcrypt: dcrypt_keypair_generate() no longer assumes pair_r to be initialized.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 20 Jun 2016 08:33:47 +0000 (11:33 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 21 Jun 2016 16:33:59 +0000 (19:33 +0300)
It wasn't clear that it should have been zeroed. It also likely isn't very
useful to be able to place the generated key to existing keys.

src/lib-dcrypt/dcrypt.c

index a6845ad4e4567d8aa41a2199716e225d953b29e7..7592aa8a91f910202ce7124d2d3e9659e4332f12 100644 (file)
@@ -196,6 +196,7 @@ bool dcrypt_pbkdf2(const unsigned char *password, size_t password_len, const uns
 
 bool dcrypt_keypair_generate(struct dcrypt_keypair *pair_r, enum dcrypt_key_type kind, unsigned int bits, const char *curve, const char **error_r)
 {
+       memset(pair_r, 0, sizeof(*pair_r));
        return dcrypt_vfs->generate_keypair(pair_r, kind, bits, curve, error_r);
 }