Add XKU_ANYEKU #define and use it to cache the anyExtendedKeyUsage
authortb <tb@openbsd.org>
Thu, 21 Oct 2021 13:51:52 +0000 (13:51 +0000)
committertb <tb@openbsd.org>
Thu, 21 Oct 2021 13:51:52 +0000 (13:51 +0000)
extension. This is part of OpenSSL commit df4c395c which didn't make
it into our tree for some reason.

ok jsing

lib/libcrypto/x509/x509_purp.c
lib/libcrypto/x509/x509v3.h

index 86ee274..3c05cc3 100644 (file)
@@ -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);
index abe9307..9467a66 100644 (file)
@@ -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