Use specialized query exclusively to select authentication key

This commit is contained in:
Vincent Breitmoser
2018-10-01 21:36:01 +02:00
parent 5d28cef81a
commit 400db49e75
10 changed files with 104 additions and 84 deletions

View File

@@ -160,7 +160,7 @@ public class AuthenticationOperationTest {
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
long masterKeyId = mStaticRingRsa.getMasterKeyId();
Long authSubKeyId = keyRepository.getSecretAuthenticationId(masterKeyId);
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
{ // sign challenge
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
@@ -206,7 +206,7 @@ public class AuthenticationOperationTest {
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
long masterKeyId = mStaticRingEcDsa.getMasterKeyId();
Long authSubKeyId = keyRepository.getSecretAuthenticationId(masterKeyId);
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
{ // sign challenge
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
@@ -252,7 +252,7 @@ public class AuthenticationOperationTest {
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
long masterKeyId = mStaticRingEdDsa.getMasterKeyId();
Long authSubKeyId = keyRepository.getSecretAuthenticationId(masterKeyId);
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
{ // sign challenge
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
@@ -300,7 +300,7 @@ public class AuthenticationOperationTest {
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
long masterKeyId = mStaticRingDsa.getMasterKeyId();
Long authSubKeyId = keyRepository.getSecretAuthenticationId(masterKeyId);
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
{ // sign challenge
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,
@@ -345,7 +345,7 @@ public class AuthenticationOperationTest {
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
long masterKeyId = mStaticRingEcDsa.getMasterKeyId();
Long authSubKeyId = keyRepository.getSecretAuthenticationId(masterKeyId);
Long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
{ // sign challenge - should succeed with selected key allowed
AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application,

View File

@@ -76,7 +76,7 @@ public class SshPublicKeyTest {
KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application);
long masterKeyId = mStaticRingEcDsa.getMasterKeyId();
long authSubKeyId = keyRepository.getSecretAuthenticationId(masterKeyId);
long authSubKeyId = keyRepository.getEffectiveAuthenticationKeyId(masterKeyId);
CanonicalizedPublicKey canonicalizedPublicKey = keyRepository.getCanonicalizedPublicKeyRing(masterKeyId)
.getPublicKey(authSubKeyId);