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

@@ -189,8 +189,10 @@ bool ssh_key_size_allowed(ssh_session session, ssh_key key);
int ssh_key_size(ssh_key key);
/* PKCS11 URI function to check if filename is a path or a PKCS11 URI */
#ifdef WITH_PKCS11_URI
bool ssh_pki_is_uri(const char *filename);
char *ssh_pki_export_pub_uri_from_priv_uri(const char *priv_uri);
#endif /* WITH_PKCS11_URI */
#ifdef __cplusplus
}

View File

@@ -168,8 +168,10 @@ ssh_key ssh_pki_openssh_privkey_import(const char *text_key,
ssh_string ssh_pki_openssh_privkey_export(const ssh_key privkey,
const char *passphrase, ssh_auth_callback auth_fn, void *auth_data);
#ifdef WITH_PKCS11_URI
/* URI Function */
int pki_uri_import(const char *uri_name, ssh_key *key, enum ssh_key_e key_type);
#endif /* WITH_PKCS11_URI */
bool ssh_key_size_allowed_rsa(int min_size, ssh_key key);
#ifdef __cplusplus