Hi Scott, Comments inline.
On February 25, 2019 at 4:58:00 PM, Scott Rea via dev-security-policy ( dev-security-policy@lists.mozilla.org) wrote: G’day Corey, To follow up on this thread, we have confirmed with the developers of the platform that the approach used to include 64-bit output from a CSPRNG in the serialNumber is to generate the required output and then test it to see if it can be a valid serialNumber. If it is not a valid serialNumber, it is discarded, and new value is generated. This process is repeated until the first valid serialNumber is produced. This process ensures that 64 bits output from a CSPRNG is used to generate each serialNumber that gets used, and this is complaint with the BRS Section 7.1. This approach (assuming it is accurately described) discards exactly half of all values, thus halving the address space. That means there are 63-bits of entropy, so I do not agree that this process is compliant with the baseline requirements. More generally, RFC 5280 allows up to 20 octets in the serial number field so why are you choosing to issue on the lower bound? I will also point out that if the returned value is a valid as a serialNumber, it is further checked to see if that value has not been used before, since there is obviously a minimal chance of collision in any truly random process. In this case the serialNumber value will also be discarded and the process repeated. I don't believe all public CAs do collision detection because many have chosen to implement serial generation such that collision is highly improbable. For example, a CA may choose to generate a 160-bit value and clamp the high bit to zero. This provides 159-bits of entropy, with a collision probability of roughly 1 in 2 ** 79.5. Alternately, a CA might choose to issue with 80-bits of entropy concatenated with a 64-bit nanosecond time resolution timestamp. This provides 1 in 2 ** 40 collision probability for any given nanosecond. As a final example, Let's Encrypt's Boulder CA generates a 136-bit random value and prefixes it with an 8-bit instance ID: https://github.com/letsencrypt/boulder/blob/a9a0846ee92efa01ef6c6e107d2e69f4ddbea7c0/ca/ca.go#L511-L532 1 in 2 ** 79.5 is roughly as probable as a randomly generated number successfully passing typical Miller-Rabin primality testing while in reality being composite. This is not a risk we worry about when creating new root keys. I think it reasonable to expect that EVERY implementation of a compliant CA software is doing this post-processing to ensure the intended serialNumber has not already been used, and this is not something unique to EJBCA. As such, every CA out there will have some process that requires post-processing of whatever value is returned with a possibility to have to repeat the process if there is a collision. Regards, -- Scott Rea _______________________________________________ dev-security-policy mailing list dev-security-policy@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-security-policy