Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Jun 2, 2014
1 parent cadfbd6 commit 3183500
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions src/main/radclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,42 +436,43 @@ static int radclient_init(TALLOC_CTX *ctx, rc_file_pair_t *files)
case PW_DIGEST_CNONCE:
case PW_DIGEST_NONCE_COUNT:
case PW_DIGEST_USER_NAME:
/* overlapping! */
{
DICT_ATTR const *da;
uint8_t *p, *q;

p = talloc_array(vp, uint8_t, vp->length + 2);

memcpy(p + 2, vp->vp_octets, vp->length);
p[0] = vp->da->attr - PW_DIGEST_REALM + 1;
vp->length += 2;
p[1] = vp->length;

da = dict_attrbyvalue(PW_DIGEST_ATTRIBUTES, 0);
if (!da) {
ERROR("Out of memory");
goto error;
}
vp->da = da;
/* overlapping! */
{
DICT_ATTR const *da;
uint8_t *p, *q;

p = talloc_array(vp, uint8_t, vp->length + 2);

memcpy(p + 2, vp->vp_octets, vp->length);
p[0] = vp->da->attr - PW_DIGEST_REALM + 1;
vp->length += 2;
p[1] = vp->length;

da = dict_attrbyvalue(PW_DIGEST_ATTRIBUTES, 0);
if (!da) {
ERROR("Out of memory");
goto error;
}
vp->da = da;

/*
* Re-do pairmemsteal ourselves,
* because we play games with
* vp->da, and pairmemsteal goes
* to GREAT lengths to sanitize
* and fix and change and
* double-check the various
* fields.
*/
memcpy(&q, &vp->vp_octets, sizeof(q));
talloc_free(q);
/*
* Re-do pairmemsteal ourselves,
* because we play games with
* vp->da, and pairmemsteal goes
* to GREAT lengths to sanitize
* and fix and change and
* double-check the various
* fields.
*/
memcpy(&q, &vp->vp_octets, sizeof(q));
talloc_free(q);

vp->vp_octets = talloc_steal(vp, p);
vp->type = VT_DATA;
vp->vp_octets = talloc_steal(vp, p);
vp->type = VT_DATA;

VERIFY_VP(vp);
}
VERIFY_VP(vp);
}
break;

/*
* Keep a copy of the the password attribute.
Expand Down

0 comments on commit 3183500

Please sign in to comment.