/* Note: we assume the OID will be less than 128 bytes... */
*cp++ = 0x04; *cp++ = 0x01;
- *cp++ = (gss_mech_krb5->length+2) >> 8;
- *cp++ = (gss_mech_krb5->length+2) & 0xFF;
+ store_16_be(gss_mech_krb5->length+2, cp);
+ cp += 2;
*cp++ = 0x06;
*cp++ = (gss_mech_krb5->length) & 0xFF;
memcpy(cp, gss_mech_krb5->elements, gss_mech_krb5->length);
cp += gss_mech_krb5->length;
- *cp++ = length >> 24;
- *cp++ = length >> 16;
- *cp++ = length >> 8;
- *cp++ = length & 0xFF;
+ store_32_be(length, cp);
+ cp += 4;
memcpy(cp, str, length);
free(str);
return (GSS_S_DEFECTIVE_TOKEN);
/* next 4 bytes in the name are the name length */
- nameLen = (*buf++) << 24;
- nameLen |= (*buf++ << 16);
- nameLen |= (*buf++ << 8);
- nameLen |= (*buf++);
+ nameLen = load_32_be(buf);
+ buf += 4;
/*
* we use < here because bad code in rpcsec_gss rounds up exported