Add UI functionality to duplicate the user data#3575
Add UI functionality to duplicate the user data#3575levitte wants to merge 2 commits intoopenssl:masterfrom
Conversation
|
@dwmw2, I believe you're interested in this |
|
Staring at it on my.phone probably doesn't help but... Where does the 'destroy' function originally come from? Shouldnt it be passed in from the app as an additional argument to the 'set duplicator' call. Dup and free functions are a pair. (And if it's recounting are just Inc and dec) |
|
Very good point, I'll fix |
|
I might even go so far as to suggest that the add_user_data function should take all three. To add user data without the dup/free funcs you should need to explicitly pass NULL |
|
I went the other way and made the destructor a UI_METHOD function as well. |
|
... and the UI data so added is always destroyed by OpenSSL for consistency. |
|
LGTM |
doc/man3/UI_create_method.pod
Outdated
doc/man3/UI_new.pod
Outdated
crypto/ui/ui_lib.c
Outdated
There was a problem hiding this comment.
Should this really be called UI_set1_user_data()?
There was a problem hiding this comment.
That would be inconsistent with the rest of the UI API. You might want to argue that the API should be "modernised", but that's for 1.2.0, not for now.
Background: the whole set0 / set1 semantics came after UI, as far as I recall, or was at least not settled and well known throughout the whole team at the time.
There was a problem hiding this comment.
How about add1 then? There are quite a few instances of that in the public APIs already.
There was a problem hiding this comment.
How about looking at the rest of ui.h first? There is quite a number of add/dup pairs, why should this particular function differ?
This can be used by engines that need to retain the data for a longer time than just the call where this user data is passed.
|
Merged. 545360c Thanks! |
This can be used by engines that need to retain the data for a longer time than just the call where this user data is passed. Reviewed-by: Matt Caswell <[email protected]> (Merged from #3575)
This can be used by engines that need to retain the data for a longer time
than just the call where this user data is passed.
Checklist