Page MenuHomePhabricator

SecurePoll: Tallying error messages incorrectly encoded
Open, Needs TriagePublicBUG REPORT

Description

What is the problem?

Tallying an election with an incorrect GPG key, the tally page shows the error:

Tally failed with error: <p>Error executing GPG: </p><p>Command: &#35;Command: &#39;gpg&#39; &#39;--homedir&#39; &#39;/tmp/securepoll-f190c83603a50eda28efaef11ff7961293bcb576&#39; &#39;--trust-model&#39; &#39;always&#39; &#39;--batch&#39; &#39;--yes&#39; &#39;--decrypt&#39; &#39;-o&#39; &#39;/tmp/securepoll-f190c83603a50eda28efaef11ff7961293bcb576/output&#39; &#39;/tmp/securepoll-f190c83603a50eda28efaef11ff7961293bcb576/input&#39; </p><p>Error: </p> <pre>gpg: encrypted with 3072-bit RSA key, ID 2E9A37F36165E557, created 2021-01-29 &#32; &#34;docker_encrypt&#34; gpg: decryption failed: No secret key </pre>

In the database, the error message is recorded as:

<p>Error executing GPG:
</p><p>Command: &#35;Command: &#39;gpg&#39; &#39;--homedir&#39; &#39;/tmp/securepoll-f190c83603a50eda28efaef11ff7961293bcb576&#39; &#39;--trust-model&#39; &#39;always&#39; &#39;--batch&#39; &#39;--yes&#39; &#39;--decrypt&#39; &#39;-o&#39; &#39;/tmp/securepoll-f190c83603a50eda28efaef11ff7961293bcb576/output&#39; &#39;/tmp/securepoll-f190c83603a50eda28efaef11ff7961293bcb576/input&#39;
</p><p>Error:
</p>
<pre>gpg: encrypted with 3072-bit RSA key, ID 2E9A37F36165E557, created 2021-01-29
&#32;     &#34;docker_encrypt&#34;
gpg: decryption failed: No secret key
</pre>

I guess we need to make it so that &#39 displays as '.

I haven't tried any other errors, so I don't know if this is a problem specific to that error or more general.

This is on my local docker install which runs SQLite, if that makes a difference.

Steps to reproduce problem
  1. For a wiki with $wgSecurePollShowErrorDetail = true;
  2. Tally an encrypted election using the wrong GPG key
  3. Refresh the page to see the error
Environment

Wiki(s): local docker (sqlite) SecurePoll 2.0.0 (ed8bc5e) 06:37, 29 March 2021.

Screenshots (if applicable):

error_tally_invalid_gpg.png (1,717×552 px, 92 KB)

Event Timeline

That is one ugly message. I think it would be nicer ot just tell the user that the GPG key was incorrect. @Tchanders would that be feasible?

That is one ugly message. I think it would be nicer ot just tell the user that the GPG key was incorrect. @Tchanders would that be feasible?

I think, because this message only appears when $wgSecurePollShowErrorDetail is true, we probably do want to show the full error message, so that it can be used for debugging.

When $wgSecurePollShowErrorDetail is false (which it is on beta and probably production) the error message is: Tally failed with error: Error executing GPG. Use $wgSecurePollShowErrorDetail=true; in LocalSettings.php to show more detail.

@dom_walden That makes sense - thanks for explaining.