Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for NIAPSEC updates #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

jmarkoff
Copy link
Collaborator

Added the ability to test devices without biometric hardware.

Copy link

@codingjeremy codingjeremy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor nits. Otherwise, LGTM.

@Override
public void onMessage(String message) {
showMessage(message);
}
};
dataManager = new EncryptionManager(getApplicationContext(), biometricSupport);
dataManager = new EncryptionManager(getApplicationContext(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move first arg to separate line to match other args.

@@ -147,7 +146,8 @@ private void createKeys(String fileName) {
asymmetricKeyPairAlias,
testDataString.getBytes(),
(byte[] encryptedData) -> {
SecureCipher secureCipher = SecureCipher.getDefault(biometricSupport);
SecureCipher secureCipher = SecureCipher.getDefault(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be one line? If not, leave as is.


public EncryptionManager(Context context, BiometricSupport biometricSupport) {
public EncryptionManager(Context context,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this to new line? Arguments below don't look like they follow right spacing?

.then(sdpFailureTestWorker)
.enqueue();
OneTimeWorkRequest sdpTestWorker;
if(useDeviceCredentialCheckBox.isChecked()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after if to follow guidelines


WorkContinuation workContinuation =
WorkManager.getInstance(getApplicationContext()).beginWith(sdpTestWorker);
if(testNoAuthCheckBox.isChecked()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after if to follow guidelines


@Override
public void onAuthenticationFailed() {
TestUtil.logFailure(getClass(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put argument one on new line

@Override
public void onAuthenticationSucceeded() {
TestUtil.logSuccess(getClass(), "SDP Device Credential Unlock " +
"Succeeded, private key available for decryption through the " +

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this indentation right? Makes it seems like an argument even though it is a continuation of argument 2... what happens on AS when you hit enter?

If that default, then ignore this comment.

public void onAuthenticationFailed() {
TestUtil.logFailure(getClass(),
"SDP Device Credential Unlock failed, " +
"file not available for decryption.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted earlier, just check indentation... ignore this comment if correct.

SecureConfig.getStrongDeviceCredentialConfig(biometricSupport);
secureConfig.setDebugLoggingEnabled(true);
SecureKeyGenerator keyGenerator = SecureKeyGenerator.getInstance(secureConfig);
TestUtil.logSuccess(getClass(), "Generated RSA with provider AndroidKeyStore.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put all arguments on new lines for better readability.

} else {
TestUtil.logFailure(getClass(), "Decryption failed");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this extra line.

@codingjeremy
Copy link

Hi Jon,

Let me know when you have a chance to address comments and I will look again. Looks like there are some other parts coming in for PR, but I don't think you want me to review yet.

I could be wrong. Let me know if I am. :D
-Jeremy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants