Skip to content

Commit

Permalink
mail-crypt: Fix key generation handling
Browse files Browse the repository at this point in the history
Userkey generation would not set all required fields.
  • Loading branch information
cmouse committed Oct 10, 2017
1 parent d5488dc commit 424deab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/mail-crypt/doveadm-mail-crypt.c
Expand Up @@ -329,9 +329,11 @@ static int mcp_keypair_generate_run(struct doveadm_mail_cmd_context *_ctx,
if (mail_crypt_user_generate_keypair(user, &pair, &pubid,
&error) < 0) {
res->success = FALSE;
res->id = p_strdup(_ctx->pool, error);
res->error = p_strdup(_ctx->pool, error);
return -1;
}
res->success = TRUE;
res->id = p_strdup(_ctx->pool, pubid);
user_key = pair.pub;
dcrypt_key_unref_private(&pair.priv);
}
Expand Down Expand Up @@ -419,6 +421,7 @@ static int cmd_mcp_keypair_generate_run(struct doveadm_mail_cmd_context *_ctx,
if (res->success)
doveadm_print("\xE2\x9C\x93");
else {
_ctx->exit_code = EX_DATAERR;
ret = -1;
doveadm_print("x");
}
Expand Down

0 comments on commit 424deab

Please sign in to comment.