Commit 7a5823bb authored by David Woodhouse's avatar David Woodhouse

Avoid warning about verify_signed_data being unused

Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 6bdf166c
......@@ -579,6 +579,22 @@ static int assign_privkey(struct openconnect_info *vpninfo,
return err;
}
#endif /* !SET_KEY */
static int verify_signed_data(gnutls_pubkey_t pubkey, gnutls_privkey_t privkey,
const gnutls_datum_t *data, const gnutls_datum_t *sig)
{
#ifdef HAVE_GNUTLS_PUBKEY_VERIFY_DATA2
gnutls_sign_algorithm_t algo = GNUTLS_SIGN_RSA_SHA1; /* TPM keys */
if (privkey != OPENCONNECT_TPM_PKEY)
algo = gnutls_pk_to_sign(gnutls_privkey_get_pk_algorithm(privkey, NULL),
GNUTLS_DIG_SHA1);
return gnutls_pubkey_verify_data2(pubkey, algo, 0, data, sig);
#else
return gnutls_pubkey_verify_data(pubkey, 0, data, sig);
#endif
}
#endif /* (P11KIT || TROUSERS) */
static int openssl_hash_password(struct openconnect_info *vpninfo, char *pass,
......@@ -864,22 +880,6 @@ static int import_openssl_pem(struct openconnect_info *vpninfo,
return ret;
}
static int verify_signed_data(gnutls_pubkey_t pubkey, gnutls_privkey_t privkey,
const gnutls_datum_t *data, const gnutls_datum_t *sig)
{
#ifdef HAVE_GNUTLS_PUBKEY_VERIFY_DATA2
gnutls_sign_algorithm_t algo = GNUTLS_SIGN_RSA_SHA1; /* TPM keys */
if (privkey != OPENCONNECT_TPM_PKEY)
algo = gnutls_pk_to_sign(gnutls_privkey_get_pk_algorithm(privkey, NULL),
GNUTLS_DIG_SHA1);
return gnutls_pubkey_verify_data2(pubkey, algo, 0, data, sig);
#else
return gnutls_pubkey_verify_data(pubkey, 0, data, sig);
#endif
}
static int load_certificate(struct openconnect_info *vpninfo)
{
gnutls_datum_t fdata;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment