I've found out three functions in OpenSSL aren't defined with const
arguments, despites the fact they do not modify them.

They are :
ASN1_PRINTABLE_type (arg 1)
and
X509_NAME_ENTRY_create_by_* (arg 4)
X509_NAME_add_entry_by_* (arg 4)
which end up calling ASN1_STRING_set that has the const.
X509_NAME_add_entry * (arg 2)

I think the const value is also useful to prevent memory leaks in
fonctions that "inserts" some data :
The fonctions has the const, it makes a copy of the data I insert, I
must not forget to free the original pointer.
(like X509_NAME_add_entry)
The fonctions hasn't the const, it does not make a copy of the data I
insert, and if applicable, it will try to free it.
(like ASN1_TYPE_set ).

Maybe I'm just missing the fact this is the meaning of _add and _set ?

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to