Add support for IKEv2 OCSP extensions (RFC 4806)

Closes strongswan/strongswan#2016

Co-authored-by: Tobias Brunner <[email protected]>
This commit is contained in:
Jean-François Hren
2024-03-13 15:10:50 +01:00
committed by Tobias Brunner
co-authored by Tobias Brunner
parent ddd926b698
commit 15612b3a42
15 changed files with 477 additions and 49 deletions
@@ -230,6 +230,9 @@ METHOD(cert_payload_t, get_cert, certificate_t*,
case ENC_CRL:
type = CERT_X509_CRL;
break;
case ENC_OCSP_CONTENT:
type = CERT_X509_OCSP_RESPONSE;
break;
default:
return NULL;
}
@@ -339,6 +342,9 @@ cert_payload_t *cert_payload_create_from_cert(payload_type_t type,
case CERT_X509_AC:
this->encoding = ENC_X509_ATTRIBUTE;
break;
case CERT_X509_OCSP_RESPONSE:
this->encoding = ENC_OCSP_CONTENT;
break;
default:
DBG1(DBG_ENC, "embedding %N certificate in payload failed",
certificate_type_names, cert->get_type(cert));
@@ -244,6 +244,8 @@ METHOD(certreq_payload_t, get_cert_type, certificate_type_t,
{
case ENC_X509_SIGNATURE:
return CERT_X509;
case ENC_OCSP_CONTENT:
return CERT_X509_OCSP_REQUEST;
default:
return CERT_ANY;
}
@@ -302,6 +304,9 @@ certreq_payload_t *certreq_payload_create_type(certificate_type_t type)
case CERT_X509:
this->encoding = ENC_X509_SIGNATURE;
break;
case CERT_X509_OCSP_REQUEST:
this->encoding = ENC_OCSP_CONTENT;
break;
default:
DBG1(DBG_ENC, "certificate type %N not supported in requests",
certificate_type_names, type);