Only look at primary key for expiry/revocation

This commit is contained in:
Vincent Breitmoser
2018-01-15 17:01:03 +01:00
parent 7c1fe18b2c
commit fe00c6727a

View File

@@ -754,16 +754,18 @@ public class KeychainProvider extends ContentProvider {
qb.setTables(Tables.API_AUTOCRYPT_PEERS + qb.setTables(Tables.API_AUTOCRYPT_PEERS +
" LEFT JOIN " + Tables.KEYS + " AS ac_key" + " LEFT JOIN " + Tables.KEYS + " AS ac_key" +
" ON (ac_key." + Keys.MASTER_KEY_ID + " = " + Tables.API_AUTOCRYPT_PEERS + "." + ApiAutocryptPeer.MASTER_KEY_ID + ")" + " ON (ac_key." + Keys.MASTER_KEY_ID + " = " + Tables.API_AUTOCRYPT_PEERS + "." + ApiAutocryptPeer.MASTER_KEY_ID +
" AND ac_key." + Keys.RANK + " = 0)" +
" LEFT JOIN " + Tables.KEYS + " AS gossip_key" + " LEFT JOIN " + Tables.KEYS + " AS gossip_key" +
" ON (gossip_key." + Keys.MASTER_KEY_ID + " = " + ApiAutocryptPeer.GOSSIP_MASTER_KEY_ID + ")" " ON (gossip_key." + Keys.MASTER_KEY_ID + " = " + ApiAutocryptPeer.GOSSIP_MASTER_KEY_ID +
" AND gossip_key." + Keys.RANK + " = 0)"
); );
if (match == AUTOCRYPT_PEERS_BY_MASTER_KEY_ID) { if (match == AUTOCRYPT_PEERS_BY_MASTER_KEY_ID) {
long masterKeyId = Long.parseLong(uri.getLastPathSegment()); long masterKeyId = Long.parseLong(uri.getLastPathSegment());
selection = Tables.API_AUTOCRYPT_PEERS + "." + ApiAutocryptPeer.MASTER_KEY_ID + " = ?"; qb.appendWhere(Tables.API_AUTOCRYPT_PEERS + "." + ApiAutocryptPeer.MASTER_KEY_ID + " = ");
selectionArgs = new String[] { Long.toString(masterKeyId) }; qb.appendWhere(Long.toString(masterKeyId));
} else if (match == AUTOCRYPT_PEERS_BY_PACKAGE_NAME) { } else if (match == AUTOCRYPT_PEERS_BY_PACKAGE_NAME) {
String packageName = uri.getPathSegments().get(2); String packageName = uri.getPathSegments().get(2);