-
Notifications
You must be signed in to change notification settings - Fork 827
Android: Certificate enrollment fails permanently when CERT_INSTALL delegation is not yet available #43064
Copy link
Copy link
Open
Labels
#g-power-to-pcPower to the PC working groupPower to the PC working group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.Ready to write code. Scheduled in a release. See "Making changes" in handbook.bugSomething isn't working as documentedSomething isn't working as documented~released bugThis bug was found in a stable release.This bug was found in a stable release.
Milestone
Description
Android agent 1.3.0
Actual behavior
After a fresh MDM enrollment, the Android agent immediately attempts certificate enrollment. The AMAPI policy grants the app CERT_INSTALL delegated scope, but this delegation is applied asynchronously and may not be available by the time the app runs. When the app calls DevicePolicyManager.installKeyPair(null, ...) before the delegation is active, Android throws:
java.lang.SecurityException: Calling identity is not authorized
To fix
-
Gate the entire enrollment flow on delegation availability.
-
Add a defensive delegation check in
AndroidCertificateInstaller. -
Improve failure messages.
Steps to reproduce
These steps:
- Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
- Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
- Set up a certificate template.
- Enroll a new Android device using manual enrollment.
- Wait for cert to be requested (you may see this error in the app)
- If not, try unenrolling, restarting device, and enrolling again. (Make sure your CA allows certs with the same CN. Maybe:
scepserver -depot depot -port 8088 -challenge=bozo --allowrenew 0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
#g-power-to-pcPower to the PC working groupPower to the PC working group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.Ready to write code. Scheduled in a release. See "Making changes" in handbook.bugSomething isn't working as documentedSomething isn't working as documented~released bugThis bug was found in a stable release.This bug was found in a stable release.
Type
Projects
Status
🐥 Ready for review