aboutsummaryrefslogtreecommitdiffstats
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
parentpo (diff)
downloadgnupg-1c684df5b89bee6a67e07e0733c5a65198a3afe5.tar.gz
gnupg-1c684df5b89bee6a67e07e0733c5a65198a3afe5.zip
Fix size_t vs int issues.
Diffstat (limited to '')
-rw-r--r--agent/ChangeLog5
-rw-r--r--agent/cvt-openpgp.c2
-rw-r--r--common/ChangeLog4
-rw-r--r--common/util.h1
-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
-rw-r--r--g13/mountinfo.c2
-rw-r--r--sm/ChangeLog4
-rw-r--r--sm/certreqgen.c2
12 files changed, 36 insertions, 13 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index 78ddf8d22..156fbdb77 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-01 Marcus Brinkmann <[email protected]>
+
+ * cvt-openpgp.c (convert_to_openpgp): Change type of N to unsigned
+ int.
+
2011-04-26 Werner Koch <[email protected]>
* cvt-openpgp.c (convert_to_openpgp): Use rfc4880 encoded S2K count.
diff --git a/agent/cvt-openpgp.c b/agent/cvt-openpgp.c
index 0f3172894..ec0fd0a89 100644
--- a/agent/cvt-openpgp.c
+++ b/agent/cvt-openpgp.c
@@ -1062,7 +1062,7 @@ convert_to_openpgp (ctrl_t ctrl, gcry_sexp_t s_key, const char *passphrase,
void *format_args_buf_ptr[1];
int format_args_buf_int[1];
void *format_args[10+2];
- size_t n;
+ unsigned int n;
gcry_sexp_t tmpkey, tmpsexp = NULL;
snprintf (countbuf, sizeof countbuf, "%lu", s2k_count);
diff --git a/common/ChangeLog b/common/ChangeLog
index d77fad586..4f8b5414f 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,7 @@
+2011-06-01 Marcus Brinkmann <[email protected]>
+
+ * util.h: Undef snprintf before redefining it.
+
2011-05-20 Werner Koch <[email protected]>
* util.h: Remove some error code substitutes.
diff --git a/common/util.h b/common/util.h
index 45bccecd2..31c2caacb 100644
--- a/common/util.h
+++ b/common/util.h
@@ -62,6 +62,7 @@
/* Due to a bug in mingw32's snprintf related to the 'l' modifier and
for increased portability we use our snprintf on all systems. */
+#undef snprintf
#define snprintf estream_snprintf
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))
diff --git a/g13/mountinfo.c b/g13/mountinfo.c
index 90b205ed5..be83de712 100644
--- a/g13/mountinfo.c
+++ b/g13/mountinfo.c
@@ -193,6 +193,6 @@ mountinfo_dump_all (void)
for (idx=0, m = mounttable; idx < mounttable_size; idx++, m++)
if (m->in_use)
log_info ("mtab[%d] %s on %s type %d rid %u%s\n",
- idx, m->container, m->mountpoint, m->conttype, m->rid,
+ (int)idx, m->container, m->mountpoint, m->conttype, m->rid,
m->flags.remove?" [remove]":"");
}
diff --git a/sm/ChangeLog b/sm/ChangeLog
index 7127fb542..a450ebd16 100644
--- a/sm/ChangeLog
+++ b/sm/ChangeLog
@@ -1,3 +1,7 @@
+2011-06-01 Marcus Brinkmann <[email protected]>
+
+ * certreqgen.c (proc_parameters): Initialize RC.
+
2011-04-25 Werner Koch <[email protected]>
* certlist.c (gpgsm_add_to_certlist): Mark classify_user_id for
diff --git a/sm/certreqgen.c b/sm/certreqgen.c
index e85447405..a5c122bf6 100644
--- a/sm/certreqgen.c
+++ b/sm/certreqgen.c
@@ -409,7 +409,7 @@ proc_parameters (ctrl_t ctrl, struct para_data_s *para,
unsigned int nbits;
char numbuf[20];
unsigned char keyparms[100];
- int rc;
+ int rc = 0;
ksba_sexp_t public;
ksba_sexp_t sigkey = NULL;
int seq;