Loading crypto/x509v3/v3_purp.c +22 −0 Original line number Diff line number Diff line Loading @@ -841,3 +841,25 @@ int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid) } return X509_V_OK; } uint32_t X509_get_extension_flags(X509 *x) { X509_check_purpose(x, -1, -1); return x->ex_flags; } uint32_t X509_get_key_usage(X509 *x) { X509_check_purpose(x, -1, -1); if (x->ex_flags & EXFLAG_KUSAGE) return x->ex_kusage; return UINT32_MAX; } uint32_t X509_get_extended_key_usage(X509 *x) { X509_check_purpose(x, -1, -1); if (x->ex_flags & EXFLAG_XKUSAGE) return x->ex_xkusage; return UINT32_MAX; } include/openssl/x509v3.h +5 −0 Original line number Diff line number Diff line Loading @@ -696,6 +696,11 @@ int X509_supported_extension(X509_EXTENSION *ex); int X509_PURPOSE_set(int *p, int purpose); int X509_check_issued(X509 *issuer, X509 *subject); int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); 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); int X509_PURPOSE_get_count(void); X509_PURPOSE *X509_PURPOSE_get0(int idx); int X509_PURPOSE_get_by_sname(char *sname); Loading Loading
crypto/x509v3/v3_purp.c +22 −0 Original line number Diff line number Diff line Loading @@ -841,3 +841,25 @@ int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid) } return X509_V_OK; } uint32_t X509_get_extension_flags(X509 *x) { X509_check_purpose(x, -1, -1); return x->ex_flags; } uint32_t X509_get_key_usage(X509 *x) { X509_check_purpose(x, -1, -1); if (x->ex_flags & EXFLAG_KUSAGE) return x->ex_kusage; return UINT32_MAX; } uint32_t X509_get_extended_key_usage(X509 *x) { X509_check_purpose(x, -1, -1); if (x->ex_flags & EXFLAG_XKUSAGE) return x->ex_xkusage; return UINT32_MAX; }
include/openssl/x509v3.h +5 −0 Original line number Diff line number Diff line Loading @@ -696,6 +696,11 @@ int X509_supported_extension(X509_EXTENSION *ex); int X509_PURPOSE_set(int *p, int purpose); int X509_check_issued(X509 *issuer, X509 *subject); int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); 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); int X509_PURPOSE_get_count(void); X509_PURPOSE *X509_PURPOSE_get0(int idx); int X509_PURPOSE_get_by_sname(char *sname); Loading