Allow more than one CERTREQ payload for IKEv2
authorTobias Brunner <tobias@strongswan.org>
Fri, 8 Feb 2013 10:24:39 +0000 (11:24 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 8 Feb 2013 10:28:56 +0000 (11:28 +0100)
There is no reason not to do so (RFC 5996 explicitly mentions multiple
CERTREQ payloads) and some implementations seem to use the same behavior
as had to be used with IKEv1 (i.e. each CA in its own CERTREQ payload).

src/libcharon/encoding/message.c

index 28fdda7..ca964d7 100644 (file)
@@ -151,7 +151,7 @@ static payload_rule_t ike_sa_init_r_rules[] = {
        {SECURITY_ASSOCIATION,                  1,      1,                                              FALSE,  FALSE},
        {KEY_EXCHANGE,                                  1,      1,                                              FALSE,  FALSE},
        {NONCE,                                                 1,      1,                                              FALSE,  FALSE},
-       {CERTIFICATE_REQUEST,                   0,      1,                                              FALSE,  FALSE},
+       {CERTIFICATE_REQUEST,                   0,      MAX_CERTREQ_PAYLOADS,   FALSE,  FALSE},
        {VENDOR_ID,                                             0,      MAX_VID_PAYLOADS,               FALSE,  FALSE},
 };
 
@@ -181,7 +181,7 @@ static payload_rule_t ike_auth_i_rules[] = {
        {AUTHENTICATION,                                0,      1,                                              TRUE,   TRUE},
        {ID_INITIATOR,                                  0,      1,                                              TRUE,   FALSE},
        {CERTIFICATE,                                   0,      MAX_CERT_PAYLOADS,              TRUE,   FALSE},
-       {CERTIFICATE_REQUEST,                   0,      1,                                              TRUE,   FALSE},
+       {CERTIFICATE_REQUEST,                   0,      MAX_CERTREQ_PAYLOADS,   TRUE,   FALSE},
        {ID_RESPONDER,                                  0,      1,                                              TRUE,   FALSE},
 #ifdef ME
        {SECURITY_ASSOCIATION,                  0,      1,                                              TRUE,   FALSE},