Skip to content

Commit

Permalink
Use endian-specific access functions in gssapi.c
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 26, 2015
1 parent a4cdd1e commit b9a9d6e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions gssapi.c
Expand Up @@ -198,8 +198,7 @@ int socks_gssapi_auth(struct openconnect_info *vpninfo)

pktbuf[0] = 1; /* ver */
pktbuf[1] = 1; /* mtyp */
pktbuf[2] = (out.length >> 8) & 0xff;
pktbuf[3] = out.length & 0xff;
store_be16(pktbuf + 2, out.length);
memcpy(pktbuf + 4, out.value, out.length);

free(out.value);
Expand Down Expand Up @@ -232,7 +231,7 @@ int socks_gssapi_auth(struct openconnect_info *vpninfo)
pktbuf[1]);
break;
}
in.length = (pktbuf[2] << 8) | pktbuf[3];
in.length = load_be16(pktbuf + 2);
in.value = pktbuf;

if (!in.length) {
Expand Down Expand Up @@ -269,8 +268,7 @@ int socks_gssapi_auth(struct openconnect_info *vpninfo)

pktbuf[0] = 1;
pktbuf[1] = 2;
pktbuf[2] = (out.length >> 8) & 0xff;
pktbuf[3] = out.length & 0xff;
store_be16(pktbuf + 2, out.length);
memcpy(pktbuf + 4, out.value, out.length);

free(out.value);
Expand All @@ -293,7 +291,7 @@ int socks_gssapi_auth(struct openconnect_info *vpninfo)
strerror(-i));
goto err;
}
in.length = (pktbuf[2] << 8) | pktbuf[3];
in.length = load_be16(pktbuf + 2);
in.value = pktbuf;

i = vpninfo->ssl_read(vpninfo, (void *)pktbuf, in.length);
Expand Down

0 comments on commit b9a9d6e

Please sign in to comment.