diff options
Diffstat (limited to 'lib/auth/cert.h')
-rw-r--r-- | lib/auth/cert.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/auth/cert.h b/lib/auth/cert.h index 3f57ec1c74..fd66628820 100644 --- a/lib/auth/cert.h +++ b/lib/auth/cert.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2002-2012 Free Software Foundation, Inc. - * Copyright (C) 2016-2017 Red Hat, Inc. + * Copyright (C) 2016-2019 Red Hat, Inc. * * Author: Nikos Mavrogiannopoulos * @@ -29,6 +29,7 @@ #include <gnutls/abstract.h> #include <gnutls/compat.h> #include <str_array.h> +#include "abstract_int.h" #define MAX_OCSP_RESPONSES 8 @@ -171,5 +172,13 @@ int _gnutls_gen_rawpk_crt(gnutls_session_t session, gnutls_buffer_st* data); int _gnutls_proc_rawpk_crt(gnutls_session_t session, uint8_t * data, size_t data_size); +inline static unsigned get_key_usage(gnutls_session_t session, gnutls_pubkey_t pubkey) +{ + if (unlikely(session->internals.priorities && + session->internals.priorities->allow_server_key_usage_violation)) + return 0; + else + return pubkey->key_usage; +} #endif |