aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2011-06-01 19:43:30 +0000
committerMarcus Brinkmann <[email protected]>2011-06-01 19:43:30 +0000
commit1c684df5b89bee6a67e07e0733c5a65198a3afe5 (patch)
treeb4ab80ccb36ced3f029b415b39f9d1383b59207f /g10
parentpo (diff)
downloadgnupg-1c684df5b89bee6a67e07e0733c5a65198a3afe5.tar.gz
gnupg-1c684df5b89bee6a67e07e0733c5a65198a3afe5.zip
Fix size_t vs int issues.
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog9
-rw-r--r--g10/build-packet.c2
-rw-r--r--g10/import.c2
-rw-r--r--g10/parse-packet.c14
-rw-r--r--g10/seskey.c2
5 files changed, 19 insertions, 10 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index b8d3232bb..91d49b4ad 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,12 @@
+2011-06-01 Marcus Brinkmann <[email protected]>
+
+ * 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 <[email protected]>
* keydb.c (keydb_get_keyblock, keydb_add_resource): Use gpg_error.
diff --git a/g10/build-packet.c b/g10/build-packet.c
index 1cdf9616c..f2ef69161 100644
--- a/g10/build-packet.c
+++ b/g10/build-packet.c
@@ -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);
diff --git a/g10/import.c b/g10/import.c
index 05dfd1daa..ffbcf168f 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -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];
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 1171443f1..50786eb08 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -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)
diff --git a/g10/seskey.c b/g10/seskey.c
index b210ae063..93a809d5d 100644
--- a/g10/seskey.c
+++ b/g10/seskey.c
@@ -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))