On Tuesday 24 March 2009 09:45:20 Maxim Masiutin wrote: > Hello All, > > We have a BN_GENCB structure BN_GENCB_set_*** macros to set fields. > Problem is that when compiling OpenSSL as a library and using it from > a different application written in different language, converting > structures and unions is problematic due to different data sizes and > structure alignment issues. Some parts of the OpenSSL already have > exportable functions to operate with structures, e.g. EC_KEY_new, > EC_KEY_set_group, EC_KEY_set_private_key, > EC_GROUP_get_point_conversion_form, EC_KEY_free, and so on. In the > past, all SSLeay/LIBeay was heavily relying on macros. I wrote to Eric > Young about this issue. He (and later other developers) did converted > most of the macros to exportable functions. Can we also convert > BN_GENCB_set_*** macros to functions? > Thank you in advance.
I'm assuming here that converting the macros to inlines is also not going to help? If so, it seems you'll have problems in lots of places besides BN_GENCB, as lots of structures are exposed. BN_GENCB is not something we want to turn into an API(tm) as such ... If you are trying to thunk between languages, why don't you implement the missing protections/wrappers in your language glue? You'll presumably need similar wrapper functions for other structure accessors. Moreover, if the user behind your language glue wants to set a callback in the BN_GENCB struct, you presumably have to insert your own trampolining to handle that? If so, using your own wrappers will allow you to extend the C-native BN_GENCB struct with any extra state you need to bridge the callback into your particular language domain? In any case, this is not stuff that affects C users, so I don't think it (alone) justifies clamping down the C interface itself. Please let me know if I overlooked other issues. Cheers, Geoff -- Un terrien, c'est un singe avec des clefs de char... ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager majord...@openssl.org