From 037e158938d70826ccd087136cbbdcb143d0bf87 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 20 Dec 2006 14:44:14 +0000 Subject: r20280: if the uint8_t array starts with 0xFF, then it's not a OID and we return the array as hexstring. this is always in the last array member of the meppings array, and I is always 21 bytes long w2k in mixed mode: FF0000000000000000000000000000000000000000 w2k3 in mixed mode: FF00000002A5DA73B101C43B449028E2F832FE466F w2k3 in native mode: FF00000001635D94BDE62E2C4C9BAC9D6AFA4F69F8 I assume it's some kind of schema version... metze (This used to be commit db16f6382da50167b6cefdaeb8488b00a45fb928) --- source4/librpc/ndr/ndr_drsuapi.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'source4/librpc') diff --git a/source4/librpc/ndr/ndr_drsuapi.c b/source4/librpc/ndr/ndr_drsuapi.c index 37c78a2c80..50d227ca00 100644 --- a/source4/librpc/ndr/ndr_drsuapi.c +++ b/source4/librpc/ndr/ndr_drsuapi.c @@ -124,9 +124,6 @@ NTSTATUS ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, stru if (r->oid) { DATA_BLOB _oid_array; const char *_oid; - struct asn1_data _asn1; - - ZERO_STRUCT(_asn1); _mem_save_oid_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, ndr, 0); @@ -136,15 +133,26 @@ NTSTATUS ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, stru NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, _oid_array.data, _oid_array.length)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_oid_0, 0); - _ASN1_PULL_CHECK(asn1_load(&_asn1, _oid_array)); - talloc_steal(ndr, _asn1.data); - data_blob_free(&_oid_array); - _ASN1_PULL_CHECK(asn1_start_fake_tag(&_asn1)); - _ASN1_PULL_CHECK(asn1_read_OID_String(&_asn1, &_oid)); - talloc_steal(r->oid, _oid); - r->oid = _oid; - _ASN1_PULL_CHECK(asn1_end_tag(&_asn1)); - asn1_free(&_asn1); + if (_oid_array.length && _oid_array.data[0] == 0xFF) { + _oid = data_blob_hex_string(ndr, &_oid_array); + NT_STATUS_HAVE_NO_MEMORY(_oid); + data_blob_free(&_oid_array); + talloc_steal(r->oid, _oid); + r->oid = _oid; + } else { + struct asn1_data _asn1; + ZERO_STRUCT(_asn1); + _ASN1_PULL_CHECK(asn1_load(&_asn1, _oid_array)); + talloc_steal(ndr, _asn1.data); + data_blob_free(&_oid_array); + _ASN1_PULL_CHECK(asn1_start_fake_tag(&_asn1)); + _ASN1_PULL_CHECK(asn1_read_OID_String(&_asn1, &_oid)); + talloc_steal(r->oid, _oid); + r->oid = _oid; + _ASN1_PULL_CHECK(asn1_end_tag(&_asn1)); + asn1_free(&_asn1); + } + DEBUG(0,("oid: %s\n", r->oid)); } if (r->oid) { NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->oid, r->__ndr_size)); -- cgit