Repository navigation
Conversation
From Bouncy Castle 1.85, X500NameBuilder.addRDN(BCStyle.CN, String) refuses a common name longer than 64 characters, the RFC 5280 upper bound. Openfire uses its XMPP domain name as the common name of its self-signed certificates, and a domain name can be longer, so after the upgrade in OF-3483 such a server would start without a certificate, and updating the issuer details would fail. The common name is now added as an encoded value (DERUTF8String), which Bouncy Castle does not length-check. The encoding is the same as before, so certificates are unchanged for every domain name. Leaving the common name out is not an option: a self-signed certificate's issuer equals its subject, and Bouncy Castle 1.85 also refuses an empty issuer. If a later release refuses the encoded value too, writing the domain as domain components is the fallback; the new tests would fail on that version bump.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
From Bouncy Castle 1.85,
X500NameBuilder.addRDN(BCStyle.CN, String)refuses a common name longer than 64 characters (the RFC 5280 upper bound). Openfire uses its XMPP domain name as the common name of its self-signed certificates, and a domain name can be longer, so after the upgrade in OF-3483 (#3593, which describes the other effects of that upgrade and where Openfire uses Bouncy Castle) such a server would start without a certificate, and updating the issuer details from the Admin Console would fail.This change adds the common name as an encoded value (a
DERUTF8String), which Bouncy Castle does not length-check. The encoding is the same as before, so certificates are unchanged for every domain name. It works on 1.84 as well, so it can be merged before OF-3483.Alternatives considered:
DC=...) conforms to RFC 5280, but changes the certificate for these servers. It remains the fallback if a later Bouncy Castle also refuses the encoded value; the new tests would show that on the version bump that does it.New tests generate a self-signed certificate, and update the issuer of one, for a 65-character domain name, and check that the common name is the full domain name. On 1.87 they fail without this change and pass with it.
Where to direct review: whether keeping an over-long common name is acceptable, rather than one of the conforming alternatives. Since OF-3122, Openfire identifies peers by their Subject Alternative Names, not the common name.