mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-04 16:25:05 -05:00
Prevent multiple cloud-trust-search launches. Handle DNS query failure gracefully. Fixes #1007 & #1008.
This commit is contained in:
parent
0f59e6bd95
commit
b5cdeb7f5a
@ -85,6 +85,7 @@ import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import de.measite.minidns.Client;
|
||||
import de.measite.minidns.DNSMessage;
|
||||
import de.measite.minidns.Question;
|
||||
import de.measite.minidns.Record;
|
||||
import de.measite.minidns.record.Data;
|
||||
@ -330,7 +331,12 @@ public class KeychainIntentService extends IntentService implements Progressable
|
||||
|
||||
String domain = prover.dnsTxtCheckRequired();
|
||||
if (domain != null) {
|
||||
Record[] records = new Client().query(new Question(domain, Record.TYPE.TXT)).getAnswers();
|
||||
DNSMessage dnsQuery = new Client().query(new Question(domain, Record.TYPE.TXT));
|
||||
if (dnsQuery == null) {
|
||||
sendProofError(prover.getLog(), getString(R.string.keybase_dns_query_failure));
|
||||
return;
|
||||
}
|
||||
Record[] records = dnsQuery.getAnswers();
|
||||
List<List<byte[]>> extents = new ArrayList<List<byte[]>>();
|
||||
for (Record r : records) {
|
||||
Data d = r.getPayload();
|
||||
|
@ -190,6 +190,7 @@ public class ViewKeyTrustFragment extends LoaderFragment implements
|
||||
mStartSearch.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
mStartSearch.setEnabled(false);
|
||||
new DescribeKey().execute(fingerprint);
|
||||
}
|
||||
});
|
||||
|
@ -561,6 +561,7 @@
|
||||
<string name="keybase_proof_failure">"Unfortunately this proof cannot be verified."</string>
|
||||
<string name="keybase_unknown_proof_failure">"Unrecognized problem with proof checker"</string>
|
||||
<string name="keybase_problem_fetching_evidence">"Problem with proof evidence"</string>
|
||||
<string name="keybase_dns_query_failure">"DNS TXT Record retrieval failed"</string>
|
||||
<string name="keybase_no_prover_found">"No proof checker found for"</string>
|
||||
<string name="keybase_message_payload_mismatch">"Decrypted proof post does not match expected value"</string>
|
||||
<string name="keybase_message_fetching_data">"Fetching proof evidence"</string>
|
||||
|
Loading…
Reference in New Issue
Block a user