Merge pull request #2254 from hagau/export_pub_ssh_keys

Make predicate names in KeychainProvider consistent and allow export of SSH public keys without associated private key in keyring
This commit is contained in:
Dominik Schürmann
2018-01-22 12:44:13 +01:00
committed by GitHub
9 changed files with 48 additions and 20 deletions

View File

@@ -364,7 +364,7 @@ public class SshAuthenticationService extends Service {
throws PgpKeyNotFoundException, KeyRepository.NotFoundException {
KeyRepository keyRepository = KeyRepository.create(getApplicationContext());
long authSubKeyId = keyRepository.getCachedPublicKeyRing(masterKeyId)
.getSecretAuthenticationId();
.getAuthenticationId();
return keyRepository.getCanonicalizedPublicKeyRing(masterKeyId)
.getPublicKey(authSubKeyId);
}

View File

@@ -42,7 +42,7 @@ public class KeyLoader extends AsyncTaskLoader<List<KeyInfo>> {
KeyRings.MASTER_KEY_ID,
KeyRings.CREATION,
KeyRings.HAS_ENCRYPT,
KeyRings.HAS_AUTHENTICATE,
KeyRings.HAS_AUTHENTICATE_SECRET,
KeyRings.HAS_ANY_SECRET,
KeyRings.VERIFIED,
KeyRings.NAME,

View File

@@ -81,7 +81,7 @@ class RemoteSelectAuthenticationKeyPresenter implements LoaderCallbacks<List<Key
@Override
public Loader<List<KeyInfo>> onCreateLoader(int id, Bundle args) {
String selection = KeyRings.HAS_ANY_SECRET + " != 0 AND " + KeyRings.HAS_AUTHENTICATE + " != 0";
String selection = KeyRings.HAS_AUTHENTICATE_SECRET + " != 0";
KeySelector keySelector = KeySelector.create(
KeyRings.buildUnifiedKeyRingsUri(), selection);
return new KeyLoader(context, context.getContentResolver(), keySelector);