aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2018-08-07 15:04:45 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-31 14:18:34 +0200
commit1f08aabe430676653c584eb29a28e56555ea5314 (patch)
tree7b3a08490d1a7bc66a5c8a9ae516ac77edf1786c /include
parent3ca7e1eea9afc30bf4dd8fdeaad007b46a3a8cf7 (diff)
downloadlibssh-1f08aabe430676653c584eb29a28e56555ea5314.tar.gz
libssh-1f08aabe430676653c584eb29a28e56555ea5314.tar.xz
libssh-1f08aabe430676653c584eb29a28e56555ea5314.zip
pki: RSA signatures with SHA2 hash algorithms (RFC 8332)
* This change introduces a new API to request signature using one key and different hash algorithms. This is used only with RSA keys, that used to have SHA1 hardcoded, but the new algorithsms allow to use the SHA2 hashes, if the extension is negotiated. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r--include/libssh/pki_priv.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/libssh/pki_priv.h b/include/libssh/pki_priv.h
index b10e3b95..38c7aa4b 100644
--- a/include/libssh/pki_priv.h
+++ b/include/libssh/pki_priv.h
@@ -96,9 +96,12 @@ int pki_signature_verify(ssh_session session,
size_t hlen);
/* SSH Signing Functions */
-ssh_signature pki_do_sign(const ssh_key privkey,
- const unsigned char *hash,
- size_t hlen);
+#define pki_do_sign(key, hash, hlen) \
+ pki_do_sign_hash(key, hash, hlen, SSH_DIGEST_AUTO)
+ssh_signature pki_do_sign_hash(const ssh_key privkey,
+ const unsigned char *hash,
+ size_t hlen,
+ enum ssh_digest_e hash_type);
ssh_signature pki_do_sign_sessionid(const ssh_key key,
const unsigned char *hash,
size_t hlen);