2022-09-09 02:02:01 +03:00
/*
claims
claim: An assertion about a security principal
From MS-ADTS:
For ease of implementation, the full IDL for the data types used for
claims is provided
2023-06-06 13:58:34 +03:00
The below was initially obtained from MS-ADTS which is
2022-09-09 02:02:01 +03:00
Copyright © 2022 Microsoft Corporation as permitted
by the Open Specifications terms reproduced in IDL_LICENCE.txt
*/
#include "idl_types.h"
[
uuid("bba9cb76-eb0c-462c-aa1b-5d8c34415701"),
version(1.0),
pointer_default(unique),
2023-03-16 09:06:04 +03:00
helpstring("Active Directory Claims"),
helper("../librpc/ndr/ndr_claims.h")
2022-09-09 02:02:01 +03:00
]
interface claims
{
#define wchar_t uint16
#define CLAIM_ID [string, charset(UTF16)] wchar_t *
2023-08-25 02:04:32 +03:00
const int CLAIM_LOWER_COMPRESSION_THRESHOLD = 368;
const int CLAIM_UPPER_COMPRESSION_THRESHOLD = 384;
2023-03-16 09:06:04 +03:00
2022-09-09 02:02:01 +03:00
typedef enum {
CLAIM_TYPE_INT64 = 1,
CLAIM_TYPE_UINT64 = 2,
CLAIM_TYPE_STRING = 3,
CLAIM_TYPE_BOOLEAN = 6
} CLAIM_TYPE;
typedef enum {
CLAIMS_SOURCE_TYPE_AD = 1,
CLAIMS_SOURCE_TYPE_CERTIFICATE = 2
} CLAIMS_SOURCE_TYPE;
typedef enum {
CLAIMS_COMPRESSION_FORMAT_NONE = 0,
CLAIMS_COMPRESSION_FORMAT_LZNT1 = 2,
CLAIMS_COMPRESSION_FORMAT_XPRESS = 3,
CLAIMS_COMPRESSION_FORMAT_XPRESS_HUFF = 4
} CLAIMS_COMPRESSION_FORMAT;
typedef struct {
2023-08-25 02:01:09 +03:00
[range(0, 10*1024*1024)] uint32 value_count;
2023-08-15 03:31:54 +03:00
[size_is(value_count)] int64 *values;
2022-09-09 02:02:01 +03:00
} CLAIM_INT64;
typedef struct {
2023-08-25 02:01:09 +03:00
[range(0, 10*1024*1024)] uint32 value_count;
2022-09-09 02:02:01 +03:00
[size_is(value_count)] hyper *values;
} CLAIM_UINT64;
typedef struct {
2023-08-25 02:01:09 +03:00
[range(0, 10*1024*1024)] uint32 value_count;
2022-09-09 02:02:01 +03:00
[size_is(value_count), string, charset(UTF16)] wchar_t **values;
} CLAIM_STRING;
2023-07-20 02:14:23 +03:00
typedef [switch_type(CLAIM_TYPE),flag(NDR_ALIGN8)] union {
2022-09-09 02:02:01 +03:00
[case(CLAIM_TYPE_INT64)] CLAIM_INT64 claim_int64;
[case(CLAIM_TYPE_UINT64)] CLAIM_UINT64 claim_uint64;
[case(CLAIM_TYPE_STRING)] CLAIM_STRING claim_string;
[case(CLAIM_TYPE_BOOLEAN)] CLAIM_UINT64 claim_boolean;
[default];
} CLAIM_ENTRY_VALUES;
typedef struct {
CLAIM_ID id;
CLAIM_TYPE type;
[switch_is(type)] CLAIM_ENTRY_VALUES values;
} CLAIM_ENTRY;
typedef struct {
CLAIMS_SOURCE_TYPE claims_source_type;
uint32 claims_count;
[size_is(claims_count)] CLAIM_ENTRY *claim_entries;
} CLAIMS_ARRAY;
typedef struct {
CLAIMS_SET_METADATA *metadata;
} CLAIMS_SET_METADATA_CTR;
typedef struct {
CLAIMS_SET *claims;
} CLAIMS_SET_CTR;
/* Public structures. */
typedef [public] struct {
uint32 claims_array_count;
[size_is(claims_array_count)] CLAIMS_ARRAY *claims_arrays;
uint16 reserved_type;
uint32 reserved_field_size;
[size_is(reserved_field_size)] uint8 *reserved_field;
} CLAIMS_SET;
2023-03-16 09:06:04 +03:00
typedef [public, gensize] struct {
2022-09-09 02:02:01 +03:00
[subcontext(0xFFFFFC01)] CLAIMS_SET_CTR claims;
} CLAIMS_SET_NDR;
typedef [public] struct {
[subcontext(0xFFFFFC01)] CLAIMS_SET_METADATA_CTR claims;
} CLAIMS_SET_METADATA_NDR;
typedef [public] struct {
2023-03-16 09:06:04 +03:00
[value(ndr_claims_compressed_size(claims_set,
r->compression_format,
ndr->flags))] uint32 claims_set_size;
[subcontext(4),
compression(ndr_claims_compression_alg(compression_format),
claims_set_size,
uncompressed_claims_set_size)
] CLAIMS_SET_NDR *claims_set;
/*
* The second argument to
* ndr_claims_actual_wire_compression_alg() in the
* value() below should be
* uncompressed_claims_set_size but the value()
* handling isn't recursive (enough) so we have to
* specify that manually otherwise the
* compression_format in the above includes the struct
* member, not the value()
*
* The caller should set compression_format to
* CLAIMS_COMPRESSION_FORMAT_XPRESS_HUFF and this will
* be reset to CLAIMS_COMPRESSION_FORMAT_NONE if the
* buffer is not large enough to compress.
*
* Otherwise setting CLAIMS_COMPRESSION_FORMAT_NONE
* disabled compression entirely.
*/
[value(ndr_claims_actual_wire_compression_alg(r->compression_format,
ndr_size_CLAIMS_SET_NDR(claims_set,
ndr->flags)))] CLAIMS_COMPRESSION_FORMAT compression_format;
[value(ndr_size_CLAIMS_SET_NDR(claims_set,
ndr->flags))] uint32 uncompressed_claims_set_size;
2022-09-09 02:02:01 +03:00
uint16 reserved_type;
uint32 reserved_field_size;
[size_is(reserved_field_size)] uint8 *reserved_field;
} CLAIMS_SET_METADATA;
}