All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
soh.c File Reference

Implements the MS-SOH parsing code. More...

#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/soh.h>
#include <freeradius-devel/rad_assert.h>
+ Include dependency graph for soh.c:

Go to the source code of this file.

Data Structures

struct  eap_soh
 EAP-SOH packet. More...
 
struct  soh_mode_subheader
 SOH mode subheader Typical microsoft binary blob nonsense. More...
 
struct  soh_response
 SOH response payload Send by client to server. More...
 
struct  soh_tlv
 SOH type-length-value header. More...
 

Functions

static char const * clientstatus2str (uint32_t hcstatus)
 Convert windows Health Class status into human-readable string. More...
 
static int eap_peap_soh_mstlv (REQUEST *request, uint8_t const *p, unsigned int data_len)
 Parses the MS-SOH type/value (note: NOT type/length/value) data and update the sohvp list. More...
 
static char const * healthclass2str (uint8_t hc)
 Convert a Health Class into a string. More...
 
uint16_t soh_pull_be_16 (uint8_t const *p)
 Read big-endian 2-byte unsigned from p. More...
 
uint32_t soh_pull_be_24 (uint8_t const *p)
 Read big-endian 3-byte unsigned from p. More...
 
uint32_t soh_pull_be_32 (uint8_t const *p)
 Read big-endian 4-byte unsigned from p. More...
 
int soh_verify (REQUEST *request, uint8_t const *data, unsigned int data_len)
 Parse the MS-SOH response in data and update sohvp. More...
 

Detailed Description

Implements the MS-SOH parsing code.

Id:
16013ec2805fb4a532e68f9e9cc216dba3204e05

This is called from rlm_eap_peap

Definition in file soh.c.


Data Structure Documentation

struct eap_soh

EAP-SOH packet.

Definition at line 40 of file soh.c.

Data Fields
uint16_t soh_len
uint16_t soh_type ==2 for request, 1 for response
uint16_t tlv_len
uint16_t tlv_type ==7 for EAP-SOH
uint32_t tlv_vendor
struct soh_mode_subheader

SOH mode subheader Typical microsoft binary blob nonsense.

Definition at line 70 of file soh.c.

Data Fields
uint8_t content_type
uint8_t corrid[24]
uint8_t intent
uint16_t outer_len
uint16_t outer_type
uint32_t vendor
struct soh_response

SOH response payload Send by client to server.

Definition at line 58 of file soh.c.

Data Fields
uint16_t inner_len
uint16_t inner_type
uint16_t outer_len
uint16_t outer_type
uint32_t vendor
struct soh_tlv

SOH type-length-value header.

Definition at line 82 of file soh.c.

Data Fields
uint16_t tlv_len
uint16_t tlv_type

Function Documentation

static char const* clientstatus2str ( uint32_t  hcstatus)
static

Convert windows Health Class status into human-readable string.

Tedious, really, really tedious...

Definition at line 313 of file soh.c.

+ Here is the caller graph for this function:

static int eap_peap_soh_mstlv ( REQUEST request,
uint8_t const *  p,
unsigned int  data_len 
)
static

Parses the MS-SOH type/value (note: NOT type/length/value) data and update the sohvp list.

See section 2.2.4 of MS-SOH. Because there's no "length" field we CANNOT just skip unknown types; we need to know their length ahead of time. Therefore, we abort if we find an unknown type. Note that sohvp may still have been modified in the failure case.

Parameters
requestCurrent request
pbinary blob
data_lenlength of blob
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 145 of file soh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static char const* healthclass2str ( uint8_t  hc)
static

Convert a Health Class into a string.

Definition at line 353 of file soh.c.

+ Here is the caller graph for this function:

uint16_t soh_pull_be_16 ( uint8_t const *  p)

Read big-endian 2-byte unsigned from p.

caller must ensure enough data exists at "p"

Definition at line 91 of file soh.c.

+ Here is the caller graph for this function:

uint32_t soh_pull_be_24 ( uint8_t const *  p)

Read big-endian 3-byte unsigned from p.

caller must ensure enough data exists at "p"

Definition at line 104 of file soh.c.

+ Here is the caller graph for this function:

uint32_t soh_pull_be_32 ( uint8_t const *  p)

Read big-endian 4-byte unsigned from p.

caller must ensure enough data exists at "p"

Definition at line 118 of file soh.c.

+ Here is the caller graph for this function:

int soh_verify ( REQUEST request,
uint8_t const *  data,
unsigned int  data_len 
)

Parse the MS-SOH response in data and update sohvp.

Note that sohvp might still have been updated in event of a failure.

Parameters
requestCurrent request
dataMS-SOH blob
data_lenlength of MS-SOH blob
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 385 of file soh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: