mirror of
https://0xacab.org/liberate/trees.git
synced 2024-11-22 02:00:36 +01:00
Pass a NULL pointer if no private key set
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
This commit is contained in:
parent
47eded2b2b
commit
7ae2ab49ba
@ -329,6 +329,7 @@ scrambler_mailbox_allocated(struct mailbox *box)
|
||||
static int
|
||||
scrambler_istream_opened(struct mail *_mail, struct istream **stream)
|
||||
{
|
||||
unsigned char *private_key = NULL;
|
||||
struct mail_private *mail = (struct mail_private *)_mail;
|
||||
struct mail_user *user = _mail->box->storage->user;
|
||||
struct scrambler_user *suser = SCRAMBLER_USER_CONTEXT(user);
|
||||
@ -336,8 +337,11 @@ scrambler_istream_opened(struct mail *_mail, struct istream **stream)
|
||||
struct istream *input;
|
||||
|
||||
input = *stream;
|
||||
if (suser->private_key_set) {
|
||||
private_key = suser->private_key;
|
||||
}
|
||||
*stream = scrambler_istream_create(input, suser->public_key,
|
||||
suser->private_key);
|
||||
private_key);
|
||||
i_stream_unref(&input);
|
||||
|
||||
return mmail->super.istream_opened(_mail, stream);
|
||||
|
Loading…
Reference in New Issue
Block a user