]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dcrypt: Add error handling for dcrypt_key_id_private
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 28 Nov 2016 13:20:01 +0000 (15:20 +0200)
committerGitLab <gitlab@git.dovecot.net>
Mon, 28 Nov 2016 16:24:22 +0000 (18:24 +0200)
src/lib-dcrypt/istream-decrypt.c

index 64d5d545954bcedc3a1a378b1cc9619ec097a448..69ca7663d74ec5060cd2eebc3390111b7e7f306b 100644 (file)
@@ -293,7 +293,13 @@ ssize_t i_stream_decrypt_key(struct decrypt_istream *stream, const char *malg, u
                        return -1;
                }
                buffer_create_from_data(&buf, dgst, sizeof(dgst));
-               dcrypt_key_id_private(stream->priv_key, "sha256", &buf, NULL);
+               if (!dcrypt_key_id_private(stream->priv_key, "sha256", &buf,
+                                          &error)) {
+                       io_stream_set_error(&stream->istream.iostream, "Decryption error: "
+                                                                      "dcrypt_key_id_private failed: %s",
+                                                                      error);
+                       return -1;
+               }
        }
 
        /* for each key */