openscreenprotocol
openscreenprotocol copied to clipboard
Add an algorithm for setting the agent certificate serial number
This addresses Issue #276: Agent Certificate has a circular dependency on itself
We can't use the certificate fingerprint as the serial number, because the serial number is embedded in the certificate itself.
X.509 requires every certificate from the same issuer to have a unique (not necessarily consecutive) serial number.
This PR adds a simple algorithm to generate a unique per-agent serial number per certificate. Even if an agent generates a new certificate once per hour, the counter would take almost 500,000 years to overflow :-P
Feel free to review now in advance of TPAC.
baylesj@, do you mind taking a look?
PTAL @baylesj I suppose :)
Is the same comment not relevant to the Subject Name? It is defined as CN = <fp>._openscreen._udp.
The use of <fp> in the subject name is no issue? Is there a way to set this field after calculation of the fingerprint?
Is the same comment not relevant to the
Subject Name? It is defined asCN = <fp>._openscreen._udp.
Yes, that is also an issue, thank you for pointing that out. We won't be able to close Issue #276 until we address that.
PTAL @baylesj, I will have to come up with a separate proposal to fix the subject name.
Went ahead and merged this as comments have been addressed. Please let me know if there are other comments @baylesj