1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-08 08:22:19 +03:00

Abstract RSA/DSA private key file reading and RSA/DSA signing, and

implement them in openssl/libgcrypt layer.
This commit is contained in:
Simon Josefsson
2007-01-23 08:22:54 +00:00
parent 0d9a7e3c2e
commit 51b9ff0f16
5 changed files with 589 additions and 129 deletions

View File

@@ -131,10 +131,22 @@
#define libssh2_rsa_ctx RSA
int _libssh2_rsa_new(libssh2_rsa_ctx **rsa,
const unsigned char *edata,
unsigned long elen,
const unsigned char *ndata,
unsigned long nlen);
const unsigned char *edata,
unsigned long elen,
const unsigned char *ndata,
unsigned long nlen,
const unsigned char *ddata,
unsigned long dlen,
const unsigned char *pdata,
unsigned long plen,
const unsigned char *qdata,
unsigned long qlen,
const unsigned char *e1data,
unsigned long e1len,
const unsigned char *e2data,
unsigned long e2len,
const unsigned char *coeffdata,
unsigned long coefflen);
int _libssh2_rsa_sha1_verify(libssh2_rsa_ctx *rsa,
const unsigned char *sig,
unsigned long sig_len,
@@ -153,12 +165,18 @@ int _libssh2_dsa_new(libssh2_dsa_ctx **dsa,
const unsigned char *gdata,
unsigned long glen,
const unsigned char *ydata,
unsigned long ylen);
unsigned long ylen,
const unsigned char *x,
unsigned long x_len);
int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx *dsactx,
const unsigned char *sig,
unsigned long sig_len,
const unsigned char *m,
unsigned long m_len);
int _libssh2_dsa_sha1_sign(libssh2_dsa_ctx *dsactx,
const unsigned char *hash,
unsigned long hash_len,
unsigned char *sig);
#define _libssh2_dsa_free(dsactx) DSA_free(dsactx)