-
Notifications
You must be signed in to change notification settings - Fork 11
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
verifySignatureAtTime does not use currentTime #21
Comments
Did a quick skim, but will need a bit more time to check the different code paths. |
@ch-v2s curious, have you noticed this behavior with specific device OSes? I.e. iOS vs. macOS? |
@jessepeterson indeed! But I figured only just now. Looking further, it seems that only the tvOS is sending a timestamp within the Mdm-Signature Payload? They do have different User-Agent Data: |
@ch-v2s Ahh, interesting; thanks for that! I was wondering why I wasn't able to duplicate this on macOS. |
Hey @ch-v2s, the The So, if you're seeing failures like |
@hslatman thanks for looking into this and for clarification. However, the fact that tvOS is signing its attributes and macOS doesn't ist still irritating :) |
I think part of this issue is that we'd like to see an ability to specify a skew, even for this signing time vs. certificate validity (or disable that altogether and pretend the signing time attribute isn't there). One way to at least address this would be implement a custom error that we can catch and handle (with e.g. validity and sign-time attributes we can decide on ourselves, perhaps) rather than being a generic "hard" error. I think the underlying problem, for MDM enrollment anyway, is that the device's time may be wrong — but the certificate itself is fine (because it was issued from a SCEP server with correct time). So the sign time attribute does not fall within the validity of the certificate. And when an Apple device fails to enroll due to a SCEP error it is very opaque to the end-user and troublesome to find the cause. So, perhaps with an ability to allow some skew for this as well as catch and handle this specific error we may be able to strategize better ways of informing the user in a nicer way. cc @korylprince |
Yes, totally agree, @jessepeterson 🙂 A typed error sounds like a good approach to me for this case. Entirely disabling the time check (conditionally) is the simplest for the user, but that would be a slightly different pattern than being able to provide a time for this check (as is the case for the certificate chain validity check). I think the combination of a typed error, with a clear error message, and being able to provide a time, is a good compromise over entirely disabling the check. |
friendly ping @hslatman :) |
@jessepeterson, @ch-v2s I've just merged #25. I'll follow up with a test for the new error "behavior". Edit: PR with a new test case: #26 |
Closing this issue now as completed. With @jessepeterson's change it's now possible to handle this specific error case in relying code in an application-specific manner using e.g. |
I was wondering, why is the verifySignatureAtTime function not using the supplied 'currentTime' parameter to check the validity of the signature header?
My understanding was that this function was introduced to handle a certain clock skew. But it seems like it is taking a new timestamp 'signingTime' each time and check it against the notBefore/notAfter.
I have this issue when fiddling around with the "-device-signature-skew " parameter in micromdm.
-cheers
The text was updated successfully, but these errors were encountered: