mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
ldap VLV: use correct ASN.1 encoding for requests
The search reference points (either an integer index or a string for comparison) are supposed to use ASN1_CONTEXT or ASN1_CONTEXT_SIMPLE (respectively) ASN.1 types. We were using these types, but we also put extra ones in too, which nobody else likes. Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
78f8a89bdd
commit
5421d7070a
@ -586,7 +586,7 @@ static bool decode_vlv_request(void *mem_ctx, DATA_BLOB in, void *_out)
|
|||||||
|
|
||||||
lvrc->type = 1;
|
lvrc->type = 1;
|
||||||
|
|
||||||
if (!asn1_start_tag(data, ASN1_CONTEXT(1))) {
|
if (!asn1_start_tag(data, ASN1_CONTEXT_SIMPLE(1))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1007,10 +1007,6 @@ static bool encode_vlv_request(void *mem_ctx, void *in, DATA_BLOB *out)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!asn1_write_Integer(data, lvrc->match.byOffset.offset)) {
|
if (!asn1_write_Integer(data, lvrc->match.byOffset.offset)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1019,19 +1015,15 @@ static bool encode_vlv_request(void *mem_ctx, void *in, DATA_BLOB *out)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!asn1_pop_tag(data)) { /*SEQUENCE*/
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!asn1_pop_tag(data)) { /*CONTEXT*/
|
if (!asn1_pop_tag(data)) { /*CONTEXT*/
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!asn1_push_tag(data, ASN1_CONTEXT(1))) {
|
if (!asn1_push_tag(data, ASN1_CONTEXT_SIMPLE(1))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!asn1_write_OctetString(data, lvrc->match.gtOrEq.value, lvrc->match.gtOrEq.value_len)) {
|
if (!asn1_write(data, lvrc->match.gtOrEq.value, lvrc->match.gtOrEq.value_len)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user