Fix compiler warnings.
This commit is contained in:
parent
2b5becfe85
commit
f2253aeee9
@ -1,5 +1,6 @@
|
|||||||
/* Copyright (C) 2006, 2007 The Written Word, Inc. All rights reserved.
|
/* Copyright (C) 2006, 2007, The Written Word, Inc.
|
||||||
* Author: Simon Josefsson
|
* Copyright (C) 2008, Simon Josefsson
|
||||||
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms,
|
* Redistribution and use in source and binary forms,
|
||||||
* with or without modification, are permitted provided
|
* with or without modification, are permitted provided
|
||||||
@ -150,10 +151,10 @@ _libssh2_rsa_new_private(libssh2_rsa_ctx ** rsa,
|
|||||||
LIBSSH2_SESSION * session,
|
LIBSSH2_SESSION * session,
|
||||||
FILE * fp, unsigned const char *passphrase)
|
FILE * fp, unsigned const char *passphrase)
|
||||||
{
|
{
|
||||||
char *data, *save_data;
|
unsigned char *data, *save_data;
|
||||||
unsigned int datalen;
|
unsigned int datalen;
|
||||||
int ret;
|
int ret;
|
||||||
char *n, *e, *d, *p, *q, *e1, *e2, *coeff;
|
unsigned char *n, *e, *d, *p, *q, *e1, *e2, *coeff;
|
||||||
unsigned int nlen, elen, dlen, plen, qlen, e1len, e2len, coefflen;
|
unsigned int nlen, elen, dlen, plen, qlen, e1len, e2len, coefflen;
|
||||||
|
|
||||||
(void) passphrase;
|
(void) passphrase;
|
||||||
@ -245,10 +246,10 @@ _libssh2_dsa_new_private(libssh2_dsa_ctx ** dsa,
|
|||||||
LIBSSH2_SESSION * session,
|
LIBSSH2_SESSION * session,
|
||||||
FILE * fp, unsigned const char *passphrase)
|
FILE * fp, unsigned const char *passphrase)
|
||||||
{
|
{
|
||||||
char *data, *save_data;
|
unsigned char *data, *save_data;
|
||||||
unsigned int datalen;
|
unsigned int datalen;
|
||||||
int ret;
|
int ret;
|
||||||
char *p, *q, *g, *y, *x;
|
unsigned char *p, *q, *g, *y, *x;
|
||||||
unsigned int plen, qlen, glen, ylen, xlen;
|
unsigned int plen, qlen, glen, ylen, xlen;
|
||||||
|
|
||||||
(void) passphrase;
|
(void) passphrase;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/* Copyright (C) 2006, 2007 The Written Word, Inc. All rights reserved.
|
/* Copyright (C) 2006, 2007, The Written Word, Inc.
|
||||||
* Author: Simon Josefsson
|
* Copyright (C) 2008, Simon Josefsson
|
||||||
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms,
|
* Redistribution and use in source and binary forms,
|
||||||
* with or without modification, are permitted provided
|
* with or without modification, are permitted provided
|
||||||
@ -174,7 +175,7 @@ int _libssh2_cipher_crypt(_libssh2_cipher_ctx * ctx,
|
|||||||
#define _libssh2_bn struct gcry_mpi
|
#define _libssh2_bn struct gcry_mpi
|
||||||
#define _libssh2_bn_ctx int
|
#define _libssh2_bn_ctx int
|
||||||
#define _libssh2_bn_ctx_new() 0
|
#define _libssh2_bn_ctx_new() 0
|
||||||
#define _libssh2_bn_ctx_free(bnctx) 0
|
#define _libssh2_bn_ctx_free(bnctx) ((void)0)
|
||||||
#define _libssh2_bn_init() gcry_mpi_new(0)
|
#define _libssh2_bn_init() gcry_mpi_new(0)
|
||||||
#define _libssh2_bn_rand(bn, bits, top, bottom) gcry_mpi_randomize (bn, bits, GCRY_WEAK_RANDOM)
|
#define _libssh2_bn_rand(bn, bits, top, bottom) gcry_mpi_randomize (bn, bits, GCRY_WEAK_RANDOM)
|
||||||
#define _libssh2_bn_mod_exp(r, a, p, m, ctx) gcry_mpi_powm (r, a, p, m)
|
#define _libssh2_bn_mod_exp(r, a, p, m, ctx) gcry_mpi_powm (r, a, p, m)
|
||||||
|
@ -49,6 +49,9 @@
|
|||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
/* The following CPP block should really only be in session.c and
|
/* The following CPP block should really only be in session.c and
|
||||||
packet.c. However, AIX have #define's for 'events' and 'revents'
|
packet.c. However, AIX have #define's for 'events' and 'revents'
|
||||||
and we are using those names in libssh2.h, so we need to include
|
and we are using those names in libssh2.h, so we need to include
|
||||||
@ -59,8 +62,6 @@
|
|||||||
http://www.mail-archive.com/libssh2-devel%40lists.sourceforge.net/msg00003.html
|
http://www.mail-archive.com/libssh2-devel%40lists.sourceforge.net/msg00003.html
|
||||||
http://www.mail-archive.com/libssh2-devel%40lists.sourceforge.net/msg00224.html
|
http://www.mail-archive.com/libssh2-devel%40lists.sourceforge.net/msg00224.html
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_POLL
|
#ifdef HAVE_POLL
|
||||||
# include <sys/poll.h>
|
# include <sys/poll.h>
|
||||||
#else
|
#else
|
||||||
@ -1194,7 +1195,7 @@ const LIBSSH2_MAC_METHOD **libssh2_mac_methods(void);
|
|||||||
int _libssh2_pem_parse(LIBSSH2_SESSION * session,
|
int _libssh2_pem_parse(LIBSSH2_SESSION * session,
|
||||||
const char *headerbegin,
|
const char *headerbegin,
|
||||||
const char *headerend,
|
const char *headerend,
|
||||||
FILE * fp, char **data, unsigned int *datalen);
|
FILE * fp, unsigned char **data, unsigned int *datalen);
|
||||||
int _libssh2_pem_decode_sequence(unsigned char **data, unsigned int *datalen);
|
int _libssh2_pem_decode_sequence(unsigned char **data, unsigned int *datalen);
|
||||||
int _libssh2_pem_decode_integer(unsigned char **data, unsigned int *datalen,
|
int _libssh2_pem_decode_integer(unsigned char **data, unsigned int *datalen,
|
||||||
unsigned char **i, unsigned int *ilen);
|
unsigned char **i, unsigned int *ilen);
|
||||||
|
10
src/pem.c
10
src/pem.c
@ -1,5 +1,6 @@
|
|||||||
/* Copyright (C) 2007 The Written Word, Inc. All rights reserved.
|
/* Copyright (C) 2007 The Written Word, Inc.
|
||||||
* Author: Simon Josefsson
|
* Copyright (C) 2008, Simon Josefsson
|
||||||
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms,
|
* Redistribution and use in source and binary forms,
|
||||||
* with or without modification, are permitted provided
|
* with or without modification, are permitted provided
|
||||||
@ -58,7 +59,7 @@ int
|
|||||||
_libssh2_pem_parse(LIBSSH2_SESSION * session,
|
_libssh2_pem_parse(LIBSSH2_SESSION * session,
|
||||||
const char *headerbegin,
|
const char *headerbegin,
|
||||||
const char *headerend,
|
const char *headerend,
|
||||||
FILE * fp, char **data, unsigned int *datalen)
|
FILE * fp, unsigned char **data, unsigned int *datalen)
|
||||||
{
|
{
|
||||||
char line[LINE_SIZE];
|
char line[LINE_SIZE];
|
||||||
char *b64data = NULL;
|
char *b64data = NULL;
|
||||||
@ -96,7 +97,8 @@ _libssh2_pem_parse(LIBSSH2_SESSION * session,
|
|||||||
}
|
}
|
||||||
} while (strcmp(line, headerend) != 0);
|
} while (strcmp(line, headerend) != 0);
|
||||||
|
|
||||||
if (libssh2_base64_decode(session, data, datalen, b64data, b64datalen)) {
|
if (libssh2_base64_decode(session, (char**) data, datalen,
|
||||||
|
b64data, b64datalen)) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user