hx509: Add support for CSRs w/ BasicConstraints
This commit is contained in:

committed by
Nico Williams

parent
0f998cdbc2
commit
be0d1e68e5
@@ -1498,6 +1498,25 @@ request_create(struct request_create_options *opt, int argc, char **argv)
|
||||
if (ret)
|
||||
hx509_err(context, 1, ret, "Could not initialize CSR context");
|
||||
|
||||
if (opt->ca_flag && opt->ee_flag)
|
||||
errx(1, "request-create --ca and --ee are mutually exclusive");
|
||||
|
||||
if (opt->ca_flag) {
|
||||
unsigned pathLenConstraint = 0;
|
||||
unsigned *pathLenConstraintPtr = NULL;
|
||||
|
||||
if (opt->ca_path_length_integer > 0 &&
|
||||
opt->ca_path_length_integer < INT_MAX) {
|
||||
pathLenConstraint = opt->ca_path_length_integer;
|
||||
pathLenConstraintPtr = &pathLenConstraint;
|
||||
}
|
||||
ret = hx509_request_set_cA(context, req, pathLenConstraintPtr);
|
||||
if (ret)
|
||||
errx(1, "hx509_request_set_cA: %d\n", ret);
|
||||
} else if (opt->ee_flag) {
|
||||
hx509_request_set_eE(context, req);
|
||||
}
|
||||
|
||||
if (opt->subject_string) {
|
||||
hx509_name name = NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user