diff options
author | Steve French <stevef@smf-t60p.smfdom> | 2008-07-24 09:35:20 -0500 |
---|---|---|
committer | Steve French <stevef@smf-t60p.smfdom> | 2008-07-24 09:35:20 -0500 |
commit | 890361db59ec293860fe2af7aaf7bdac0b7c03cb (patch) | |
tree | 58c11abc756ef22df05cac63022362f2837988e0 /source3 | |
parent | 0732750497dabb441e4657093c329f829d91d58c (diff) | |
parent | 8ea3ce5342f7ddcc0e36ff0b17d75ed74bdb6ce4 (diff) | |
download | samba-890361db59ec293860fe2af7aaf7bdac0b7c03cb.tar.gz samba-890361db59ec293860fe2af7aaf7bdac0b7c03cb.tar.bz2 samba-890361db59ec293860fe2af7aaf7bdac0b7c03cb.zip |
Merge branch 'v3-3-test' of git+ssh://sfrench@git.samba.org/data/git/samba into v33
(This used to be commit 22afe367fef35d4262d960973933023a0a5ce77d)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/librpc/gen_ndr/drsblobs.h | 68 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_drsblobs.c | 542 | ||||
-rw-r--r-- | source3/librpc/gen_ndr/ndr_drsblobs.h | 20 | ||||
-rw-r--r-- | source3/librpc/idl/drsblobs.idl | 64 | ||||
-rw-r--r-- | source3/passdb/pdb_ldap.c | 2 | ||||
-rw-r--r-- | source3/winbindd/winbindd.c | 27 | ||||
-rw-r--r-- | source3/winbindd/winbindd_proto.h | 1 |
7 files changed, 609 insertions, 115 deletions
diff --git a/source3/librpc/gen_ndr/drsblobs.h b/source3/librpc/gen_ndr/drsblobs.h index e6df05f641..c0db9e9552 100644 --- a/source3/librpc/gen_ndr/drsblobs.h +++ b/source3/librpc/gen_ndr/drsblobs.h @@ -7,7 +7,7 @@ #ifndef _HEADER_drsblobs #define _HEADER_drsblobs -#define SUPPLEMENTAL_CREDENTIALS_PREFIX ( " P" ) +#define SUPPLEMENTAL_CREDENTIALS_PREFIX ( " " ) enum drsuapi_DsAttributeId; struct replPropertyMetaData1 { @@ -149,13 +149,25 @@ struct ldapControlDirSyncCookie { struct supplementalCredentialsPackage { uint16_t name_len;/* [value(2*strlen_m(name))] */ uint16_t data_len;/* [value(strlen(data))] */ - uint16_t unknown1; + uint16_t reserved; const char *name;/* [charset(UTF16)] */ const char *data;/* [charset(DOS)] */ }; +enum supplementalCredentialsSignature +#ifndef USE_UINT_ENUMS + { + SUPPLEMENTAL_CREDENTIALS_SIGNATURE=0x0050 +} +#else + { __donnot_use_enum_supplementalCredentialsSignature=0x7FFFFFFF} +#define SUPPLEMENTAL_CREDENTIALS_SIGNATURE ( 0x0050 ) +#endif +; + struct supplementalCredentialsSubBlob { const char *prefix;/* [value(SUPPLEMENTAL_CREDENTIALS_PREFIX),charset(UTF16)] */ + enum supplementalCredentialsSignature signature;/* [value(SUPPLEMENTAL_CREDENTIALS_SIGNATURE)] */ uint16_t num_packages; struct supplementalCredentialsPackage *packages; }/* [gensize] */; @@ -179,23 +191,25 @@ struct package_PrimaryKerberosString { }; struct package_PrimaryKerberosKey { + uint16_t reserved1;/* [value(0)] */ + uint16_t reserved2;/* [value(0)] */ + uint32_t reserved3;/* [value(0)] */ uint32_t keytype; uint32_t value_len;/* [value((value?value->length:0))] */ DATA_BLOB *value;/* [relative,subcontext_size(value_len),subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */ - uint32_t unknown1;/* [value(0)] */ - uint32_t unknown2;/* [value(0)] */ }; struct package_PrimaryKerberosCtr3 { uint16_t num_keys; uint16_t num_old_keys; struct package_PrimaryKerberosString salt; - uint32_t unknown1;/* [value(0)] */ - uint32_t unknown2;/* [value(0)] */ struct package_PrimaryKerberosKey *keys; struct package_PrimaryKerberosKey *old_keys; - uint64_t *unknown3; - uint64_t *unknown3_old; + uint32_t padding1;/* [value(0)] */ + uint32_t padding2;/* [value(0)] */ + uint32_t padding3;/* [value(0)] */ + uint32_t padding4;/* [value(0)] */ + uint32_t padding5;/* [value(0)] */ }; union package_PrimaryKerberosCtr { @@ -207,6 +221,36 @@ struct package_PrimaryKerberosBlob { union package_PrimaryKerberosCtr ctr;/* [switch_is(version)] */ }/* [public] */; +struct package_PrimaryKerberosNewerKey { + uint32_t unknown1;/* [value(0)] */ + uint32_t unknown2;/* [value(0)] */ + uint32_t unknown3;/* [value(0x00001000)] */ + uint32_t keytype; + uint32_t value_len;/* [value((value?value->length:0))] */ + DATA_BLOB *value;/* [relative,subcontext_size(value_len),subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */ +}; + +struct package_PrimaryKerberosNewerCtr4 { + uint16_t num_keys; + uint16_t unknown1;/* [value(0)] */ + uint16_t num_old_keys1; + uint16_t num_old_keys2; + struct package_PrimaryKerberosString salt; + uint32_t unknown2;/* [value(0x00001000)] */ + struct package_PrimaryKerberosNewerKey *keys; + struct package_PrimaryKerberosNewerKey *old_keys1; + struct package_PrimaryKerberosNewerKey *old_keys2; +}; + +union package_PrimaryKerberosNewerCtr { + struct package_PrimaryKerberosNewerCtr4 ctr4;/* [case(4)] */ +}/* [nodiscriminant] */; + +struct package_PrimaryKerberosNewerBlob { + uint32_t version;/* [value(4)] */ + union package_PrimaryKerberosNewerCtr ctr;/* [switch_is(version)] */ +}/* [public] */; + struct package_PrimaryCLEARTEXTBlob { const char * cleartext;/* [flag(LIBNDR_FLAG_STR_NOTERM|LIBNDR_FLAG_REMAINING)] */ }/* [public] */; @@ -354,6 +398,14 @@ struct decode_PrimaryKerberos { }; +struct decode_PrimaryKerberosNewer { + struct { + struct package_PrimaryKerberosNewerBlob blob; + } in; + +}; + + struct decode_PrimaryCLEARTEXT { struct { struct package_PrimaryCLEARTEXTBlob blob; diff --git a/source3/librpc/gen_ndr/ndr_drsblobs.c b/source3/librpc/gen_ndr/ndr_drsblobs.c index 1c86a2660b..72922987bf 100644 --- a/source3/librpc/gen_ndr/ndr_drsblobs.c +++ b/source3/librpc/gen_ndr/ndr_drsblobs.c @@ -1200,7 +1200,7 @@ static enum ndr_err_code ndr_push_supplementalCredentialsPackage(struct ndr_push NDR_CHECK(ndr_push_align(ndr, 2)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 2 * strlen_m(r->name))); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen(r->data))); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->unknown1)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved)); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, 2 * strlen_m(r->name), sizeof(uint8_t), CH_UTF16)); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data, strlen(r->data), sizeof(uint8_t), CH_DOS)); } @@ -1215,7 +1215,7 @@ static enum ndr_err_code ndr_pull_supplementalCredentialsPackage(struct ndr_pull NDR_CHECK(ndr_pull_align(ndr, 2)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->name_len)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->data_len)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved)); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, r->name_len, sizeof(uint8_t), CH_UTF16)); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data, r->data_len, sizeof(uint8_t), CH_DOS)); } @@ -1230,18 +1230,58 @@ _PUBLIC_ void ndr_print_supplementalCredentialsPackage(struct ndr_print *ndr, co ndr->depth++; ndr_print_uint16(ndr, "name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m(r->name):r->name_len); ndr_print_uint16(ndr, "data_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen(r->data):r->data_len); - ndr_print_uint16(ndr, "unknown1", r->unknown1); + ndr_print_uint16(ndr, "reserved", r->reserved); ndr_print_string(ndr, "name", r->name); ndr_print_string(ndr, "data", r->data); ndr->depth--; } +static enum ndr_err_code ndr_push_supplementalCredentialsSignature(struct ndr_push *ndr, int ndr_flags, enum supplementalCredentialsSignature r) +{ + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_supplementalCredentialsSignature(struct ndr_pull *ndr, int ndr_flags, enum supplementalCredentialsSignature *r) +{ + uint16_t v; + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + ndr->flags = _flags_save_ENUM; + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_supplementalCredentialsSignature(struct ndr_print *ndr, const char *name, enum supplementalCredentialsSignature r) +{ + const char *val = NULL; + + { + uint32_t _flags_save_ENUM = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + switch (r) { + case SUPPLEMENTAL_CREDENTIALS_SIGNATURE: val = "SUPPLEMENTAL_CREDENTIALS_SIGNATURE"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); + ndr->flags = _flags_save_ENUM; + } +} + static enum ndr_err_code ndr_push_supplementalCredentialsSubBlob(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsSubBlob *r) { uint32_t cntr_packages_0; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 2)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, SUPPLEMENTAL_CREDENTIALS_PREFIX, 0x31, sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, SUPPLEMENTAL_CREDENTIALS_PREFIX, 0x30, sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_push_supplementalCredentialsSignature(ndr, NDR_SCALARS, SUPPLEMENTAL_CREDENTIALS_SIGNATURE)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_packages)); for (cntr_packages_0 = 0; cntr_packages_0 < r->num_packages; cntr_packages_0++) { NDR_CHECK(ndr_push_supplementalCredentialsPackage(ndr, NDR_SCALARS, &r->packages[cntr_packages_0])); @@ -1258,7 +1298,8 @@ static enum ndr_err_code ndr_pull_supplementalCredentialsSubBlob(struct ndr_pull TALLOC_CTX *_mem_save_packages_0; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 2)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->prefix, 0x31, sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->prefix, 0x30, sizeof(uint16_t), CH_UTF16)); + NDR_CHECK(ndr_pull_supplementalCredentialsSignature(ndr, NDR_SCALARS, &r->signature)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_packages)); NDR_PULL_ALLOC_N(ndr, r->packages, r->num_packages); _mem_save_packages_0 = NDR_PULL_GET_MEM_CTX(ndr); @@ -1279,6 +1320,7 @@ _PUBLIC_ void ndr_print_supplementalCredentialsSubBlob(struct ndr_print *ndr, co ndr_print_struct(ndr, name, "supplementalCredentialsSubBlob"); ndr->depth++; ndr_print_string(ndr, "prefix", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?SUPPLEMENTAL_CREDENTIALS_PREFIX:r->prefix); + ndr_print_supplementalCredentialsSignature(ndr, "signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?SUPPLEMENTAL_CREDENTIALS_SIGNATURE:r->signature); ndr_print_uint16(ndr, "num_packages", r->num_packages); ndr->print(ndr, "%s: ARRAY(%d)", "packages", (int)r->num_packages); ndr->depth++; @@ -1487,6 +1529,9 @@ static enum ndr_err_code ndr_push_package_PrimaryKerberosKey(struct ndr_push *nd { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keytype)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (r->value?r->value->length:0))); { @@ -1495,8 +1540,6 @@ static enum ndr_err_code ndr_push_package_PrimaryKerberosKey(struct ndr_push *nd NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value)); ndr->flags = _flags_save_DATA_BLOB; } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); } if (ndr_flags & NDR_BUFFERS) { { @@ -1523,6 +1566,9 @@ static enum ndr_err_code ndr_pull_package_PrimaryKerberosKey(struct ndr_pull *nd TALLOC_CTX *_mem_save_value_0; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved1)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved3)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keytype)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value_len)); { @@ -1537,8 +1583,6 @@ static enum ndr_err_code ndr_pull_package_PrimaryKerberosKey(struct ndr_pull *nd } ndr->flags = _flags_save_DATA_BLOB; } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); } if (ndr_flags & NDR_BUFFERS) { { @@ -1569,6 +1613,9 @@ _PUBLIC_ void ndr_print_package_PrimaryKerberosKey(struct ndr_print *ndr, const { ndr_print_struct(ndr, name, "package_PrimaryKerberosKey"); ndr->depth++; + ndr_print_uint16(ndr, "reserved1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved1); + ndr_print_uint16(ndr, "reserved2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved2); + ndr_print_uint32(ndr, "reserved3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved3); ndr_print_uint32(ndr, "keytype", r->keytype); ndr_print_uint32(ndr, "value_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?(r->value?r->value->length:0):r->value_len); ndr_print_ptr(ndr, "value", r->value); @@ -1577,8 +1624,6 @@ _PUBLIC_ void ndr_print_package_PrimaryKerberosKey(struct ndr_print *ndr, const ndr_print_DATA_BLOB(ndr, "value", *r->value); } ndr->depth--; - ndr_print_uint32(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown1); - ndr_print_uint32(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown2); ndr->depth--; } @@ -1586,27 +1631,22 @@ static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr3(struct ndr_push *n { uint32_t cntr_keys_0; uint32_t cntr_old_keys_0; - uint32_t cntr_unknown3_0; - uint32_t cntr_unknown3_old_0; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_keys)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_old_keys)); NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { NDR_CHECK(ndr_push_package_PrimaryKerberosKey(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); } for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { NDR_CHECK(ndr_push_package_PrimaryKerberosKey(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); } - for (cntr_unknown3_0 = 0; cntr_unknown3_0 < r->num_keys; cntr_unknown3_0++) { - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->unknown3[cntr_unknown3_0])); - } - for (cntr_unknown3_old_0 = 0; cntr_unknown3_old_0 < r->num_old_keys; cntr_unknown3_old_0++) { - NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS, r->unknown3_old[cntr_unknown3_old_0])); - } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); @@ -1626,17 +1666,11 @@ static enum ndr_err_code ndr_pull_package_PrimaryKerberosCtr3(struct ndr_pull *n TALLOC_CTX *_mem_save_keys_0; uint32_t cntr_old_keys_0; TALLOC_CTX *_mem_save_old_keys_0; - uint32_t cntr_unknown3_0; - TALLOC_CTX *_mem_save_unknown3_0; - uint32_t cntr_unknown3_old_0; - TALLOC_CTX *_mem_save_unknown3_old_0; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_keys)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_old_keys)); NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); NDR_PULL_ALLOC_N(ndr, r->keys, r->num_keys); _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); @@ -1651,20 +1685,11 @@ static enum ndr_err_code ndr_pull_package_PrimaryKerberosCtr3(struct ndr_pull *n NDR_CHECK(ndr_pull_package_PrimaryKerberosKey(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys_0, 0); - NDR_PULL_ALLOC_N(ndr, r->unknown3, r->num_keys); - _mem_save_unknown3_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->unknown3, 0); - for (cntr_unknown3_0 = 0; cntr_unknown3_0 < r->num_keys; cntr_unknown3_0++) { - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->unknown3[cntr_unknown3_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown3_0, 0); - NDR_PULL_ALLOC_N(ndr, r->unknown3_old, r->num_old_keys); - _mem_save_unknown3_old_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->unknown3_old, 0); - for (cntr_unknown3_old_0 = 0; cntr_unknown3_old_0 < r->num_old_keys; cntr_unknown3_old_0++) { - NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->unknown3_old[cntr_unknown3_old_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unknown3_old_0, 0); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->padding5)); } if (ndr_flags & NDR_BUFFERS) { NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); @@ -1688,15 +1713,11 @@ _PUBLIC_ void ndr_print_package_PrimaryKerberosCtr3(struct ndr_print *ndr, const { uint32_t cntr_keys_0; uint32_t cntr_old_keys_0; - uint32_t cntr_unknown3_0; - uint32_t cntr_unknown3_old_0; ndr_print_struct(ndr, name, "package_PrimaryKerberosCtr3"); ndr->depth++; ndr_print_uint16(ndr, "num_keys", r->num_keys); ndr_print_uint16(ndr, "num_old_keys", r->num_old_keys); ndr_print_package_PrimaryKerberosString(ndr, "salt", &r->salt); - ndr_print_uint32(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown1); - ndr_print_uint32(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown2); ndr->print(ndr, "%s: ARRAY(%d)", "keys", (int)r->num_keys); ndr->depth++; for (cntr_keys_0=0;cntr_keys_0<r->num_keys;cntr_keys_0++) { @@ -1717,26 +1738,11 @@ _PUBLIC_ void ndr_print_package_PrimaryKerberosCtr3(struct ndr_print *ndr, const } } ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "unknown3", (int)r->num_keys); - ndr->depth++; - for (cntr_unknown3_0=0;cntr_unknown3_0<r->num_keys;cntr_unknown3_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_unknown3_0) != -1) { - ndr_print_udlong(ndr, "unknown3", r->unknown3[cntr_unknown3_0]); - free(idx_0); - } - } - ndr->depth--; - ndr->print(ndr, "%s: ARRAY(%d)", "unknown3_old", (int)r->num_old_keys); - ndr->depth++; - for (cntr_unknown3_old_0=0;cntr_unknown3_old_0<r->num_old_keys;cntr_unknown3_old_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_unknown3_old_0) != -1) { - ndr_print_udlong(ndr, "unknown3_old", r->unknown3_old[cntr_unknown3_old_0]); - free(idx_0); - } - } - ndr->depth--; + ndr_print_uint32(ndr, "padding1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding1); + ndr_print_uint32(ndr, "padding2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding2); + ndr_print_uint32(ndr, "padding3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding3); + ndr_print_uint32(ndr, "padding4", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding4); + ndr_print_uint32(ndr, "padding5", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->padding5); ndr->depth--; } @@ -1847,6 +1853,361 @@ _PUBLIC_ void ndr_print_package_PrimaryKerberosBlob(struct ndr_print *ndr, const ndr->depth--; } +static enum ndr_err_code ndr_push_package_PrimaryKerberosNewerKey(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosNewerKey *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x00001000)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->keytype)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, (r->value?r->value->length:0))); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value)); + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (r->value) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value)); + { + struct ndr_push *_ndr_value; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_value, 0, (r->value?r->value->length:0))); + NDR_CHECK(ndr_push_DATA_BLOB(_ndr_value, NDR_SCALARS, *r->value)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_value, 0, (r->value?r->value->length:0))); + } + } + ndr->flags = _flags_save_DATA_BLOB; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryKerberosNewerKey(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosNewerKey *r) +{ + uint32_t _ptr_value; + TALLOC_CTX *_mem_save_value_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown3)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->keytype)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value_len)); + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value)); + if (_ptr_value) { + NDR_PULL_ALLOC(ndr, r->value); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value, _ptr_value)); + } else { + r->value = NULL; + } + ndr->flags = _flags_save_DATA_BLOB; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_DATA_BLOB = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); + if (r->value) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value)); + _mem_save_value_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->value, 0); + { + struct ndr_pull *_ndr_value; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_value, 0, r->value_len)); + NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_value, NDR_SCALARS, r->value)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_value, 0, r->value_len)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_DATA_BLOB; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosNewerKey(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosNewerKey *r) +{ + ndr_print_struct(ndr, name, "package_PrimaryKerberosNewerKey"); + ndr->depth++; + ndr_print_uint32(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown1); + ndr_print_uint32(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown2); + ndr_print_uint32(ndr, "unknown3", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x00001000:r->unknown3); + ndr_print_uint32(ndr, "keytype", r->keytype); + ndr_print_uint32(ndr, "value_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?(r->value?r->value->length:0):r->value_len); + ndr_print_ptr(ndr, "value", r->value); + ndr->depth++; + if (r->value) { + ndr_print_DATA_BLOB(ndr, "value", *r->value); + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_package_PrimaryKerberosNewerCtr4(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosNewerCtr4 *r) +{ + uint32_t cntr_keys_0; + uint32_t cntr_old_keys1_0; + uint32_t cntr_old_keys2_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_keys)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_old_keys1)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_old_keys2)); + NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0x00001000)); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerKey(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); + } + for (cntr_old_keys1_0 = 0; cntr_old_keys1_0 < r->num_old_keys1; cntr_old_keys1_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerKey(ndr, NDR_SCALARS, &r->old_keys1[cntr_old_keys1_0])); + } + for (cntr_old_keys2_0 = 0; cntr_old_keys2_0 < r->num_old_keys2; cntr_old_keys2_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerKey(ndr, NDR_SCALARS, &r->old_keys2[cntr_old_keys2_0])); + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerKey(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); + } + for (cntr_old_keys1_0 = 0; cntr_old_keys1_0 < r->num_old_keys1; cntr_old_keys1_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerKey(ndr, NDR_BUFFERS, &r->old_keys1[cntr_old_keys1_0])); + } + for (cntr_old_keys2_0 = 0; cntr_old_keys2_0 < r->num_old_keys2; cntr_old_keys2_0++) { + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerKey(ndr, NDR_BUFFERS, &r->old_keys2[cntr_old_keys2_0])); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryKerberosNewerCtr4(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosNewerCtr4 *r) +{ + uint32_t cntr_keys_0; + TALLOC_CTX *_mem_save_keys_0; + uint32_t cntr_old_keys1_0; + TALLOC_CTX *_mem_save_old_keys1_0; + uint32_t cntr_old_keys2_0; + TALLOC_CTX *_mem_save_old_keys2_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_keys)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->unknown1)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_old_keys1)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_old_keys2)); + NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_SCALARS, &r->salt)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2)); + NDR_PULL_ALLOC_N(ndr, r->keys, r->num_keys); + _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerKey(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); + NDR_PULL_ALLOC_N(ndr, r->old_keys1, r->num_old_keys1); + _mem_save_old_keys1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->old_keys1, 0); + for (cntr_old_keys1_0 = 0; cntr_old_keys1_0 < r->num_old_keys1; cntr_old_keys1_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerKey(ndr, NDR_SCALARS, &r->old_keys1[cntr_old_keys1_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys1_0, 0); + NDR_PULL_ALLOC_N(ndr, r->old_keys2, r->num_old_keys2); + _mem_save_old_keys2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->old_keys2, 0); + for (cntr_old_keys2_0 = 0; cntr_old_keys2_0 < r->num_old_keys2; cntr_old_keys2_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerKey(ndr, NDR_SCALARS, &r->old_keys2[cntr_old_keys2_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys2_0, 0); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosString(ndr, NDR_BUFFERS, &r->salt)); + _mem_save_keys_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->keys, 0); + for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerKey(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keys_0, 0); + _mem_save_old_keys1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->old_keys1, 0); + for (cntr_old_keys1_0 = 0; cntr_old_keys1_0 < r->num_old_keys1; cntr_old_keys1_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerKey(ndr, NDR_BUFFERS, &r->old_keys1[cntr_old_keys1_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys1_0, 0); + _mem_save_old_keys2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->old_keys2, 0); + for (cntr_old_keys2_0 = 0; cntr_old_keys2_0 < r->num_old_keys2; cntr_old_keys2_0++) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerKey(ndr, NDR_BUFFERS, &r->old_keys2[cntr_old_keys2_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_old_keys2_0, 0); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosNewerCtr4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosNewerCtr4 *r) +{ + uint32_t cntr_keys_0; + uint32_t cntr_old_keys1_0; + uint32_t cntr_old_keys2_0; + ndr_print_struct(ndr, name, "package_PrimaryKerberosNewerCtr4"); + ndr->depth++; + ndr_print_uint16(ndr, "num_keys", r->num_keys); + ndr_print_uint16(ndr, "unknown1", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->unknown1); + ndr_print_uint16(ndr, "num_old_keys1", r->num_old_keys1); + ndr_print_uint16(ndr, "num_old_keys2", r->num_old_keys2); + ndr_print_package_PrimaryKerberosString(ndr, "salt", &r->salt); + ndr_print_uint32(ndr, "unknown2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0x00001000:r->unknown2); + ndr->print(ndr, "%s: ARRAY(%d)", "keys", (int)r->num_keys); + ndr->depth++; + for (cntr_keys_0=0;cntr_keys_0<r->num_keys;cntr_keys_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_keys_0) != -1) { + ndr_print_package_PrimaryKerberosNewerKey(ndr, "keys", &r->keys[cntr_keys_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "old_keys1", (int)r->num_old_keys1); + ndr->depth++; + for (cntr_old_keys1_0=0;cntr_old_keys1_0<r->num_old_keys1;cntr_old_keys1_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_old_keys1_0) != -1) { + ndr_print_package_PrimaryKerberosNewerKey(ndr, "old_keys1", &r->old_keys1[cntr_old_keys1_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->print(ndr, "%s: ARRAY(%d)", "old_keys2", (int)r->num_old_keys2); + ndr->depth++; + for (cntr_old_keys2_0=0;cntr_old_keys2_0<r->num_old_keys2;cntr_old_keys2_0++) { + char *idx_0=NULL; + if (asprintf(&idx_0, "[%d]", cntr_old_keys2_0) != -1) { + ndr_print_package_PrimaryKerberosNewerKey(ndr, "old_keys2", &r->old_keys2[cntr_old_keys2_0]); + free(idx_0); + } + } + ndr->depth--; + ndr->depth--; +} + +static enum ndr_err_code ndr_push_package_PrimaryKerberosNewerCtr(struct ndr_push *ndr, int ndr_flags, const union package_PrimaryKerberosNewerCtr *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 4: { + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerCtr4(ndr, NDR_SCALARS, &r->ctr4)); + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 4: + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerCtr4(ndr, NDR_BUFFERS, &r->ctr4)); + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_package_PrimaryKerberosNewerCtr(struct ndr_pull *ndr, int ndr_flags, union package_PrimaryKerberosNewerCtr *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 4: { + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerCtr4(ndr, NDR_SCALARS, &r->ctr4)); + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 4: + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerCtr4(ndr, NDR_BUFFERS, &r->ctr4)); + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosNewerCtr(struct ndr_print *ndr, const char *name, const union package_PrimaryKerberosNewerCtr *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "package_PrimaryKerberosNewerCtr"); + switch (level) { + case 4: + ndr_print_package_PrimaryKerberosNewerCtr4(ndr, "ctr4", &r->ctr4); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + +_PUBLIC_ enum ndr_err_code ndr_push_package_PrimaryKerberosNewerBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosNewerBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 4)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->ctr, 4)); + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_package_PrimaryKerberosNewerBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosNewerBlob *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->ctr, r->version)); + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerCtr(ndr, NDR_SCALARS, &r->ctr)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerCtr(ndr, NDR_BUFFERS, &r->ctr)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_package_PrimaryKerberosNewerBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosNewerBlob *r) +{ + ndr_print_struct(ndr, name, "package_PrimaryKerberosNewerBlob"); + ndr->depth++; + ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?4:r->version); + ndr_print_set_switch_value(ndr, &r->ctr, r->version); + ndr_print_package_PrimaryKerberosNewerCtr(ndr, "ctr", &r->ctr); + ndr->depth--; +} + _PUBLIC_ enum ndr_err_code ndr_push_package_PrimaryCLEARTEXTBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryCLEARTEXTBlob *r) { if (ndr_flags & NDR_SCALARS) { @@ -2915,6 +3276,47 @@ _PUBLIC_ void ndr_print_decode_PrimaryKerberos(struct ndr_print *ndr, const char ndr->depth--; } +static enum ndr_err_code ndr_push_decode_PrimaryKerberosNewer(struct ndr_push *ndr, int flags, const struct decode_PrimaryKerberosNewer *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_package_PrimaryKerberosNewerBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_decode_PrimaryKerberosNewer(struct ndr_pull *ndr, int flags, struct decode_PrimaryKerberosNewer *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_pull_package_PrimaryKerberosNewerBlob(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.blob)); + } + if (flags & NDR_OUT) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_decode_PrimaryKerberosNewer(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryKerberosNewer *r) +{ + ndr_print_struct(ndr, name, "decode_PrimaryKerberosNewer"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "decode_PrimaryKerberosNewer"); + ndr->depth++; + ndr_print_package_PrimaryKerberosNewerBlob(ndr, "blob", &r->in.blob); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "decode_PrimaryKerberosNewer"); + ndr->depth++; + ndr->depth--; + } + ndr->depth--; +} + static enum ndr_err_code ndr_push_decode_PrimaryCLEARTEXT(struct ndr_push *ndr, int flags, const struct decode_PrimaryCLEARTEXT *r) { if (flags & NDR_IN) { @@ -3153,6 +3555,14 @@ static const struct ndr_interface_call drsblobs_calls[] = { false, }, { + "decode_PrimaryKerberosNewer", + sizeof(struct decode_PrimaryKerberosNewer), + (ndr_push_flags_fn_t) ndr_push_decode_PrimaryKerberosNewer, + (ndr_pull_flags_fn_t) ndr_pull_decode_PrimaryKerberosNewer, + (ndr_print_function_t) ndr_print_decode_PrimaryKerberosNewer, + false, + }, + { "decode_PrimaryCLEARTEXT", sizeof(struct decode_PrimaryCLEARTEXT), (ndr_push_flags_fn_t) ndr_push_decode_PrimaryCLEARTEXT, @@ -3213,7 +3623,7 @@ const struct ndr_interface_table ndr_table_drsblobs = { NDR_DRSBLOBS_VERSION }, .helpstring = NDR_DRSBLOBS_HELPSTRING, - .num_calls = 13, + .num_calls = 14, .calls = drsblobs_calls, .endpoints = &drsblobs_endpoints, .authservices = &drsblobs_authservices diff --git a/source3/librpc/gen_ndr/ndr_drsblobs.h b/source3/librpc/gen_ndr/ndr_drsblobs.h index e30dbd8ba5..c80d7e0475 100644 --- a/source3/librpc/gen_ndr/ndr_drsblobs.h +++ b/source3/librpc/gen_ndr/ndr_drsblobs.h @@ -29,15 +29,17 @@ extern const struct ndr_interface_table ndr_table_drsblobs; #define NDR_DECODE_PRIMARYKERBEROS (0x08) -#define NDR_DECODE_PRIMARYCLEARTEXT (0x09) +#define NDR_DECODE_PRIMARYKERBEROSNEWER (0x09) -#define NDR_DECODE_PRIMARYWDIGEST (0x0a) +#define NDR_DECODE_PRIMARYCLEARTEXT (0x0a) -#define NDR_DECODE_TRUSTAUTHINOUT (0x0b) +#define NDR_DECODE_PRIMARYWDIGEST (0x0b) -#define NDR_DECODE_DSCOMPRESSED (0x0c) +#define NDR_DECODE_TRUSTAUTHINOUT (0x0c) -#define NDR_DRSBLOBS_CALL_COUNT (13) +#define NDR_DECODE_DSCOMPRESSED (0x0d) + +#define NDR_DRSBLOBS_CALL_COUNT (14) void ndr_print_replPropertyMetaData1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaData1 *r); void ndr_print_replPropertyMetaDataCtr1(struct ndr_print *ndr, const char *name, const struct replPropertyMetaDataCtr1 *r); void ndr_print_replPropertyMetaDataCtr(struct ndr_print *ndr, const char *name, const union replPropertyMetaDataCtr *r); @@ -78,6 +80,7 @@ enum ndr_err_code ndr_push_ldapControlDirSyncCookie(struct ndr_push *ndr, int nd enum ndr_err_code ndr_pull_ldapControlDirSyncCookie(struct ndr_pull *ndr, int ndr_flags, struct ldapControlDirSyncCookie *r); void ndr_print_ldapControlDirSyncCookie(struct ndr_print *ndr, const char *name, const struct ldapControlDirSyncCookie *r); void ndr_print_supplementalCredentialsPackage(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsPackage *r); +void ndr_print_supplementalCredentialsSignature(struct ndr_print *ndr, const char *name, enum supplementalCredentialsSignature r); void ndr_print_supplementalCredentialsSubBlob(struct ndr_print *ndr, const char *name, const struct supplementalCredentialsSubBlob *r); enum ndr_err_code ndr_push_supplementalCredentialsBlob(struct ndr_push *ndr, int ndr_flags, const struct supplementalCredentialsBlob *r); enum ndr_err_code ndr_pull_supplementalCredentialsBlob(struct ndr_pull *ndr, int ndr_flags, struct supplementalCredentialsBlob *r); @@ -92,6 +95,12 @@ void ndr_print_package_PrimaryKerberosCtr(struct ndr_print *ndr, const char *nam enum ndr_err_code ndr_push_package_PrimaryKerberosBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosBlob *r); enum ndr_err_code ndr_pull_package_PrimaryKerberosBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosBlob *r); void ndr_print_package_PrimaryKerberosBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosBlob *r); +void ndr_print_package_PrimaryKerberosNewerKey(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosNewerKey *r); +void ndr_print_package_PrimaryKerberosNewerCtr4(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosNewerCtr4 *r); +void ndr_print_package_PrimaryKerberosNewerCtr(struct ndr_print *ndr, const char *name, const union package_PrimaryKerberosNewerCtr *r); +enum ndr_err_code ndr_push_package_PrimaryKerberosNewerBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosNewerBlob *r); +enum ndr_err_code ndr_pull_package_PrimaryKerberosNewerBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryKerberosNewerBlob *r); +void ndr_print_package_PrimaryKerberosNewerBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryKerberosNewerBlob *r); enum ndr_err_code ndr_push_package_PrimaryCLEARTEXTBlob(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryCLEARTEXTBlob *r); enum ndr_err_code ndr_pull_package_PrimaryCLEARTEXTBlob(struct ndr_pull *ndr, int ndr_flags, struct package_PrimaryCLEARTEXTBlob *r); void ndr_print_package_PrimaryCLEARTEXTBlob(struct ndr_print *ndr, const char *name, const struct package_PrimaryCLEARTEXTBlob *r); @@ -123,6 +132,7 @@ void ndr_print_decode_ldapControlDirSync(struct ndr_print *ndr, const char *name void ndr_print_decode_supplementalCredentials(struct ndr_print *ndr, const char *name, int flags, const struct decode_supplementalCredentials *r); void ndr_print_decode_Packages(struct ndr_print *ndr, const char *name, int flags, const struct decode_Packages *r); void ndr_print_decode_PrimaryKerberos(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryKerberos *r); +void ndr_print_decode_PrimaryKerberosNewer(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryKerberosNewer *r); void ndr_print_decode_PrimaryCLEARTEXT(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryCLEARTEXT *r); void ndr_print_decode_PrimaryWDigest(struct ndr_print *ndr, const char *name, int flags, const struct decode_PrimaryWDigest *r); void ndr_print_decode_trustAuthInOut(struct ndr_print *ndr, const char *name, int flags, const struct decode_trustAuthInOut *r); diff --git a/source3/librpc/idl/drsblobs.idl b/source3/librpc/idl/drsblobs.idl index 03cd190580..2d82976f4d 100644 --- a/source3/librpc/idl/drsblobs.idl +++ b/source3/librpc/idl/drsblobs.idl @@ -205,7 +205,7 @@ interface drsblobs { typedef struct { [value(2*strlen_m(name))] uint16 name_len; [value(strlen(data))] uint16 data_len; - uint16 unknown1; /* 2 for name = 'Packages', 1 for name = 'Primary:*' */ + uint16 reserved; /* 2 for 'Packages', 1 for 'Primary:*', but should be ignored */ [charset(UTF16)] uint8 name[name_len]; /* * the data field contains data as HEX strings @@ -215,6 +215,9 @@ interface drsblobs { * as non termiated UTF16 strings with * a UTF16 NULL byte as separator * + * 'Primary:Kerberos-Newer-Keys': + * ... + * * 'Primary:Kerberos': * ... * @@ -228,11 +231,16 @@ interface drsblobs { [charset(DOS)] uint8 data[data_len]; } supplementalCredentialsPackage; - /* this are 0x30 (48) whitespaces (0x20) followed by 'P' (0x50) */ - const string SUPPLEMENTAL_CREDENTIALS_PREFIX = " P"; + /* this are 0x30 (48) whitespaces (0x20) */ + const string SUPPLEMENTAL_CREDENTIALS_PREFIX = " "; + + typedef [flag(NDR_PAHEX)] enum { + SUPPLEMENTAL_CREDENTIALS_SIGNATURE = 0x0050 + } supplementalCredentialsSignature; typedef [gensize] struct { - [value(SUPPLEMENTAL_CREDENTIALS_PREFIX),charset(UTF16)] uint16 prefix[0x31]; + [value(SUPPLEMENTAL_CREDENTIALS_PREFIX),charset(UTF16)] uint16 prefix[0x30]; + [value(SUPPLEMENTAL_CREDENTIALS_SIGNATURE)] supplementalCredentialsSignature signature; uint16 num_packages; supplementalCredentialsPackage packages[num_packages]; } supplementalCredentialsSubBlob; @@ -264,23 +272,25 @@ interface drsblobs { } package_PrimaryKerberosString; typedef struct { + [value(0)] uint16 reserved1; + [value(0)] uint16 reserved2; + [value(0)] uint32 reserved3; uint32 keytype; [value((value?value->length:0))] uint32 value_len; [relative,subcontext(0),subcontext_size(value_len),flag(NDR_REMAINING)] DATA_BLOB *value; - [value(0)] uint32 unknown1; - [value(0)] uint32 unknown2; } package_PrimaryKerberosKey; typedef struct { uint16 num_keys; uint16 num_old_keys; package_PrimaryKerberosString salt; - [value(0)] uint32 unknown1; - [value(0)] uint32 unknown2; package_PrimaryKerberosKey keys[num_keys]; package_PrimaryKerberosKey old_keys[num_old_keys]; - udlong unknown3[num_keys]; - udlong unknown3_old[num_old_keys]; + [value(0)] uint32 padding1; + [value(0)] uint32 padding2; + [value(0)] uint32 padding3; + [value(0)] uint32 padding4; + [value(0)] uint32 padding5; } package_PrimaryKerberosCtr3; typedef [nodiscriminant] union { @@ -296,6 +306,40 @@ interface drsblobs { [in] package_PrimaryKerberosBlob blob ); + typedef struct { + [value(0)] uint32 unknown1; + [value(0)] uint32 unknown2; + [value(0x00001000)] uint32 unknown3; /* could the the iterator for the AES key creation */ + uint32 keytype; + [value((value?value->length:0))] uint32 value_len; + [relative,subcontext(0),subcontext_size(value_len),flag(NDR_REMAINING)] DATA_BLOB *value; + } package_PrimaryKerberosNewerKey; + + typedef struct { + uint16 num_keys; + [value(0)] uint16 unknown1; + uint16 num_old_keys1; + uint16 num_old_keys2; + package_PrimaryKerberosString salt; + [value(0x00001000)] uint32 unknown2; /* could the the iterator for the AES key creation */ + package_PrimaryKerberosNewerKey keys[num_keys]; + package_PrimaryKerberosNewerKey old_keys1[num_old_keys1]; + package_PrimaryKerberosNewerKey old_keys2[num_old_keys2]; + } package_PrimaryKerberosNewerCtr4; + + typedef [nodiscriminant] union { + [case(4)] package_PrimaryKerberosNewerCtr4 ctr4; + } package_PrimaryKerberosNewerCtr; + + typedef [public] struct { + [value(4)] uint32 version; + [switch_is(version)] package_PrimaryKerberosNewerCtr ctr; + } package_PrimaryKerberosNewerBlob; + + void decode_PrimaryKerberosNewer( + [in] package_PrimaryKerberosNewerBlob blob + ); + typedef [public] struct { [flag(STR_NOTERM|NDR_REMAINING)] string cleartext; } package_PrimaryCLEARTEXTBlob; diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 2ad9c57e5f..ddbb53a9b9 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -946,7 +946,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state, } } if (hex_failed) { - DEBUG(0,("init_sam_from_ldap: Failed to get password history for user %s\n", + DEBUG(2,("init_sam_from_ldap: Failed to get password history for user %s\n", username)); memset(pwhist, '\0', pwHistLen * PW_HISTORY_ENTRY_LEN); } diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 55ab58f7eb..13c510d4f9 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -537,7 +537,6 @@ static void request_len_recv(void *private_data, bool success); static void request_recv(void *private_data, bool success); static void request_main_recv(void *private_data, bool success); static void request_finished(struct winbindd_cli_state *state); -void request_finished_cont(void *private_data, bool success); static void response_main_sent(void *private_data, bool success); static void response_extra_sent(void *private_data, bool success); @@ -546,10 +545,7 @@ static void response_extra_sent(void *private_data, bool success) struct winbindd_cli_state *state = talloc_get_type_abort(private_data, struct winbindd_cli_state); - if (state->mem_ctx != NULL) { - talloc_destroy(state->mem_ctx); - state->mem_ctx = NULL; - } + TALLOC_FREE(state->mem_ctx); if (!success) { state->finished = True; @@ -574,10 +570,7 @@ static void response_main_sent(void *private_data, bool success) } if (state->response.length == sizeof(state->response)) { - if (state->mem_ctx != NULL) { - talloc_destroy(state->mem_ctx); - state->mem_ctx = NULL; - } + TALLOC_FREE(state->mem_ctx); setup_async_read(&state->fd_event, &state->request, sizeof(uint32), request_len_recv, state); @@ -609,17 +602,6 @@ void request_ok(struct winbindd_cli_state *state) request_finished(state); } -void request_finished_cont(void *private_data, bool success) -{ - struct winbindd_cli_state *state = - talloc_get_type_abort(private_data, struct winbindd_cli_state); - - if (success) - request_ok(state); - else - request_error(state); -} - static void request_len_recv(void *private_data, bool success) { struct winbindd_cli_state *state = @@ -767,10 +749,7 @@ static void remove_client(struct winbindd_cli_state *state) SAFE_FREE(state->response.extra_data.data); - if (state->mem_ctx != NULL) { - talloc_destroy(state->mem_ctx); - state->mem_ctx = NULL; - } + TALLOC_FREE(state->mem_ctx); remove_fd_event(&state->fd_event); diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index 9fafd57cea..0e0db3e859 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -65,7 +65,6 @@ void setup_async_write(struct fd_event *event, void *data, size_t length, void *private_data); void request_error(struct winbindd_cli_state *state); void request_ok(struct winbindd_cli_state *state); -void request_finished_cont(void *private_data, bool success); void winbind_check_sighup(const char *logfile); void winbind_check_sigterm(bool in_parent); int main(int argc, char **argv, char **envp); |