diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-08-16 01:18:36 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-08-16 01:18:36 +0200 |
commit | df29df6e3519ca0e40ea4fa7e148eed3c49f9841 (patch) | |
tree | 99c0d98f41cd5b94858b820e5a646f08d3632069 | |
parent | 330c713fdbbf79d591028cf2fe5ae3b868db1514 (diff) | |
download | libssh-df29df6e3519ca0e40ea4fa7e148eed3c49f9841.tar.gz libssh-df29df6e3519ca0e40ea4fa7e148eed3c49f9841.tar.xz libssh-df29df6e3519ca0e40ea4fa7e148eed3c49f9841.zip |
pki: Add ssh_pki_log function.
The plan is to get rid of the session as a parameter to ssh pki key
functions. We don't need a session for it and probably don't want it.
-rw-r--r-- | src/pki.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -46,6 +46,12 @@ #include "libssh/keys.h" #include "libssh/buffer.h" +#ifdef DEBUG_CRYPTO +#define ssh_pki_log(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__); +#else +#define ssh_pki_log(fmt, ...) +#endif + enum ssh_keytypes_e pki_privatekey_type_from_string(const char *privkey) { if (strncmp(privkey, DSA_HEADER_BEGIN, strlen(DSA_HEADER_BEGIN)) == 0) { return SSH_KEYTYPE_DSS; @@ -356,8 +362,8 @@ int ssh_pki_import_privkey_base64(ssh_session session, return SSH_ERROR; } - ssh_log(session, SSH_LOG_RARE, "Trying to decode privkey passphrase=%s", - passphrase ? "true" : "false"); + ssh_pki_log("Trying to decode privkey passphrase=%s", + passphrase ? "true" : "false"); key = pki_private_key_from_base64(session, b64_key, passphrase); if (key == NULL) { |