summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/objects/obj_dat.c
diff options
context:
space:
mode:
authortb <>2024-01-08 10:06:50 +0000
committertb <>2024-01-08 10:06:50 +0000
commit98a5a5583ff7df82e74ae3e6928a42dbf5279506 (patch)
tree967cc444a255bd5326ac0e5ad68ac93abc1cf17f /src/lib/libcrypto/objects/obj_dat.c
parented0a2940e384df72ae2cff3fb3b60551c10c50f5 (diff)
downloadopenbsd-98a5a5583ff7df82e74ae3e6928a42dbf5279506.tar.gz
openbsd-98a5a5583ff7df82e74ae3e6928a42dbf5279506.tar.bz2
openbsd-98a5a5583ff7df82e74ae3e6928a42dbf5279506.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/objects/obj_dat.c')
0 files changed, 0 insertions, 0 deletions