26 RCSID(
"$Id: 16013ec2805fb4a532e68f9e9cc216dba3204e05 $")
28 #include <freeradius-devel/radiusd.h>
29 #include <freeradius-devel/soh.h>
30 #include <freeradius-devel/rad_assert.h>
151 while (data_len > 0) {
161 RDEBUG(
"insufficient data for MS-Machine-Inventory-Packet");
221 RDEBUG3(
"SoH MS-Packet-Info %s vers=%i", *p & 0x10 ?
"request" :
"response", *p & 0xf);
303 RDEBUG(
"SoH Unknown MS TV %i stopping", c);
320 return "wua-missing";
323 return "wua-not-started";
326 return "wua-no-wsus-server";
329 return "wua-no-wsus-clientid";
332 return "wua-disabled";
335 return "wua-comm-failure";
339 return "not-installed";
345 return "not-started";
362 return "antispyware";
368 return "security-updates";
392 int curr_shid=-1, curr_shid_c=-1, curr_hc=-1;
427 RDEBUG(
"SoH without mode subheader");
434 memcpy(mode.
corrid, data, 24); data += 24;
443 RDEBUG3(
"SoH with mode subheader");
469 while (data_len >= 4) {
484 curr_shid_c = data[3];
485 RDEBUG2(
"SoH System-Health-ID vendor %08x component=%i", curr_shid, curr_shid_c);
495 if (curr_shid==0x137 && curr_shid_c==0) {
496 RDEBUG2(
"SoH MS type-value payload");
499 RDEBUG2(
"SoH unhandled vendor-specific TLV %08x/component=%i %i bytes payload",
500 curr_shid, curr_shid_c, tlv.
tlv_len);
510 RDEBUG2(
"SoH Health-Class %i", data[0]);
520 RDEBUG2(
"SoH Software-Version %i", data[0]);
536 RDEBUG2(
"SoH Health-Class-Status - current shid=%08x component=%i", curr_shid, curr_shid_c);
538 if (curr_shid == 0x137 && curr_shid_c == 128) {
542 RDEBUG2(
"SoH Health-Class-Status microsoft DWORD=%08x", hcstatus);
550 s =
"security-updates";
634 if (hcstatus & 0xff000000) {
646 "%s ok snoozed=%i microsoft=%i up2date=%i enabled=%i",
648 hcstatus & 0x8 ? 1 : 0,
649 hcstatus & 0x4 ? 1 : 0,
650 hcstatus & 0x2 ? 1 : 0,
651 hcstatus & 0x1 ? 1 : 0
static char const * healthclass2str(uint8_t hc)
Convert a Health Class into a string.
#define pair_make_request(_a, _b, _c)
int soh_verify(REQUEST *request, uint8_t const *data, unsigned int data_len)
Parse the MS-SOH response in data and update sohvp.
uint16_t soh_pull_be_16(uint8_t const *p)
Read big-endian 2-byte unsigned from p.
SOH response payload Send by client to server.
uint32_t soh_pull_be_24(uint8_t const *p)
Read big-endian 3-byte unsigned from p.
static char const * clientstatus2str(uint32_t hcstatus)
Convert windows Health Class status into human-readable string.
Stores an attribute, a value and various bits of other data.
uint16_t tlv_type
==7 for EAP-SOH
uint16_t soh_type
==2 for request, 1 for response
RADIUS_PACKET * packet
Incoming request.
uint32_t soh_pull_be_32(uint8_t const *p)
Read big-endian 4-byte unsigned from p.
void fr_pair_value_bstrncpy(VALUE_PAIR *vp, void const *src, size_t len)
Copy data into an "string" data type.
static int eap_peap_soh_mstlv(REQUEST *request, uint8_t const *p, unsigned int data_len) CC_HINT(nonnull)
Parses the MS-SOH type/value (note: NOT type/length/value) data and update the sohvp list...
SOH type-length-value header.
void fr_pair_value_snprintf(VALUE_PAIR *vp, char const *fmt,...) CC_HINT(format(printf
void fr_pair_value_memcpy(VALUE_PAIR *vp, uint8_t const *src, size_t len)
Copy data into an "octets" data type.