I'm trying to setup IPsec using x509 certificates on Linux. I'm using racoon for that task. I've come to the point where the authentication works fine if I keep every link of the certificate chain on every host. My goal is to authenticate each other knowing only the Root CA.
For example: for the hosts "Alice" and "Bob" the chain of certification looks like this
Root-CA -> MajorCA -> MinorCA -> (Alice/Bob)
Where Root-CA is self-signed and so on. Certificates that Alice knows are
Certificates that Bob knows are
Now everything works fine in this constellation. Alice sends
Hey, I'm Alice, and this is my certificate
to Bob and Bob can reconstruct the entire chain to
Root-CA -> MajorCA -> MinorCA -> "Alice"
What I'm trying to realize and I'm not sure if this is possible at all is to authenticate a host via the Root-CA, regardless of the rest of the chain, which has to be provided by the host itself. E.g.
Bob knows only the following certificates
and Alice authenticates herself to Bob by sending
Hey, I'm Alice, and this is my certificate chain
[Root-CA.crt] -> "MajorCA.crt -> MinorCA.crt -> Alice.crt"
either with or without the Root-CA certificate.
Now Bob should be able to reconstruct the chain to
Root-CA -> "MajorCA -> MinorCA -> Alice"
and therefore authenticate Alice.
I know that some CA certificates come as bundled PEM files and I know that it is possible to bundle the entire chain as PKCS12 file. But racoon does not support PKCS12 (or does it?) and it ignores additional certificates in a PEM bundle (and only takes the first one).
Now my question :-)
Does anyone know how to realize this (using racoon) and make the scenario work, or does anyone know that this will surely not work because of reasons they can explain?