From 2dd585deb6ddaa6ed66998abca285823ba099be1 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Mon, 17 Feb 2014 11:00:15 +0000 Subject: Fix compiler warnings in the format strings: use %zd for ssize_t and %zu for size_t. From Andre de Oliveira With input and OK from blambert@ markus@ --- sbin/iked/ikev2.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'sbin/iked/ikev2.c') diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c index 8c61528f8a6..95bb8f5a2c6 100644 --- a/sbin/iked/ikev2.c +++ b/sbin/iked/ikev2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ikev2.c,v 1.92 2014/02/14 09:00:03 markus Exp $ */ +/* $OpenBSD: ikev2.c,v 1.93 2014/02/17 11:00:14 reyk Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter @@ -177,7 +177,7 @@ ikev2_dispatch_ikev1(int fd, struct privsep_proc *p, struct imsg *imsg) return (0); } - log_debug("%s: message length %d", __func__, len); + log_debug("%s: message length %zd", __func__, len); ikev2_recv(env, &msg); ikev2_msg_cleanup(env, &msg); @@ -214,7 +214,7 @@ ikev2_dispatch_cert(int fd, struct privsep_proc *p, struct imsg *imsg) env->sc_certreq = ibuf_new(ptr, IMSG_DATA_SIZE(imsg) - sizeof(type)); - log_debug("%s: updated local CERTREQ type %s length %d", + log_debug("%s: updated local CERTREQ type %s length %zu", __func__, print_map(type, ikev2_cert_map), ibuf_length(env->sc_certreq)); @@ -257,7 +257,7 @@ ikev2_dispatch_cert(int fd, struct privsep_proc *p, struct imsg *imsg) type == IKEV2_CERT_NONE) ignore = 1; - log_debug("%s: cert type %s length %d, %s", __func__, + log_debug("%s: cert type %s length %zu, %s", __func__, print_map(type, ikev2_cert_map), len, ignore ? "ignored" : "ok"); @@ -292,7 +292,7 @@ ikev2_dispatch_cert(int fd, struct privsep_proc *p, struct imsg *imsg) break; } - log_debug("%s: AUTH type %d len %d", __func__, type, len); + log_debug("%s: AUTH type %d len %zu", __func__, type, len); id = &sa->sa_localauth; id->id_type = type; @@ -338,7 +338,7 @@ ikev2_getimsgdata(struct iked *env, struct imsg *imsg, struct iked_sahdr *sh, sa = sa_lookup(env, sh->sh_ispi, sh->sh_rspi, sh->sh_initiator); log_debug("%s: imsg %d rspi %s ispi %s initiator %d sa %s" - " type %d data length %d", + " type %d data length %zd", __func__, imsg->hdr.type, print_spi(sh->sh_rspi, 8), print_spi(sh->sh_ispi, 8), @@ -1128,7 +1128,7 @@ ikev2_policy2id(struct iked_static_id *polid, struct iked_id *id, int srcid) if (ikev2_print_id(id, idstr, sizeof(idstr)) == -1) return (-1); - log_debug("%s: %s %s length %d", __func__, + log_debug("%s: %s %s length %zu", __func__, srcid ? "srcid" : "dstid", idstr, ibuf_size(id->id_buf)); @@ -1350,7 +1350,7 @@ ikev2_add_certreq(struct ibuf *e, struct ikev2_payload **pld, ssize_t len, len += ibuf_size(certreq); } - log_debug("%s: type %s length %d", __func__, + log_debug("%s: type %s length %zd", __func__, print_map(type, ikev2_cert_map), len); return (len); @@ -1418,7 +1418,7 @@ ikev2_next_payload(struct ikev2_payload *pld, size_t length, return (-1); } - log_debug("%s: length %d nextpayload %s", + log_debug("%s: length %zu nextpayload %s", __func__, pldlength, print_map(nextpayload, ikev2_payload_map)); pld->pld_length = htobe16(pldlength); @@ -1718,7 +1718,7 @@ ikev2_add_proposals(struct iked *env, struct iked_sa *sa, struct ibuf *buf, length += saplength; } - log_debug("%s: length %d", __func__, length); + log_debug("%s: length %zd", __func__, length); return (length); } @@ -2764,7 +2764,7 @@ ikev2_ike_sa_alive(struct iked *env, void *arg) continue; gettimeofday(&tv, NULL); diff = (u_int32_t)(tv.tv_sec - last_used); - log_debug("%s: %s CHILD SA spi %s last used %u second(s) ago", + log_debug("%s: %s CHILD SA spi %s last used %llu second(s) ago", __func__, csa->csa_dir == IPSP_DIRECTION_IN ? "incoming" : "outgoing", print_spi(csa->csa_spi.spi, csa->csa_spi.spi_size), diff); @@ -3379,7 +3379,7 @@ ikev2_sa_keys(struct iked *env, struct iked_sa *sa, struct ibuf *key) if (dh_create_shared(group, dhsecret->buf, sa->sa_dhpeer->buf) == -1) { log_debug("%s: failed to get dh secret" - " group %d len %d secret %d exchange %d", __func__, + " group %d len %d secret %zu exchange %zu", __func__, group->id, dh_getlen(group), ibuf_length(dhsecret), ibuf_length(sa->sa_dhpeer)); goto done; @@ -3423,7 +3423,7 @@ ikev2_sa_keys(struct iked *env, struct iked_sa *sa, struct ibuf *key) hash_update(prf, dhsecret->buf, ibuf_length(dhsecret)); hash_final(prf, skeyseed->buf, &tmplen); - log_debug("%s: SKEYSEED with %d bytes", __func__, tmplen); + log_debug("%s: SKEYSEED with %zu bytes", __func__, tmplen); print_hex(skeyseed->buf, 0, tmplen); if (ibuf_setsize(skeyseed, tmplen) == -1) { @@ -3451,7 +3451,7 @@ ikev2_sa_keys(struct iked *env, struct iked_sa *sa, struct ibuf *key) goto done; } - log_debug("%s: S with %d bytes", __func__, ibuf_length(s)); + log_debug("%s: S with %zu bytes", __func__, ibuf_length(s)); print_hex(s->buf, 0, ibuf_length(s)); /* @@ -3483,25 +3483,25 @@ ikev2_sa_keys(struct iked *env, struct iked_sa *sa, struct ibuf *key) goto done; } - log_debug("%s: SK_d with %d bytes", __func__, + log_debug("%s: SK_d with %zu bytes", __func__, ibuf_length(sa->sa_key_d)); print_hex(sa->sa_key_d->buf, 0, ibuf_length(sa->sa_key_d)); - log_debug("%s: SK_ai with %d bytes", __func__, + log_debug("%s: SK_ai with %zu bytes", __func__, ibuf_length(sa->sa_key_iauth)); print_hex(sa->sa_key_iauth->buf, 0, ibuf_length(sa->sa_key_iauth)); - log_debug("%s: SK_ar with %d bytes", __func__, + log_debug("%s: SK_ar with %zu bytes", __func__, ibuf_length(sa->sa_key_rauth)); print_hex(sa->sa_key_rauth->buf, 0, ibuf_length(sa->sa_key_rauth)); - log_debug("%s: SK_ei with %d bytes", __func__, + log_debug("%s: SK_ei with %zu bytes", __func__, ibuf_length(sa->sa_key_iencr)); print_hex(sa->sa_key_iencr->buf, 0, ibuf_length(sa->sa_key_iencr)); - log_debug("%s: SK_er with %d bytes", __func__, + log_debug("%s: SK_er with %zu bytes", __func__, ibuf_length(sa->sa_key_rencr)); print_hex(sa->sa_key_rencr->buf, 0, ibuf_length(sa->sa_key_rencr)); - log_debug("%s: SK_pi with %d bytes", __func__, + log_debug("%s: SK_pi with %zu bytes", __func__, ibuf_length(sa->sa_key_iprf)); print_hex(sa->sa_key_iprf->buf, 0, ibuf_length(sa->sa_key_iprf)); - log_debug("%s: SK_pr with %d bytes", __func__, + log_debug("%s: SK_pr with %zu bytes", __func__, ibuf_length(sa->sa_key_rprf)); print_hex(sa->sa_key_rprf->buf, 0, ibuf_length(sa->sa_key_rprf)); @@ -3570,12 +3570,12 @@ ikev2_prfplus(struct iked_hash *prf, struct ibuf *key, struct ibuf *seed, ibuf_release(t2); ibuf_add(t, t1->buf, ibuf_length(t1)); - log_debug("%s: T%d with %d bytes", __func__, + log_debug("%s: T%d with %zu bytes", __func__, pad, ibuf_length(t1)); print_hex(t1->buf, 0, ibuf_length(t1)); } - log_debug("%s: Tn with %d bytes", __func__, ibuf_length(t)); + log_debug("%s: Tn with %zu bytes", __func__, ibuf_length(t)); print_hex(t->buf, 0, ibuf_length(t)); ibuf_release(t1); @@ -3661,7 +3661,7 @@ ikev2_sa_tag(struct iked_sa *sa, struct iked_id *id) } } - log_debug("%s: %s (%d)", __func__, sa->sa_tag, strlen(sa->sa_tag)); + log_debug("%s: %s (%zu)", __func__, sa->sa_tag, strlen(sa->sa_tag)); ret = 0; fail: @@ -3730,7 +3730,7 @@ ikev2_childsa_negotiate(struct iked *env, struct iked_sa *sa, int initiator) /* double key material length for inbound/outbound */ ilen *= 2; - log_debug("%s: key material length %d", __func__, ilen); + log_debug("%s: key material length %zu", __func__, ilen); if ((seed = ibuf_dup(sa->sa_inonce)) == NULL || ibuf_cat(seed, sa->sa_rnonce) != 0 || -- cgit v1.2.3