ber_read_OID_String patch

Andrew Bartlett abartlet at samba.org
Tue Sep 22 23:42:59 MDT 2009


On Tue, 2009-09-08 at 14:08 +0300, Kamen Mazdrashki wrote: 
> Hi Metze,
> 
> On Tue, Sep 8, 2009 at 13:33, Stefan (metze) Metzmacher<metze at samba.org> wrote:
> > 
> > http://repo.or.cz/w/Samba/aatanasov.git?a=commitdiff;h=6f7bfe2863066b14
> > 095c690ca1184a880c81f1c1
> > 
> > -       typedef [nopush,nopull] struct {
> > -
> > [range(0,10000),value(ndr_size_drsuapi_DsReplicaOID_oid(oid, 0))]
> > uint32 __ndr_size;
> > -               [size_is(__ndr_size),charset(DOS)] uint8 *oid; /* it's
> > encoded with asn1_write_OID_String() */
> > +       typedef [noprint] struct {
> > +               [range(0,10000)] uint32 length;
> > +               [size_is(length)] uint8 *oid;
> >         } drsuapi_DsReplicaOID;
> > 
> > please rename oid to binary_oid and fix all callers to cope with binary
> > data. With this patch you'll generate some compilers and bugs, because
> > we now pass a binary buffer as string (while casting uint8_t * to char
> > *).
> > 
> > I fear the patch will be much larger...
> > 
> 
> I was just about to ask you for allowing me to implement this change :)
> I haven't done an impact analysis yet, but at first sight, it seems it won't
> be a small patch.
> 
> Btw, I was planning to do this after the plugfest - right now I want to spent
> most of my time on chasing issues and writing tests so you have more issues
> to talk about with MS guys.
> Is this plan OK with you?

We hit the need for this at the plugfest, and while metze does not like
the idea of keeping the binary form in the in-memory structure, I'm more
open to it.  Most important will be to implement the OID to prefix map
code, and to store the prefixmap on disk as a string.

We decided on the format 1.5.6.9.<last element with the last two bytes
wiped to zero>: to indicate a partial OID, and 1.5.6.9. for the 'normal'
types.  (last bit of oid oid less than 16385)

I've pushed my ideas in this area to prefixmap-idea in my git repo, and
metze promises to look into it tomorrow. 

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20090922/194763a4/attachment.pgp>


More information about the samba-technical mailing list