aboutsummaryrefslogtreecommitdiff
path: root/include/libssh
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-05-02 13:56:15 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-05-13 16:37:51 +0200
commitfd9446553b5e06c95c67945959b228e44c870b73 (patch)
tree2f8b4c686bc50dafd69309ad8549b04978f90783 /include/libssh
parent33af73655575e3e1da4a93b93ab0f4ab77ab7595 (diff)
downloadlibssh-fd9446553b5e06c95c67945959b228e44c870b73.tar.gz
libssh-fd9446553b5e06c95c67945959b228e44c870b73.tar.xz
libssh-fd9446553b5e06c95c67945959b228e44c870b73.zip
pki_crypto: Added pki_sign_data() and pki_verify_data_signature()
pki_sign_data() uses the given private key and hash algorithm to sign the data using the OpenSSL EVP interface. The corresponding function pki_verify_data_signature() receives the signature, the signed data, and the public key to verify the signature. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh')
-rw-r--r--include/libssh/pki_priv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libssh/pki_priv.h b/include/libssh/pki_priv.h
index 32d8e449..a104f1c8 100644
--- a/include/libssh/pki_priv.h
+++ b/include/libssh/pki_priv.h
@@ -109,6 +109,14 @@ int pki_privkey_build_ecdsa(ssh_key key,
ssh_string pki_publickey_to_blob(const ssh_key key);
/* SSH Signature Functions */
+ssh_signature pki_sign_data(const ssh_key privkey,
+ enum ssh_digest_e hash_type,
+ const unsigned char *input,
+ size_t input_len);
+int pki_verify_data_signature(ssh_signature signature,
+ const ssh_key pubkey,
+ const unsigned char *input,
+ size_t input_len);
ssh_string pki_signature_to_blob(const ssh_signature sign);
ssh_signature pki_signature_from_blob(const ssh_key pubkey,
const ssh_string sig_blob,