If a Cmp CertConf message received from a client contains only an altname, such as "dnsName: foo.bar.com" ejbca will give an exception.
16:52:52,146 ERROR [CmpMessageDispatcher] Exception during CMP processing:
> java.lang.IllegalArgumentException: unknown object in factory:
> at org.bouncycastle.asn1.x509.X509Name.getInstance(Unknown Source)
This happens when CmpConfirmResponseMessage.java tries to copy the recipient field to the sender field,
X509Name sender = X509Name.getInstance(getSender().getName());
a dnsName is fully valid asn.1, albeit a bit unexpected perhaps?
We can easily copy the whole GeneralName directly to sender and recipient fields, instead of making:
GeneralName -> X509Name -> GeneralName. This will avoid some code as well and make things more efficient (admittedly not very much though).