GpgKeys: Remove redundant validity check of the ID string

The same check is performed in parseFingerprint.

Change-Id: I87d085ab6fb56b76742368c4cabacc465634ccc3
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2018-01-02 14:07:57 +01:00
parent ed220866c9
commit 64ae623394

View File

@@ -91,11 +91,6 @@ public class GpgKeys implements ChildCollection<AccountResource, GpgKey> {
public GpgKey parse(AccountResource parent, IdString id)
throws ResourceNotFoundException, PGPException, OrmException, IOException {
checkVisible(self, parent);
String str = CharMatcher.whitespace().removeFrom(id.get()).toUpperCase();
if ((str.length() != 8 && str.length() != 40)
|| !CharMatcher.anyOf("0123456789ABCDEF").matchesAllOf(str)) {
throw new ResourceNotFoundException(id);
}
byte[] fp = parseFingerprint(id.get(), getGpgExtIds(parent));
try (PublicKeyStore store = storeProvider.get()) {