summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509
diff options
context:
space:
mode:
authortb <>2023-10-11 13:05:18 +0000
committertb <>2023-10-11 13:05:18 +0000
commit31ff0d80e6b2ed6a5b088989cc8d80e73110e568 (patch)
tree091c51644d03df4dc1339b318989121b1c000dbe /src/lib/libcrypto/x509
parent7c0142cca5e19d488053311ec1f25b8e064e05c9 (diff)
downloadopenbsd-31ff0d80e6b2ed6a5b088989cc8d80e73110e568.tar.gz
openbsd-31ff0d80e6b2ed6a5b088989cc8d80e73110e568.tar.bz2
openbsd-31ff0d80e6b2ed6a5b088989cc8d80e73110e568.zip
Add internal version of X509_ALGOR_set_md()
X509_ALGOR_set_md() is a void function that cannot easily be error checked. The caller has to jump through hoops to make sure this function doesn't fail. Prepare replacing this internally with X509_ALGOR_set_evp_md(), which allows error checking. There is one slight change of behavior: if the EVP_MD object passed in does not have an OID known to the library, then this new API fails. It is unclear what the library should do with such an object and people who use EVP_MD_meth_new() need to know what they are doing anyway and they are better off teaching the lib about the OID if they're going to be messing with certs. Oh, and the prototype is in x509_local.h because the rest of this API is in x509.h despite being implemented in asn1/. ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509')
-rw-r--r--src/lib/libcrypto/x509/x509_local.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_local.h b/src/lib/libcrypto/x509/x509_local.h
index f00a55bac8..44fe6ad805 100644
--- a/src/lib/libcrypto/x509/x509_local.h
+++ b/src/lib/libcrypto/x509/x509_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_local.h,v 1.9 2023/05/28 05:25:24 tb Exp $ */ 1/* $OpenBSD: x509_local.h,v 1.10 2023/10/11 13:05:18 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2013. 3 * project 2013.
4 */ 4 */
@@ -379,6 +379,8 @@ int x509_check_cert_time(X509_STORE_CTX *ctx, X509 *x, int quiet);
379 379
380int name_cmp(const char *name, const char *cmp); 380int name_cmp(const char *name, const char *cmp);
381 381
382int X509_ALGOR_set_evp_md(X509_ALGOR *alg, const EVP_MD *md);
383
382int X509_policy_check(const STACK_OF(X509) *certs, 384int X509_policy_check(const STACK_OF(X509) *certs,
383 const STACK_OF(ASN1_OBJECT) *user_policies, unsigned long flags, 385 const STACK_OF(ASN1_OBJECT) *user_policies, unsigned long flags,
384 X509 **out_current_cert); 386 X509 **out_current_cert);