mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Fix size_t vs int issues.
This commit is contained in:
parent
9cb6557121
commit
1c684df5b8
12 changed files with 36 additions and 13 deletions
|
@ -1,3 +1,12 @@
|
|||
2011-06-01 Marcus Brinkmann <mb@g10code.com>
|
||||
|
||||
* parse-packet.c (parse_pubkeyenc): Change type of N to size_t.
|
||||
(parse_key): Likewise.
|
||||
* seskey.c (encode_session_key): Convert nframe to int for
|
||||
debugging.
|
||||
* build-packet.c (gpg_mpi_write): Change type of N to unsigned int.
|
||||
* import.c (transfer_secret_keys): Likewise.
|
||||
|
||||
2011-04-29 Werner Koch <wk@g10code.com>
|
||||
|
||||
* keydb.c (keydb_get_keyblock, keydb_add_resource): Use gpg_error.
|
||||
|
|
|
@ -164,7 +164,7 @@ gpg_mpi_write (iobuf_t out, gcry_mpi_t a)
|
|||
|
||||
if (gcry_mpi_get_flag (a, GCRYMPI_FLAG_OPAQUE))
|
||||
{
|
||||
size_t nbits;
|
||||
unsigned int nbits;
|
||||
const void *p;
|
||||
|
||||
p = gcry_mpi_get_opaque (a, &nbits);
|
||||
|
|
|
@ -1153,7 +1153,7 @@ transfer_secret_keys (ctrl_t ctrl, struct stats_s *stats, kbnode_t sec_keyblock)
|
|||
int nskey;
|
||||
membuf_t mbuf;
|
||||
int i, j;
|
||||
size_t n;
|
||||
unsigned int n;
|
||||
void *format_args_buf_ptr[PUBKEY_MAX_NSKEY];
|
||||
int format_args_buf_int[PUBKEY_MAX_NSKEY];
|
||||
void *format_args[2*PUBKEY_MAX_NSKEY];
|
||||
|
|
|
@ -962,7 +962,6 @@ static int
|
|||
parse_pubkeyenc (IOBUF inp, int pkttype, unsigned long pktlen,
|
||||
PACKET * packet)
|
||||
{
|
||||
unsigned int n;
|
||||
int rc = 0;
|
||||
int i, ndata;
|
||||
PKT_pubkey_enc *k;
|
||||
|
@ -1009,12 +1008,13 @@ parse_pubkeyenc (IOBUF inp, int pkttype, unsigned long pktlen,
|
|||
{
|
||||
if (k->pubkey_algo == PUBKEY_ALGO_ECDH && i == 1)
|
||||
{
|
||||
rc = read_size_body (inp, pktlen, &n, k->data+i);
|
||||
size_t n;
|
||||
rc = read_size_body (inp, pktlen, &n, k->data+i);
|
||||
pktlen -= n;
|
||||
}
|
||||
else
|
||||
{
|
||||
n = pktlen;
|
||||
int n = pktlen;
|
||||
k->data[i] = mpi_read (inp, &n, 0);
|
||||
pktlen -= n;
|
||||
if (!k->data[i])
|
||||
|
@ -1890,7 +1890,6 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
|
|||
{
|
||||
gpg_error_t err = 0;
|
||||
int i, version, algorithm;
|
||||
unsigned n;
|
||||
unsigned long timestamp, expiredate, max_expiredate;
|
||||
int npkey, nskey;
|
||||
int is_v4 = 0;
|
||||
|
@ -2003,12 +2002,13 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
|
|||
if ((algorithm == PUBKEY_ALGO_ECDSA
|
||||
|| algorithm == PUBKEY_ALGO_ECDH) && (i==0 || i == 2))
|
||||
{
|
||||
err = read_size_body (inp, pktlen, &n, pk->pkey+i);
|
||||
size_t n;
|
||||
err = read_size_body (inp, pktlen, &n, pk->pkey+i);
|
||||
pktlen -= n;
|
||||
}
|
||||
else
|
||||
{
|
||||
n = pktlen;
|
||||
unsigned int n = pktlen;
|
||||
pk->pkey[i] = mpi_read (inp, &n, 0);
|
||||
pktlen -= n;
|
||||
if (!pk->pkey[i])
|
||||
|
@ -2255,7 +2255,7 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
|
|||
}
|
||||
else
|
||||
{
|
||||
n = pktlen;
|
||||
unsigned int n = pktlen;
|
||||
pk->pkey[i] = mpi_read (inp, &n, 0);
|
||||
pktlen -= n;
|
||||
if (list_mode)
|
||||
|
|
|
@ -120,7 +120,7 @@ encode_session_key (int openpgp_pk_algo, DEK *dek, unsigned int nbits)
|
|||
if (DBG_CIPHER)
|
||||
log_debug ("encode_session_key: "
|
||||
"[%d] %02x %02x %02x ... %02x %02x %02x\n",
|
||||
nframe, frame[0], frame[1], frame[2],
|
||||
(int) nframe, frame[0], frame[1], frame[2],
|
||||
frame[nframe-3], frame[nframe-2], frame[nframe-1]);
|
||||
|
||||
if (gcry_mpi_scan (&a, GCRYMPI_FMT_USG, frame, nframe, &nframe))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue