aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2018-08-06 14:32:28 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-31 14:18:34 +0200
commitb4c8bd9fe436c16956fb32574b3ec5928d601a82 (patch)
treefaf0dc28b61b74a418dc672246c5692a6cc51d5c /include
parent5d1300665061736c3ebfb4728ee1a96a2a345f3f (diff)
downloadlibssh-b4c8bd9fe436c16956fb32574b3ec5928d601a82.tar.gz
libssh-b4c8bd9fe436c16956fb32574b3ec5928d601a82.tar.xz
libssh-b4c8bd9fe436c16956fb32574b3ec5928d601a82.zip
pki: Support RSA SHA2 signatures of sessionid for server
This involves mostly creation of host keys proofs but needs to follow the same procedure as the client authentication signatures. At the same time, the SHA2 extension is enabled in the pkd so we are able to atomicaly provide correct signatures and pass tests. 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.h1
-rw-r--r--include/libssh/pki_priv.h9
2 files changed, 7 insertions, 3 deletions
diff --git a/include/libssh/pki.h b/include/libssh/pki.h
index 621378ad..b682f273 100644
--- a/include/libssh/pki.h
+++ b/include/libssh/pki.h
@@ -99,6 +99,7 @@ void ssh_key_clean (ssh_key key);
const char *
ssh_key_get_signature_algorithm(ssh_session session,
enum ssh_keytypes_e type);
+enum ssh_keytypes_e ssh_key_type_from_signature_name(const char *name);
/* SSH Signature Functions */
ssh_signature ssh_signature_new(void);
diff --git a/include/libssh/pki_priv.h b/include/libssh/pki_priv.h
index 623ca5a1..fe7e92a8 100644
--- a/include/libssh/pki_priv.h
+++ b/include/libssh/pki_priv.h
@@ -104,9 +104,12 @@ 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);
+#define pki_do_sign_sessionid(key, hash, hlen) \
+ pki_do_sign_sessionid_hash(key, hash, hlen, SSH_DIGEST_AUTO)
+ssh_signature pki_do_sign_sessionid_hash(const ssh_key key,
+ const unsigned char *hash,
+ size_t hlen,
+ enum ssh_digest_e hash_type);
int pki_ed25519_sign(const ssh_key privkey, ssh_signature sig,
const unsigned char *hash, size_t hlen);
int pki_ed25519_verify(const ssh_key pubkey, ssh_signature sig,