fix compiler warnings

This commit is contained in:
Daniel Stenberg 2007-01-23 21:36:40 +00:00
parent f1e7eb7ae8
commit a139ab0b45
4 changed files with 21 additions and 14 deletions

View File

@ -474,8 +474,8 @@ int _libssh2_pem_parse (LIBSSH2_SESSION *session,
const char *headerend,
FILE *fp,
char **data, unsigned int *datalen);
int _libssh2_pem_decode_sequence (char **data, unsigned int *datalen);
int _libssh2_pem_decode_integer (char **data, unsigned int *datalen,
char **i, unsigned int *ilen);
int _libssh2_pem_decode_sequence (unsigned char **data, unsigned int *datalen);
int _libssh2_pem_decode_integer (unsigned char **data, unsigned int *datalen,
unsigned char **i, unsigned int *ilen);
#endif /* LIBSSH2_H */

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2004-2006, Sara Golemon <sarag@libssh2.org>
/* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@ -37,7 +37,7 @@
#include "libssh2_priv.h"
#if LIBSSH2_MAC_NONE
#ifdef LIBSSH2_MAC_NONE
/* {{{ libssh2_mac_none_MAC
* Minimalist MAC: No MAC
*/
@ -129,10 +129,10 @@ static int libssh2_mac_method_hmac_sha1_96_hash(LIBSSH2_SESSION *session, unsign
const unsigned char *packet, unsigned long packet_len,
const unsigned char *addtl, unsigned long addtl_len, void **abstract)
{
char temp[SHA_DIGEST_LENGTH];
unsigned char temp[SHA_DIGEST_LENGTH];
libssh2_mac_method_hmac_sha1_hash(session, temp, seqno, packet, packet_len, addtl, addtl_len, abstract);
memcpy(buf, temp, 96 / 8);
memcpy(buf, (char *)temp, 96 / 8);
return 0;
}
@ -156,6 +156,7 @@ static int libssh2_mac_method_hmac_md5_hash(LIBSSH2_SESSION *session, unsigned c
{
libssh2_hmac_ctx ctx;
unsigned char seqno_buf[4];
(void)session;
libssh2_htonu32(seqno_buf, seqno);
@ -188,10 +189,10 @@ static int libssh2_mac_method_hmac_md5_96_hash(LIBSSH2_SESSION *session, unsigne
const unsigned char *packet, unsigned long packet_len,
const unsigned char *addtl, unsigned long addtl_len, void **abstract)
{
char temp[MD5_DIGEST_LENGTH];
unsigned char temp[MD5_DIGEST_LENGTH];
libssh2_mac_method_hmac_md5_hash(session, temp, seqno, packet, packet_len, addtl, addtl_len, abstract);
memcpy(buf, temp, 96 / 8);
memcpy(buf, (char *)temp, 96 / 8);
return 0;
}
@ -216,6 +217,7 @@ static int libssh2_mac_method_hmac_ripemd160_hash(LIBSSH2_SESSION *session, unsi
{
libssh2_hmac_ctx ctx;
unsigned char seqno_buf[4];
(void)session;
libssh2_htonu32(seqno_buf, seqno);
@ -256,11 +258,11 @@ static LIBSSH2_MAC_METHOD *_libssh2_mac_methods[] = {
&libssh2_mac_method_hmac_sha1_96,
&libssh2_mac_method_hmac_md5,
&libssh2_mac_method_hmac_md5_96,
#if LIBSSH2_HMAC_RIPEMD
#ifdef LIBSSH2_HMAC_RIPEMD
&libssh2_mac_method_hmac_ripemd160,
&libssh2_mac_method_hmac_ripemd160_openssh_com,
#endif /* LIBSSH2_HMAC_RIPEMD */
#if LIBSSH2_MAC_NONE
#ifdef LIBSSH2_MAC_NONE
&libssh2_mac_method_none,
#endif /* LIBSSH2_MAC_NONE */
NULL

View File

@ -176,6 +176,8 @@ int _libssh2_cipher_crypt(_libssh2_cipher_ctx *ctx,
int blocksize = ctx->cipher->block_size;
unsigned char buf[EVP_MAX_BLOCK_LENGTH];
int ret;
(void)algo;
(void)encrypt;
if (blocksize == 1) {
/* Hack for arcfour. */
@ -212,6 +214,7 @@ int _libssh2_rsa_new_private (libssh2_rsa_ctx **rsa,
FILE *fp,
unsigned const char *passphrase)
{
(void)session;
if (!EVP_get_cipherbyname("des")) {
/* If this cipher isn't loaded it's a pretty good indication that none are.
* I have *NO DOUBT* that there's a better way to deal with this ($#&%#$(%$#(
@ -232,6 +235,7 @@ int _libssh2_dsa_new_private (libssh2_dsa_ctx **dsa,
FILE *fp,
unsigned const char *passphrase)
{
(void)session;
if (!EVP_get_cipherbyname("des")) {
/* If this cipher isn't loaded it's a pretty good indication that none are.
* I have *NO DOUBT* that there's a better way to deal with this ($#&%#$(%$#(
@ -285,6 +289,7 @@ int _libssh2_dsa_sha1_sign(libssh2_dsa_ctx *dsactx,
{
DSA_SIG *sig;
int r_len, s_len, rs_pad;
(void)hash_len;
sig = DSA_do_sign(hash, SHA_DIGEST_LENGTH, dsactx);
if (!sig) {

View File

@ -161,7 +161,7 @@ static int read_asn1_length (const unsigned char *data,
return nextpos;
}
int _libssh2_pem_decode_sequence (char **data, unsigned int *datalen)
int _libssh2_pem_decode_sequence (unsigned char **data, unsigned int *datalen)
{
unsigned int len;
int lenlen;
@ -191,8 +191,8 @@ int _libssh2_pem_decode_sequence (char **data, unsigned int *datalen)
return 0;
}
int _libssh2_pem_decode_integer (char **data, unsigned int *datalen,
char **i, unsigned int *ilen)
int _libssh2_pem_decode_integer (unsigned char **data, unsigned int *datalen,
unsigned char **i, unsigned int *ilen)
{
unsigned int len;
int lenlen;