aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
Diffstat (limited to 'libssh')
-rw-r--r--libssh/dh.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libssh/dh.c b/libssh/dh.c
index 0edd19da..26bcbc7a 100644
--- a/libssh/dh.c
+++ b/libssh/dh.c
@@ -847,6 +847,22 @@ int ssh_get_pubkey_hash(SSH_SESSION *session, unsigned char **hash) {
return MD5_DIGEST_LEN;
}
+/** \addtogroup ssh_session
+ * @{ */
+/**
+ * @brief Deallocate the hash obtained by ssh_get_pubkey_hash.
+ * This is required under Microsoft platform as this library might use a
+ * different C library than your software, hence a different heap.
+ *
+ * @param hash The buffer to deallocate.
+ *
+ * @see ssh_get_pubkey_hash()
+ */
+void ssh_clean_pubkey_hash(unsigned char **hash) {
+ SAFE_FREE(*hash);
+ *hash = NULL;
+}
+
ssh_string ssh_get_pubkey(SSH_SESSION *session){
return string_copy(session->current_crypto->server_pubkey);
}