Slightly renamed X509_NO_PATH_LEN_CONSTRAINT to use it for PolicyConstraints, too
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include <utils/enumerator.h>
|
||||
#include <credentials/certificates/certificate.h>
|
||||
|
||||
#define X509_NO_PATH_LEN_CONSTRAINT -1
|
||||
#define X509_NO_CONSTRAINT -1
|
||||
|
||||
typedef struct x509_t x509_t;
|
||||
typedef struct x509_cert_policy_t x509_cert_policy_t;
|
||||
|
||||
@@ -39,7 +39,7 @@ static bool check_pathlen(x509_t *issuer, int pathlen)
|
||||
int pathlen_constraint;
|
||||
|
||||
pathlen_constraint = issuer->get_pathLenConstraint(issuer);
|
||||
if (pathlen_constraint != X509_NO_PATH_LEN_CONSTRAINT &&
|
||||
if (pathlen_constraint != X509_NO_CONSTRAINT &&
|
||||
pathlen > pathlen_constraint)
|
||||
{
|
||||
DBG1(DBG_CFG, "path length of %d violates constraint of %d",
|
||||
|
||||
@@ -581,7 +581,7 @@ static private_openssl_x509_t *create_empty()
|
||||
.issuerAltNames = linked_list_create(),
|
||||
.crl_uris = linked_list_create(),
|
||||
.ocsp_uris = linked_list_create(),
|
||||
.pathlen = X509_NO_PATH_LEN_CONSTRAINT,
|
||||
.pathlen = X509_NO_CONSTRAINT,
|
||||
.ref = 1,
|
||||
);
|
||||
|
||||
|
||||
@@ -1800,7 +1800,7 @@ static private_x509_cert_t* create_empty(void)
|
||||
.excluded_names = linked_list_create(),
|
||||
.cert_policies = linked_list_create(),
|
||||
.policy_mappings = linked_list_create(),
|
||||
.pathLenConstraint = X509_NO_PATH_LEN_CONSTRAINT,
|
||||
.pathLenConstraint = X509_NO_CONSTRAINT,
|
||||
.ref = 1,
|
||||
);
|
||||
return this;
|
||||
@@ -1997,7 +1997,7 @@ static bool generate(private_x509_cert_t *cert, certificate_t *sign_cert,
|
||||
{
|
||||
chunk_t pathLenConstraint = chunk_empty;
|
||||
|
||||
if (cert->pathLenConstraint != X509_NO_PATH_LEN_CONSTRAINT)
|
||||
if (cert->pathLenConstraint != X509_NO_CONSTRAINT)
|
||||
{
|
||||
char pathlen = (char)cert->pathLenConstraint;
|
||||
|
||||
@@ -2361,7 +2361,7 @@ x509_cert_t *x509_cert_gen(certificate_type_t type, va_list args)
|
||||
cert->pathLenConstraint = va_arg(args, int);
|
||||
if (cert->pathLenConstraint < 0 || cert->pathLenConstraint > 127)
|
||||
{
|
||||
cert->pathLenConstraint = X509_NO_PATH_LEN_CONSTRAINT;
|
||||
cert->pathLenConstraint = X509_NO_CONSTRAINT;
|
||||
}
|
||||
continue;
|
||||
case BUILD_PERMITTED_NAME_CONSTRAINTS:
|
||||
|
||||
Reference in New Issue
Block a user