<div dir="ltr"><div>Any proposal needs to deal with the constructors consistently - whether they come from an OPENSSL_CTX or they come from an existing TYPE_CTX.</div><div>That is absent in your PR.</div><div><br></div><div>Basically this leads to the ability to provide inconsistent argument order in functions.</div><div><br></div><div>TYPE *TYPE_make_from_ctx(TYPE_CTX *ctx, char *name)</div><div>or</div><div><div>TYPE *TYPE_make_from_ctx(char *name,TYPE_CTX *ctx)</div><div><br></div><div>It simply isn't consistent to basically allow both forms of this approach.</div><div><br></div><div>Seeing the OPENSSL_CTX as something different to the other APIs in terms of its usage when it is providing the context from which something is constructed is the underlying issue here.</div><div>Your PR basically makes rules for "context" arguments which lead to allowing both the above forms - and making the current usage of CTX values a different logical order than the OPENSSL_CTX.</div><div><br></div><div>Separately, we should have consistency in the naming of the functions which take an OPENSSL_CTX - the _with_libctx makes no sense now that we settled on OPENSSL_CTX rather than OPENSSL_LIBCTX or OPENSSL_LIB_CTX as the naming. We also have a pile of _ex functions that were introduced just to add an OPENSSL_CTX - those should be consistently named. </div><div><br></div><div>The PR should cover that context of how we name the variations of functions which add the OPENSSL_CTX reference.</div><div><br></div><div>The suggested rules for extended functions is inconsistent in stating the order "should be retained" and then allowing for inserting "at any point".</div><div>IHMO either the new function must preserve the existing order and just add to the end (to easy migration) or it should conform to the naming scheme and parameter argument order for new functions - one of those should be the driver rather than basically creating something that is neither - not easy to migrate to and also not following the documented order. We should be trying to achieve one of those two objectives.</div><div></div></div><div><br></div><div>Tim.</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 14, 2020 at 8:30 PM Matt Caswell <<a href="mailto:matt@openssl.org">matt@openssl.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In order to try and move this discussion forward I have made a concrete<br>
proposal for how we should formulate the various ideas in this thread<br>
into an actual style. Please see here:<br>
<br>
<a href="https://github.com/openssl/web/pull/194" rel="noreferrer" target="_blank">https://github.com/openssl/web/pull/194</a><br>
<br>
Since we're not yet fully in agreement some compromises will have to be<br>
made. I hope I've come up with something which isn't too abhorrent to<br>
anyone.<br>
<br>
Please take a look.<br>
<br>
Matt<br>
<br>
<br>
On 05/09/2020 04:48, SHANE LONTIS wrote:<br>
> <br>
>   PR #12778 reorders all the API’s of the form:<br>
> <br>
> <br>
>   EVP_XX_fetch(libctx, algname, propq) <br>
> <br>
> <br>
>   So that the algorithm name appears first.. <br>
> <br>
> <br>
>   e.g: EVP_MD_fetch(digestname, libctx, propq);<br>
> <br>
> This now logically reads as 'search for this algorithm using these<br>
> parameters’.<br>
> <br>
> The libctx, propq should always appear together as a pair of parameters.<br>
> There are only a few places where only the libctx is needed, which means<br>
> that if there is no propq it is likely to cause a bug in a fetch at some<br>
> point. <br>
> <br>
> This keeps the API’s more consistent with other existing XXX_with_libctx<br>
> API’s that put the libctx, propq at the end of the parameter list..<br>
> The exception to this rule is that callback(s) and their arguments occur<br>
> after the libctx, propq..<br>
> <br>
> e.g:<br>
> typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_with_libctx_fn)<br>
>     (const OSSL_STORE_LOADER *loader,<br>
>      const char *uri, OPENSSL_CTX *libctx, const char *propq,<br>
>      const UI_METHOD *ui_method, void *ui_data);<br>
> <br>
> An otc_hold was put on this.. Do we need to have a formal vote?<br>
> This really needs to be sorted out soon so the API’s can be locked down<br>
> for beta.<br>
> <br>
> --------<br>
> Also discussed in a weekly meeting and numerous PR discussions was the<br>
> removal of the long winded API’s ending with ‘with_libctx’<br>
> e.g CMS_data_create_with_libctx<br>
> The proposed renaming for this was to continue with the _ex notation..<br>
> If there is an existing _ex name then it becomes _ex2, etc.<br>
> There will most likely be additional parameters in the future for some<br>
> API’s, so this notation would be more consistent with current API’s.<br>
> Does this also need a vote?<br>
> <br>
> Regards,<br>
> Shane<br>
> <br>
> <br>
</blockquote></div></div>