-/* $OpenBSD: x509_purp.c,v 1.9 2021/10/22 18:37:15 tb Exp $ */
+/* $OpenBSD: x509_purp.c,v 1.10 2021/10/23 11:53:24 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2001.
*/
return X509_V_OK;
}
+uint32_t
+X509_get_extension_flags(X509 *x)
+{
+ /* Call for side-effect of computing hash and caching extensions */
+ if (X509_check_purpose(x, -1, -1) != 1)
+ return 0;
+
+ return x->ex_flags;
+}
+
uint32_t
X509_get_key_usage(X509 *x)
{
-/* $OpenBSD: x509v3.h,v 1.7 2021/10/22 18:37:15 tb Exp $ */
+/* $OpenBSD: x509v3.h,v 1.8 2021/10/23 11:53:24 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
void X509_PURPOSE_cleanup(void);
int X509_PURPOSE_get_id(const X509_PURPOSE *);
#if defined(LIBRESSL_NEW_API)
+uint32_t X509_get_extension_flags(X509 *x);
uint32_t X509_get_key_usage(X509 *x);
uint32_t X509_get_extended_key_usage(X509 *x);
#endif