From: tb Date: Thu, 21 Oct 2021 13:51:52 +0000 (+0000) Subject: Add XKU_ANYEKU #define and use it to cache the anyExtendedKeyUsage X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3e6cffe730a8359fc4d3ef5ce5bca7cb559b275f;p=openbsd Add XKU_ANYEKU #define and use it to cache the anyExtendedKeyUsage extension. This is part of OpenSSL commit df4c395c which didn't make it into our tree for some reason. ok jsing --- diff --git a/lib/libcrypto/x509/x509_purp.c b/lib/libcrypto/x509/x509_purp.c index 86ee27407e3..3c05cc31b26 100644 --- a/lib/libcrypto/x509/x509_purp.c +++ b/lib/libcrypto/x509/x509_purp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_purp.c,v 1.7 2021/09/13 15:26:53 claudio Exp $ */ +/* $OpenBSD: x509_purp.c,v 1.8 2021/10/21 13:51:52 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -549,6 +549,10 @@ x509v3_cache_extensions(X509 *x) case NID_dvcs: x->ex_xkusage |= XKU_DVCS; break; + + case NID_anyExtendedKeyUsage: + x->ex_xkusage |= XKU_ANYEKU; + break; } } sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free); diff --git a/lib/libcrypto/x509/x509v3.h b/lib/libcrypto/x509/x509v3.h index abe93077a63..9467a666c5a 100644 --- a/lib/libcrypto/x509/x509v3.h +++ b/lib/libcrypto/x509/x509v3.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509v3.h,v 1.5 2021/09/02 13:48:39 job Exp $ */ +/* $OpenBSD: x509v3.h,v 1.6 2021/10/21 13:51:52 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -446,7 +446,7 @@ struct ISSUING_DIST_POINT_st #define NS_OBJSIGN_CA 0x01 #define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA) -#define XKU_SSL_SERVER 0x1 +#define XKU_SSL_SERVER 0x1 #define XKU_SSL_CLIENT 0x2 #define XKU_SMIME 0x4 #define XKU_CODE_SIGN 0x8 @@ -454,6 +454,7 @@ struct ISSUING_DIST_POINT_st #define XKU_OCSP_SIGN 0x20 #define XKU_TIMESTAMP 0x40 #define XKU_DVCS 0x80 +#define XKU_ANYEKU 0x100 #define X509_PURPOSE_DYNAMIC 0x1 #define X509_PURPOSE_DYNAMIC_NAME 0x2