summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2015-01-16 16:06:59 +0100
committerLinus Nordberg <linus@nordberg.se>2015-01-16 16:06:59 +0100
commitc2c7de6bf42a8598e9a482a452c1f3edb34d2c94 (patch)
treed5880ddd08420e7cd32f0f1dc1f28a64437041ca
parentedd9079229f9e9ffe496bdec9f3fc449930ce296 (diff)
Fix some issues showing when DEBUG is defined.
-rw-r--r--radsecproxy.c9
-rw-r--r--tlscommon.c2
-rw-r--r--util.c2
-rw-r--r--util.h2
4 files changed, 7 insertions, 8 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index e12846c..a074ec2 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1560,7 +1560,7 @@ int radsrv(struct request *rq) {
}
#ifdef DEBUG
- printfchars(NULL, "auth", "%02x ", auth, 16);
+ printfchars(NULL, "auth", "%02x ", msg->auth, 16);
#endif
attr = radmsg_gettype(msg, RAD_Attr_User_Password);
@@ -1625,6 +1625,9 @@ void replyh(struct server *server, unsigned char *buf) {
}
msg = buf2radmsg(buf, (uint8_t *)server->conf->secret, rqout->rq->msg->auth);
+#ifdef DEBUG
+ printfchars(NULL, "origauth/buf+4", "%02x ", buf + 4, 16);
+#endif
free(buf);
buf = NULL;
if (!msg) {
@@ -1731,10 +1734,6 @@ void replyh(struct server *server, unsigned char *buf) {
msg->id = (char)rqout->rq->rqid;
memcpy(msg->auth, rqout->rq->rqauth, 16);
-#ifdef DEBUG
- printfchars(NULL, "origauth/buf+4", "%02x ", buf + 4, 16);
-#endif
-
if (rqout->rq->origusername && (attr = radmsg_gettype(msg, RAD_Attr_User_Name))) {
if (!resizeattr(attr, strlen(rqout->rq->origusername))) {
debug(DBG_WARN, "replyh: malloc failed, ignoring reply");
diff --git a/tlscommon.c b/tlscommon.c
index 619808b..c0a6967 100644
--- a/tlscommon.c
+++ b/tlscommon.c
@@ -404,7 +404,7 @@ static int subjectaltnameregexp(X509 *cert, int type, char *exact, regex_t *reg
if (l <= 0)
continue;
#ifdef DEBUG
- printfchars(NULL, gn->type == GEN_DNS ? "dns" : "uri", NULL, v, l);
+ printfchars(NULL, gn->type == GEN_DNS ? "dns" : "uri", NULL, (uint8_t *) v, l);
#endif
if (exact) {
if (memcmp(v, exact, l))
diff --git a/util.c b/util.c
index fbd5f2a..55bf3c7 100644
--- a/util.c
+++ b/util.c
@@ -29,7 +29,7 @@ char *stringcopy(const char *s, int len) {
return r;
}
-void printfchars(char *prefixfmt, char *prefix, char *charfmt, char *chars, int len) {
+void printfchars(char *prefixfmt, char *prefix, char *charfmt, uint8_t *chars, int len) {
int i;
unsigned char *s = (unsigned char *)chars;
if (prefix)
diff --git a/util.h b/util.h
index 474e11e..924392a 100644
--- a/util.h
+++ b/util.h
@@ -17,7 +17,7 @@ char *addr2string(struct sockaddr *addr);
struct sockaddr *addr_copy(struct sockaddr *in);
void port_set(struct sockaddr *sa, uint16_t port);
-void printfchars(char *prefixfmt, char *prefix, char *charfmt, char *chars, int len);
+void printfchars(char *prefixfmt, char *prefix, char *charfmt, uint8_t *chars, int len);
void disable_DF_bit(int socket, struct addrinfo *res);
int bindtoaddr(struct addrinfo *addrinfo, int family, int reuse, int v6only);
int connecttcp(struct addrinfo *addrinfo, struct addrinfo *src, uint16_t timeout);