Do not build the PKCS#11 when disabled

This prevents building the pkcs11-related functions and printing pkcs11-related
log messages when the libssh is built without PKCS#11 support.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
This commit is contained in:
Jakub Jelen
2023-01-04 14:17:45 +01:00
parent 96ee1c62dd
commit ab24110ae0
7 changed files with 16 additions and 1 deletions

View File

@@ -1232,6 +1232,7 @@ int ssh_userauth_publickey_auto(ssh_session session,
state->privkey = NULL;
state->pubkey = NULL;
#ifdef WITH_PKCS11_URI
if (ssh_pki_is_uri(privkey_file)) {
char *pub_uri_from_priv = NULL;
SSH_LOG(SSH_LOG_INFO,
@@ -1244,7 +1245,9 @@ int ssh_userauth_publickey_auto(ssh_session session,
pub_uri_from_priv);
SAFE_FREE(pub_uri_from_priv);
}
} else {
} else
#endif /* WITH_PKCS11_URI */
{
snprintf(pubkey_file, sizeof(pubkey_file), "%s.pub", privkey_file);
}