Reject when explicit trust EKU are set and none match.
Returning untrusted is enough for for full chains that end in self-signed roots, because when explicit trust is specified it suppresses the default blanket trust of self-signed objects. But for partial chains, this is not enough, because absent a similar trust-self-signed policy, non matching EKUs are indistinguishable from lack of EKU constraints. Therefore, failure to match any trusted purpose must trigger an explicit reject. Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
3d6e91c680
commit
3342dcea7a
1 changed files with 15 additions and 0 deletions
|
@ -312,6 +312,21 @@ static int obj_trust(int id, X509 *x, int flags)
|
|||
if (OBJ_obj2nid(obj) == id)
|
||||
return X509_TRUST_TRUSTED;
|
||||
}
|
||||
/*
|
||||
* Reject when explicit trust EKU are set and none match.
|
||||
*
|
||||
* Returning untrusted is enough for for full chains that end in
|
||||
* self-signed roots, because when explicit trust is specified it
|
||||
* suppresses the default blanket trust of self-signed objects.
|
||||
*
|
||||
* But for partial chains, this is not enough, because absent a similar
|
||||
* trust-self-signed policy, non matching EKUs are indistinguishable
|
||||
* from lack of EKU constraints.
|
||||
*
|
||||
* Therefore, failure to match any trusted purpose must trigger an
|
||||
* explicit reject.
|
||||
*/
|
||||
return X509_TRUST_REJECTED;
|
||||
}
|
||||
return X509_TRUST_UNTRUSTED;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue