Make sure auth key selection dialog lists only keys with auth subkey available.
Presently the dialog lists all master keys, and keys without auth subkeys are not marked in any way. Sleecting one of those via SSH authentication API will result in cryptic "Could not create description: null" message.
This commit is contained in:
@@ -164,6 +164,11 @@ public class KeyRepository extends AbstractDao {
|
||||
return mapAllRows(query, SubKey.UNIFIED_KEY_INFO_MAPPER);
|
||||
}
|
||||
|
||||
public List<UnifiedKeyInfo> getAllUnifiedKeyInfoWithAuthKeySecret() {
|
||||
SqlDelightQuery query = SubKey.FACTORY.selectAllUnifiedKeyInfoWithAuthKeySecret();
|
||||
return mapAllRows(query, SubKey.UNIFIED_KEY_INFO_MAPPER);
|
||||
}
|
||||
|
||||
public List<UserId> getUserIds(long... masterKeyIds) {
|
||||
SqlDelightQuery query = UserPacket.FACTORY.selectUserIdsByMasterKeyId(masterKeyIds);
|
||||
return mapAllRows(query, UserPacket.USER_ID_MAPPER);
|
||||
|
||||
@@ -104,7 +104,7 @@ public class RemoteSelectAuthenticationKeyActivity extends FragmentActivity {
|
||||
if (keyInfoLiveData == null) {
|
||||
keyInfoLiveData = new GenericLiveData<>(context, () -> {
|
||||
KeyRepository keyRepository = KeyRepository.create(context);
|
||||
return keyRepository.getAllUnifiedKeyInfoWithSecret();
|
||||
return keyRepository.getAllUnifiedKeyInfoWithAuthKeySecret();
|
||||
});
|
||||
}
|
||||
return keyInfoLiveData;
|
||||
|
||||
Reference in New Issue
Block a user