Richard Levitte - VMS Whacker wrote:
> 
> From: Dr S N Henson <[EMAIL PROTECTED]>
> 
> drh> [EMAIL PROTECTED] wrote:
> drh> >
> drh> > levitte     13-Dec-2000 18:15:05
> drh> >
> drh> >
> drh> >   Now, if someone could explain to me why OBJ_dup() cheats...
> drh> >
> [...]
> drh>
> drh> If ASN1_OBJECT_FLAG_DYNAMIC isn't set then the ASN1_OBJECT structure is
> drh> form the static list of the "standard objects" OpenSSL understands. As
> drh> such it doesn't need to be dup'ed.
> drh>
> drh> The standard functions that modify ASN1_OBJECTs (hopefully) check this
> drh> flag carefully if an attempt is made to modify it.
> 
> OK, I was thinking in a slightly more philosophical (sp?) way: why
> does one make a duplicate of anything?  My answer to that is "to get
> some kind of template that one wants to modify for some purpose or
> another".  I have a hard time seeing a reason to call a "duplicator"
> if all one wants is to get a pointer to the object.  Which brings me
> to my next point: if someone happens to "duplicate" an object that is
> part of the static list with the purpose of modifying it for his or
> her own purposes, he or she will be screwed and have a hard time
> understanding why.
> 

Well this will only happen if it is modified by accessing the structure
directly and ignoring the flags which is asking for trouble anyway.

If the object is modified via the API then there is no problem. Well no
known problem... 

The point of it is to avoid having to dynamically allocate objects when
its one of the standard types.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to