mirror of
https://github.com/cryb-to/cryb-otp.git
synced 2025-01-07 04:01:08 +00:00
Conceal debugging printf()s.
This commit is contained in:
parent
098159c691
commit
c8c85ca0b3
1 changed files with 11 additions and 8 deletions
|
@ -301,7 +301,7 @@ rad_decode_str(const rad_attribute *ra, const uint8_t **str, size_t *len)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG_PRINTF
|
||||||
static void
|
static void
|
||||||
mxu(md5_ctx *context, const void *data, unsigned int len)
|
mxu(md5_ctx *context, const void *data, unsigned int len)
|
||||||
{
|
{
|
||||||
|
@ -315,6 +315,7 @@ mxu(md5_ctx *context, const void *data, unsigned int len)
|
||||||
}
|
}
|
||||||
#undef md5_update
|
#undef md5_update
|
||||||
#define md5_update mxu
|
#define md5_update mxu
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
handle_access_request(rad_transaction *rx)
|
handle_access_request(rad_transaction *rx)
|
||||||
|
@ -325,8 +326,6 @@ handle_access_request(rad_transaction *rx)
|
||||||
uint8_t *nextra, *end;
|
uint8_t *nextra, *end;
|
||||||
const uint8_t *user, *pass;
|
const uint8_t *user, *pass;
|
||||||
size_t userlen, passlen;
|
size_t userlen, passlen;
|
||||||
unsigned int i;
|
|
||||||
int ch;
|
|
||||||
|
|
||||||
req = &rx->request;
|
req = &rx->request;
|
||||||
rsp = &rx->response;
|
rsp = &rx->response;
|
||||||
|
@ -380,31 +379,35 @@ handle_access_request(rad_transaction *rx)
|
||||||
warnx("mssing User-Name attribute");
|
warnx("mssing User-Name attribute");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
#if DEBUG_PRINTF
|
||||||
fprintf(stderr, "user: \"");
|
fprintf(stderr, "user: \"");
|
||||||
for (i = 0; i < userlen; ++i) {
|
for (unsigned int i = 0; i < userlen; ++i) {
|
||||||
ch = user[i];
|
int ch = user[i];
|
||||||
if (ch >= 32 && ch < 127 && ch != '"')
|
if (ch >= 32 && ch < 127 && ch != '"')
|
||||||
fprintf(stderr, "%c", ch);
|
fprintf(stderr, "%c", ch);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "\\x%02x", ch);
|
fprintf(stderr, "\\x%02x", ch);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\"\n");
|
fprintf(stderr, "\"\n");
|
||||||
|
#endif
|
||||||
if (pass == NULL) {
|
if (pass == NULL) {
|
||||||
warnx("missing User-Password attribute");
|
warnx("missing User-Password attribute");
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "pass: \"");
|
|
||||||
auth_decode(req->authenticator, pass, password, passlen);
|
auth_decode(req->authenticator, pass, password, passlen);
|
||||||
while (password[passlen - 1] == '\0')
|
while (password[passlen - 1] == '\0')
|
||||||
passlen--;
|
passlen--;
|
||||||
for (i = 0; i < passlen; ++i) {
|
#if DEBUG_PRINTF
|
||||||
ch = password[i];
|
fprintf(stderr, "pass: \"");
|
||||||
|
for (unsigned int i = 0; i < passlen; ++i) {
|
||||||
|
int ch = password[i];
|
||||||
if (ch >= 32 && ch < 127 && ch != '"')
|
if (ch >= 32 && ch < 127 && ch != '"')
|
||||||
fprintf(stderr, "%c", ch);
|
fprintf(stderr, "%c", ch);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "\\x%02x", ch);
|
fprintf(stderr, "\\x%02x", ch);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\"\n");
|
fprintf(stderr, "\"\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
static int coin;
|
static int coin;
|
||||||
if ((coin = !coin)) {
|
if ((coin = !coin)) {
|
||||||
|
|
Loading…
Reference in a new issue