PushCertificateChecker: Tweak some error messages

Don't wrap keys in parens, to avoid "))" at the end, as the
fingerprint is already in parens. Use "key ID" with lowercase "k".

Change-Id: Ied8787cb449cb7b044b49ac9035d0441eea3181b
This commit is contained in:
Dave Borowitz
2015-08-25 11:04:26 -04:00
parent 57d5186ab6
commit 102db5fcbd
2 changed files with 7 additions and 7 deletions

View File

@@ -140,9 +140,9 @@ public abstract class PushCertificateChecker {
if (result.isOk()) {
return;
}
StringBuilder err = new StringBuilder("Invalid public key (")
StringBuilder err = new StringBuilder("Invalid public key ")
.append(keyToString(k))
.append("):");
.append(":");
for (int i = 0; i < result.getProblems().size(); i++) {
err.append('\n').append(" ").append(result.getProblems().get(i));
}
@@ -150,13 +150,13 @@ public abstract class PushCertificateChecker {
return;
} catch (PGPException e) {
deferredProblems.add(
"Error checking signature with public key (" + keyToString(k)
"Error checking signature with public key " + keyToString(k)
+ ": " + e.getMessage());
}
}
if (!anyKeys) {
problems.add(
"No public keys found for Key ID " + keyIdToString(sig.getKeyID()));
"No public keys found for key ID " + keyIdToString(sig.getKeyID()));
} else {
problems.addAll(deferredProblems);
}

View File

@@ -96,7 +96,7 @@ public class PushCertificateCheckerTest {
TestKey key2 = TestKey.key2();
PushCertificate cert = newSignedCert(validNonce(), key2);
assertProblems(cert,
"No public keys found for Key ID " + keyIdToString(key2.getKeyId()));
"No public keys found for key ID " + keyIdToString(key2.getKeyId()));
}
@Test
@@ -104,8 +104,8 @@ public class PushCertificateCheckerTest {
TestKey key3 = TestKey.key3();
PushCertificate cert = newSignedCert(validNonce(), key3);
assertProblems(cert,
"Invalid public key (" + keyToString(key3.getPublicKey())
+ "):\n Key is expired");
"Invalid public key " + keyToString(key3.getPublicKey())
+ ":\n Key is expired");
}
private String validNonce() {