diff options
author | tb <> | 2024-01-08 10:06:50 +0000 |
---|---|---|
committer | tb <> | 2024-01-08 10:06:50 +0000 |
commit | c390b3b10d74554b4ac407b54a53224bf34f4f9c (patch) | |
tree | 967cc444a255bd5326ac0e5ad68ac93abc1cf17f /src/lib/libcrypto/err | |
parent | a8d2df2a35f302fe7d928b1f670b5ad61213b2f9 (diff) | |
download | openbsd-c390b3b10d74554b4ac407b54a53224bf34f4f9c.tar.gz openbsd-c390b3b10d74554b4ac407b54a53224bf34f4f9c.tar.bz2 openbsd-c390b3b10d74554b4ac407b54a53224bf34f4f9c.zip |
Disable X509_STORE_CTX_purpose_inherit()
Nothing uses this function, except two internal callers. So split its guts
temporarily into a helper function and disable the gross general case.
The internal helper can be simplified by observing that def_purpose == 0:
Overriding 0 by 0 doesn't do anything, so drop that bit. Rename ptmp into
purp, and inline X509_PURPOSE_get_by_id(), i.e., make appropriate checks and
subtract X509_PURPOSE_MIN. The fallback to X509_PURPOSE_get_by_id(0) will
always fail since X509_PURPOSE_MIN == 1. So ditch that call. In particular,
X509_STORE_CTX_set_purpose(ctx, X509_PURPOSE_ANY) fails in current because
of this. That's nonsense. So remove the purp->trust == X509_TRUST_DEFAULT
check as only change of behavior. This matches what OpenSSL do nowadays.
They now set def_purpose = purpose if purpose != 0 and def_purpose == 0,
so in all real-world uses of this function they will just fetch the same
purpose again and do not check for default trust the second time around.
Finally, X509_TRUST_get_by_id() is only used to ensure that a non-zero (or
overridden) trust is between X509_TRUST_MIN and X509_TRUST_MAX. So expand
that into its explicit form.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/err')
0 files changed, 0 insertions, 0 deletions