diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-03-29 12:38:34 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-04-05 11:40:50 +0200 |
commit | 5fd52ca3c81bb6f82d0d69e961ab725f3b33b36f (patch) | |
tree | 300449ae48db46216defdedb877d3805da3da438 | |
parent | 714e81625fbbe3988c42e330624ac12559320c0f (diff) | |
download | gnutls-5fd52ca3c81bb6f82d0d69e961ab725f3b33b36f.tar.gz |
Moved all openpgp-related variables and definitions into ifdef blocks
This allows compilation with -Werror even if openpgp is disabled.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/cert.c | 8 | ||||
-rw-r--r-- | lib/pubkey.c | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/cert.c b/lib/cert.c index edcd413776..e6c2595dc8 100644 --- a/lib/cert.c +++ b/lib/cert.c @@ -749,8 +749,6 @@ gnutls_certificate_verify_peers(gnutls_session_t session, unsigned int *status) { cert_auth_info_t info; - const char *hostname = NULL; - unsigned i, type = 0; CHECK_AUTH(GNUTLS_CRD_CERTIFICATE, GNUTLS_E_INVALID_REQUEST); @@ -768,7 +766,10 @@ gnutls_certificate_verify_peers(gnutls_session_t session, return _gnutls_x509_cert_verify_peers(session, data, elements, status); #ifdef ENABLE_OPENPGP - case GNUTLS_CRT_OPENPGP: + case GNUTLS_CRT_OPENPGP: { + const char *hostname = NULL; + unsigned i, type = 0; + for (i=0;i<elements;i++) { if (data[i].type == GNUTLS_DT_DNS_HOSTNAME) { hostname = (char*)data[i].data; @@ -784,6 +785,7 @@ gnutls_certificate_verify_peers(gnutls_session_t session, type, hostname, status); + } #endif default: return GNUTLS_E_INVALID_REQUEST; diff --git a/lib/pubkey.c b/lib/pubkey.c index cbf7f47e0c..7c42f67805 100644 --- a/lib/pubkey.c +++ b/lib/pubkey.c @@ -39,10 +39,6 @@ #include <ecc.h> -#define OPENPGP_KEY_PRIMARY 2 -#define OPENPGP_KEY_SUBKEY 1 - - unsigned pubkey_to_bits(gnutls_pk_algorithm_t pk, gnutls_pk_params_st * params) { switch (pk) { @@ -405,6 +401,10 @@ gnutls_pubkey_import_pkcs11(gnutls_pubkey_t key, #ifdef ENABLE_OPENPGP +#define OPENPGP_KEY_PRIMARY 2 +#define OPENPGP_KEY_SUBKEY 1 + + /** * gnutls_pubkey_import_openpgp: * @key: The public key |