-
Notifications
You must be signed in to change notification settings - Fork 46
Fix for SDL violation in device pop scenarios #2744
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
base: dev
Are you sure you want to change the base?
Conversation
|
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
|
✅ Work item link check complete. Description contains link AB#3284510 to an Azure Boards work item. |
common4j/src/main/com/microsoft/identity/common/java/platform/AbstractDevicePopManager.java
Show resolved
Hide resolved
|
Is this needed if purpose does not have encrypt/decrypt/wrap? If not, then this method is identical to initialize23, since caller decides if wrap key is to be set or not. Refers to: common/src/main/java/com/microsoft/identity/common/internal/platform/AndroidDevicePopManager.java:470 in 42bf650. [](commit_id = 42bf650, deletion_comment = True) |
If you meant the encryption padding, then yes it is not needed when purpose is not encrypt/decrypt/wrap. I have skipped adding this padding when the flight is ON in 5c852db . Once the flight is completely ON, we can remove initialize23 and initalize28 and just add a check for Build version to use strongbox in API >=28. |
...n/src/main/java/com/microsoft/identity/common/internal/platform/AndroidDevicePopManager.java
Show resolved
Hide resolved
common4j/src/main/com/microsoft/identity/common/java/flighting/CommonFlight.java
Outdated
Show resolved
Hide resolved
1c62817 to
dca128e
Compare
...n/src/main/java/com/microsoft/identity/common/internal/platform/AndroidDevicePopManager.java
Outdated
Show resolved
Hide resolved
1738709 to
76549a8
Compare
|
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
| final boolean unnecessaryCryptoPurposesDisabled = | ||
| CommonFlightsManager.INSTANCE.getFlightsProvider().isFlightEnabled(CommonFlight.DISABLE_UNNECESSARY_CRYPTO_PURPOSES_FROM_DEVICE_POP_MANAGER); | ||
|
|
||
| int purposes = KeyProperties.PURPOSE_SIGN | KeyProperties.PURPOSE_VERIFY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Consider moving the definition of purposes inside each initializeX method — I believe it makes things a little easier to read.
| final boolean enableImport, | ||
| final boolean trySetAttestationChallenge) throws InvalidAlgorithmParameterException { | ||
| final boolean unnecessaryCryptoPurposesDisabled = | ||
| CommonFlightsManager.INSTANCE.getFlightsProvider().isFlightEnabled(CommonFlight.DISABLE_UNNECESSARY_CRYPTO_PURPOSES_FROM_DEVICE_POP_MANAGER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ask copilot for a better name :p
| /** | ||
| * Flight to disable the unnecessary crypto operation purposes in device pop manager like encrypt, decrypt and wrap. | ||
| */ | ||
| DISABLE_UNNECESSARY_CRYPTO_PURPOSES_FROM_DEVICE_POP_MANAGER ("DisableUnnecessaryCryptoPurposes", false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sets it to null. Do we really need this method? if we delete this method, initialize23 and initialize28 can be simplified. initialize23() also does not need to worry about Strongbox. If strong box is needed call initialize28 Refers to: common/src/main/java/com/microsoft/identity/common/internal/platform/AndroidDevicePopManager.java:424 in 9691151. [](commit_id = 9691151, deletion_comment = False) |
mohitc1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
Note : The flight to remove encryption paddings in initialize method of AndroidDevicePopManager is not going to be enabled until we observe telemetry added in this PR first. Idea is that the telemetry should prove that encrypt/decrypt methods are not getting used. Only then, we can enable the flight! So, this is going to be enabled in Jan/Feb next year.