Skip to content

Commit 895331e

Browse files
committed
addressed comments
1 parent 2ffa9e8 commit 895331e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

common/src/main/java/com/microsoft/identity/common/internal/platform/AndroidDevicePopManager.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ private void initialize(@NonNull final Context context,
357357
final boolean enableImport,
358358
final boolean trySetAttestationChallenge) throws InvalidAlgorithmParameterException {
359359
final boolean unnecessaryCryptoPurposesDisabled =
360-
CommonFlightsManager.INSTANCE.getFlightsProvider().isFlightEnabled(CommonFlight.DISABLE_UNNECESSARY_CRYPTO_PURPOSES);
360+
CommonFlightsManager.INSTANCE.getFlightsProvider().isFlightEnabled(CommonFlight.DISABLE_UNNECESSARY_CRYPTO_PURPOSES_FROM_DEVICE_POP_MANAGER);
361361

362362
int purposes = KeyProperties.PURPOSE_SIGN | KeyProperties.PURPOSE_VERIFY;
363363
if (!unnecessaryCryptoPurposesDisabled) {
@@ -383,7 +383,8 @@ private void initialize23(@androidx.annotation.NonNull final KeyPairGenerator ke
383383
final int keySize,
384384
final boolean useStrongbox,
385385
final boolean trySetAttestationChallenge,
386-
final int purposes) throws InvalidAlgorithmParameterException {
386+
final int purposes,
387+
final boolean unnecessaryCryptoPurposesDisabled) throws InvalidAlgorithmParameterException {
387388
KeyGenParameterSpec.Builder builder;
388389

389390
builder = new KeyGenParameterSpec.Builder(
@@ -399,6 +400,13 @@ private void initialize23(@androidx.annotation.NonNull final KeyPairGenerator ke
399400
KeyProperties.DIGEST_SHA256
400401
);
401402

403+
if (!unnecessaryCryptoPurposesDisabled) {
404+
builder.setEncryptionPaddings(
405+
KeyProperties.ENCRYPTION_PADDING_RSA_OAEP,
406+
KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1
407+
);
408+
}
409+
402410
if (trySetAttestationChallenge && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
403411
builder = setAttestationChallenge(builder);
404412
}

0 commit comments

Comments
 (0)