Fix warnings.
This commit is contained in:
parent
f252d350ec
commit
1f232d69ed
@ -256,8 +256,6 @@ int _libssh2_rsa_sha1_sign(LIBSSH2_SESSION *session,
|
|||||||
unsigned long *signature_len)
|
unsigned long *signature_len)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int i;
|
|
||||||
libssh2_sha1_ctx ctx;
|
|
||||||
unsigned char *sig;
|
unsigned char *sig;
|
||||||
unsigned int sig_len;
|
unsigned int sig_len;
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include <openssl/hmac.h>
|
#include <openssl/hmac.h>
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
#include <openssl/rand.h>
|
||||||
|
|
||||||
#ifdef OPENSSL_NO_RSA
|
#ifdef OPENSSL_NO_RSA
|
||||||
# define LIBSSH2_RSA 0
|
# define LIBSSH2_RSA 0
|
||||||
@ -126,7 +127,7 @@
|
|||||||
#define libssh2_hmac_final(ctx, data) HMAC_Final(&(ctx), data, NULL)
|
#define libssh2_hmac_final(ctx, data) HMAC_Final(&(ctx), data, NULL)
|
||||||
#define libssh2_hmac_cleanup(ctx) HMAC_cleanup(ctx)
|
#define libssh2_hmac_cleanup(ctx) HMAC_cleanup(ctx)
|
||||||
|
|
||||||
#define libssh2_crypto_init() 1
|
#define libssh2_crypto_init()
|
||||||
|
|
||||||
#define libssh2_rsa_ctx RSA
|
#define libssh2_rsa_ctx RSA
|
||||||
|
|
||||||
@ -147,11 +148,21 @@ int _libssh2_rsa_new(libssh2_rsa_ctx **rsa,
|
|||||||
unsigned long e2len,
|
unsigned long e2len,
|
||||||
const unsigned char *coeffdata,
|
const unsigned char *coeffdata,
|
||||||
unsigned long coefflen);
|
unsigned long coefflen);
|
||||||
|
int _libssh2_rsa_new_private (libssh2_rsa_ctx **rsa,
|
||||||
|
LIBSSH2_SESSION *session,
|
||||||
|
FILE *fp,
|
||||||
|
unsigned const char *passphrase);
|
||||||
int _libssh2_rsa_sha1_verify(libssh2_rsa_ctx *rsa,
|
int _libssh2_rsa_sha1_verify(libssh2_rsa_ctx *rsa,
|
||||||
const unsigned char *sig,
|
const unsigned char *sig,
|
||||||
unsigned long sig_len,
|
unsigned long sig_len,
|
||||||
const unsigned char *m,
|
const unsigned char *m,
|
||||||
unsigned long m_len);
|
unsigned long m_len);
|
||||||
|
int _libssh2_rsa_sha1_sign(LIBSSH2_SESSION *session,
|
||||||
|
libssh2_rsa_ctx *rsactx,
|
||||||
|
const unsigned char *hash,
|
||||||
|
unsigned long hash_len,
|
||||||
|
unsigned char **signature,
|
||||||
|
unsigned long *signature_len);
|
||||||
|
|
||||||
#define _libssh2_rsa_free(rsactx) RSA_free(rsactx)
|
#define _libssh2_rsa_free(rsactx) RSA_free(rsactx)
|
||||||
|
|
||||||
@ -168,6 +179,10 @@ int _libssh2_dsa_new(libssh2_dsa_ctx **dsa,
|
|||||||
unsigned long ylen,
|
unsigned long ylen,
|
||||||
const unsigned char *x,
|
const unsigned char *x,
|
||||||
unsigned long x_len);
|
unsigned long x_len);
|
||||||
|
int _libssh2_dsa_new_private (libssh2_dsa_ctx **dsa,
|
||||||
|
LIBSSH2_SESSION *session,
|
||||||
|
FILE *fp,
|
||||||
|
unsigned const char *passphrase);
|
||||||
int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx *dsactx,
|
int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx *dsactx,
|
||||||
const unsigned char *sig,
|
const unsigned char *sig,
|
||||||
unsigned long sig_len,
|
unsigned long sig_len,
|
||||||
|
@ -155,7 +155,7 @@ static int read_asn1_length (const unsigned char *data,
|
|||||||
int _libssh2_pem_decode_sequence (char **data, unsigned int *datalen)
|
int _libssh2_pem_decode_sequence (char **data, unsigned int *datalen)
|
||||||
{
|
{
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
unsigned int lenlen;
|
int lenlen;
|
||||||
|
|
||||||
if (*datalen < 1)
|
if (*datalen < 1)
|
||||||
{
|
{
|
||||||
@ -186,7 +186,7 @@ int _libssh2_pem_decode_integer (char **data, unsigned int *datalen,
|
|||||||
char **i, unsigned int *ilen)
|
char **i, unsigned int *ilen)
|
||||||
{
|
{
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
unsigned int lenlen;
|
int lenlen;
|
||||||
|
|
||||||
if (*datalen < 1)
|
if (*datalen < 1)
|
||||||
{
|
{
|
||||||
|
@ -212,7 +212,8 @@ static int libssh2_publickey_response_success(LIBSSH2_PUBLICKEY *pkey)
|
|||||||
{
|
{
|
||||||
LIBSSH2_SESSION *session = pkey->channel->session;
|
LIBSSH2_SESSION *session = pkey->channel->session;
|
||||||
unsigned char *data, *s;
|
unsigned char *data, *s;
|
||||||
unsigned long data_len, response;
|
unsigned long data_len;
|
||||||
|
int response;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (libssh2_publickey_packet_receive(pkey, &data, &data_len)) {
|
if (libssh2_publickey_packet_receive(pkey, &data, &data_len)) {
|
||||||
@ -551,10 +552,11 @@ LIBSSH2_API int libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY *pkey, unsigned l
|
|||||||
LIBSSH2_SESSION *session = channel->session;
|
LIBSSH2_SESSION *session = channel->session;
|
||||||
libssh2_publickey_list *list = NULL;
|
libssh2_publickey_list *list = NULL;
|
||||||
unsigned char *s, buffer[12], *data = NULL;
|
unsigned char *s, buffer[12], *data = NULL;
|
||||||
unsigned long buffer_len = 12, keys = 0, max_keys = 0, data_len, i, response;
|
unsigned long buffer_len = 12, keys = 0, max_keys = 0, data_len, i;
|
||||||
/* packet_len(4) +
|
/* packet_len(4) +
|
||||||
list_len(4) +
|
list_len(4) +
|
||||||
"list"(4) */
|
"list"(4) */
|
||||||
|
int response;
|
||||||
|
|
||||||
s = buffer;
|
s = buffer;
|
||||||
libssh2_htonu32(s, buffer_len - 4); s += 4;
|
libssh2_htonu32(s, buffer_len - 4); s += 4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user