You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "William A. Rowe Jr." <wr...@rowe-clan.net> on 2009/12/15 02:06:21 UTC
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
minfrin@apache.org wrote:
> Author: minfrin
> Date: Tue Dec 15 00:29:42 2009
> New Revision: 890580
>
> URL: http://svn.apache.org/viewvc?rev=890580&view=rev
> Log:
> Backport r890579:
> Refactor the apr_crypto.h interface so that the apr_crypto_t structure
> remains private. Correctly reference the apr_crypto_t context as a context
> and not a factory.
Just a few API/ABI version compatibility problems;
> Modified: apr/apr-util/branches/1.4.x/include/apr_crypto.h
> URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/include/apr_crypto.h?rev=890580&r1=890579&r2=890580&view=diff
> ==============================================================================
> --- apr/apr-util/branches/1.4.x/include/apr_crypto.h (original)
> +++ apr/apr-util/branches/1.4.x/include/apr_crypto.h Tue Dec 15 00:29:42 2009
> @@ -222,15 +213,14 @@
> APU_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driver);
>
> /**
> - * @brief Get the result of the last operation on a factory. If the result
> + * @brief Get the result of the last operation on a context. If the result
> * is NULL, the operation was successful.
> - * @param driver - driver to use
> - * @param factory - factory pointer will be written here
> + * @param f - context pointer
> * @param result - the result structure
> * @return APR_SUCCESS for success
> */
> -APU_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f,
> - const apu_err_t **result);
> +APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_driver_t *driver,
> + const apr_crypto_t *f, const apu_err_t **result);
This is ABI breakage from 1.4.0-dev to 1.4.1, please revert; extend with an
apr_crypto_error_ex for querying from an arbitrary interface. It doesn't make
sense why we would want this, but ...
> @@ -240,11 +230,11 @@
> * @param driver - driver to use
> * @param pool - process pool
> * @param params - array of key parameters
> - * @param factory - factory pointer will be written here
> + * @param f - context pointer will be written here
> * @return APR_ENOENGINE when the engine specified does not exist. APR_EINITENGINE
> * if the engine cannot be initialised.
> */
> -APU_DECLARE(apr_status_t) apr_crypto_factory(const apr_crypto_driver_t *driver,
> +APU_DECLARE(apr_status_t) apr_crypto_make(const apr_crypto_driver_t *driver,
> apr_pool_t *pool, const apr_array_header_t *params, apr_crypto_t **f);
ABI breakage, please add back the apr_crypto_factory stub fn to apr_crypto_make with
an @bug notice that it's deprecated.
> Modified: apr/apr-util/branches/1.4.x/include/private/apr_crypto_internal.h
> URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/include/private/apr_crypto_internal.h?rev=890580&r1=890579&r2=890580&view=diff
> ==============================================================================
> --- apr/apr-util/branches/1.4.x/include/private/apr_crypto_internal.h (original)
> +++ apr/apr-util/branches/1.4.x/include/private/apr_crypto_internal.h Tue Dec 15 00:29:42 2009
> @@ -41,6 +41,14 @@
> apr_status_t (*init)(apr_pool_t *pool, const apr_array_header_t *params, int *rc);
>
> /**
> + * @brief: fetch the most recent error from this driver.
> + * @param f - context pointer
> + * @param result - the result structure
> + * @return APR_SUCCESS for success.
> + */
> + apr_status_t (*error)(const apr_crypto_t *f, const apu_err_t **result);
We don't expect this extended yet, but from a compatibility perspective please
relocate this new addition to the end of the array. This way a 1.4.1 module
will load in 1.4.0-dev as deployed by users. A module built for 1.4.0-dev can
reasonably not be expected to be released by anyone, so no harm from the missing
error element in other builds.
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h include/private/apr_crypto_internal.h test/testcrypto.c
Posted by Graham Leggett <mi...@sharp.fm>.
On 30 Nov 2010, at 4:42 PM, Jim Jagielski wrote:
> As part of my push to get httpd 2.4 out the door, this is a
> major factor, so I plan on completing my review of the crypto
> API RSN.
Thanks for this.
The code has both a test suite, and a first implementation
(mod_session_crypto.c).
A key part of the API, which has been misunderstood in the past, is
the desire to be able to pre-initialise something (eg within httpd
startup), and then use that pre-initialised state later (eg at httpd
request time). The need for this may have not been clear when just
looking at the API.
Regards,
Graham
--
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h include/private/apr_crypto_internal.h test/testcrypto.c
Posted by Jim Jagielski <ji...@jaguNET.com>.
On Nov 29, 2010, at 4:58 PM, William A. Rowe Jr. wrote:
> On 1/21/2010 6:03 PM, Graham Leggett wrote:
>>
>> Waiting is entirely reasonable, as there is definite merit in ensuring v1.x is done as
>> right as humanly possible.
>
> We've been waiting a long time. I haven't had cycles to invest, won't until some
> time early next year at best.
>
> I'd just like to poll the group to find out who's invested time in reviewing the
> crypto API's and considers them release-worthy for the rest of 1.x's lifetime
> (which gstein promises will be eternity in svn-land :)
>
> Or has a review halfway completed, and intends to post comments sometime in the
> near-ish future?
>
As part of my push to get httpd 2.4 out the door, this is a
major factor, so I plan on completing my review of the crypto
API RSN.
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 1/21/2010 6:03 PM, Graham Leggett wrote:
>
> Waiting is entirely reasonable, as there is definite merit in ensuring v1.x is done as
> right as humanly possible.
We've been waiting a long time. I haven't had cycles to invest, won't until some
time early next year at best.
I'd just like to poll the group to find out who's invested time in reviewing the
crypto API's and considers them release-worthy for the rest of 1.x's lifetime
(which gstein promises will be eternity in svn-land :)
Or has a review halfway completed, and intends to post comments sometime in the
near-ish future?
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h include/private/apr_crypto_internal.h test/testcrypto.c
Posted by Graham Leggett <mi...@sharp.fm>.
On 21 Jan 2010, at 8:11 PM, William A. Rowe Jr. wrote:
> You are absolutely right, I made this comment on dev@httpd
> yesterday, that
> too many bad API examples are in the library today.
>
> This suggests that dbd was not given adequate oversight coming into
> apr.
> That shouldn't suggest that less oversight now applies.
>
> Folks using dbd will be rudely interrupted in apr-2.0 with the need to
> modify their code for conforming api names and arguments. I don't
> want
> that to happen to users of apr_crypto_*, if it can be avoided.
>
> There are still several flaws with the crypto API on trunk, I'm
> looking
> forward to fixing these as part of a general review, not singling out
> crypto. If we can wait a month to release 1.5.0 with crypto, then
> they
> will have no 'interruption' in their use of that API; it will take me
> some time to complete this entire review and present the conclusions
> to
> this list.
Waiting is entirely reasonable, as there is definite merit in ensuring
v1.x is done as right as humanly possible.
Regards,
Graham
--
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 1/21/2010 10:15 AM, Graham Leggett wrote:
> On 18 Jan 2010, at 11:23 PM, William A. Rowe Jr. wrote:
>
>> Graham, what's your preference; drop the api from 1.4.1 for
>> extensibility in
>> 1.5.0, or go with the 'static' provider model that was previously in
>> 1.4-dev,
>> until it's similarly refactored for extensibility with the release of
>> 2.0?
>>
>> I think that by waiting 2 months for ssl, we have a lot to win by
>> rethinking
>> the underlying ctx's so the crypto cxt references the driver, etc, but
>> I'm
>> not to keen on letting it disrupt the release of other new 1.4 features
>> by yesterday.
>
> We need to keep in mind that all the problems we are so eager to fix in
> apr_crypto have existed in apr_dbd for years, without anyone batting an
> eyelid about it.
You are absolutely right, I made this comment on dev@httpd yesterday, that
too many bad API examples are in the library today.
This suggests that dbd was not given adequate oversight coming into apr.
That shouldn't suggest that less oversight now applies.
Folks using dbd will be rudely interrupted in apr-2.0 with the need to
modify their code for conforming api names and arguments. I don't want
that to happen to users of apr_crypto_*, if it can be avoided.
There are still several flaws with the crypto API on trunk, I'm looking
forward to fixing these as part of a general review, not singling out
crypto. If we can wait a month to release 1.5.0 with crypto, then they
will have no 'interruption' in their use of that API; it will take me
some time to complete this entire review and present the conclusions to
this list.
There is lots of data to crunch with respect to the apr-2.0 API, accounting
for all prototypes that exist in include/*.h today. The project seems to
have paid much less attention to what went into apr-util, than into apr the
main library, which makes the amount of work in this review even more
complex.
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h include/private/apr_crypto_internal.h test/testcrypto.c
Posted by Graham Leggett <mi...@sharp.fm>.
On 18 Jan 2010, at 11:23 PM, William A. Rowe Jr. wrote:
> Graham, what's your preference; drop the api from 1.4.1 for
> extensibility in
> 1.5.0, or go with the 'static' provider model that was previously in
> 1.4-dev,
> until it's similarly refactored for extensibility with the release
> of 2.0?
>
> I think that by waiting 2 months for ssl, we have a lot to win by
> rethinking
> the underlying ctx's so the crypto cxt references the driver, etc,
> but I'm
> not to keen on letting it disrupt the release of other new 1.4
> features
> by yesterday.
We need to keep in mind that all the problems we are so eager to fix
in apr_crypto have existed in apr_dbd for years, without anyone
batting an eyelid about it.
While there is definitely merit in delivering a "fixed" apr_crypto
implementation in v1.4 if such a thing is possible, if it is not
possible due to our ABI rules I don't think it is necessarily
something to get too worked up about, as it remains consistent with
apr_dbd in v1.4.
Given that there have been no strenuous objections to the apr_crypto
fix on apr-trunk, my plan is to apply the same fix to apr_dbd for
apr_trunk as well, to bring both APIs into alignment. For obvious
reasons, this fix to apr_dbd won't be backported to v1.x.
Regards,
Graham
--
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Graham, what's your preference; drop the api from 1.4.1 for extensibility in
1.5.0, or go with the 'static' provider model that was previously in 1.4-dev,
until it's similarly refactored for extensibility with the release of 2.0?
I think that by waiting 2 months for ssl, we have a lot to win by rethinking
the underlying ctx's so the crypto cxt references the driver, etc, but I'm
not to keen on letting it disrupt the release of other new 1.4 features
by yesterday.
On 1/17/2010 4:52 AM, William A. Rowe Jr. wrote:
> On 12/15/2009 4:57 AM, Graham Leggett wrote:
>> William A. Rowe Jr. wrote:
>>
>>> As I mentioned, the actual contents of the structure are flexible IMHO.
>>> As a user, folks aren't expected to know the difference, but as a developer,
>>> something clearly labeled -alpha should be expected to be changing still.
>>>
>>> So if a *developer* coded to any of these API's, well, all bets are off.
>>>
>>> But we can leave the apr_crypto_driver_t at the same position as it was
>>> originally in the structure, no?
>>
>> I plan to revert the entire change to v1.4 as you've requested, as
>> making apr_crypto_t private is definitely an incompatible ABI change
>> given that v1.4.x has been released.
>>
>> I can then just focus on v2, where this problem can be fixed properly
>> for dbd and crypto (and then ldap).
>
> I have another suggestion.
>
> The correct approach would have started from the correct implementation,
> and we are still missing this by a long shot. That implementation would
> include the first two members of every crypto context, a pointer to it's
> own apr_pool_t and a pointer to it's own apr_crypto_driver_t, and you would
> not have broken the error lookup function interface.
>
> I'm going to suggest that the implementation is too immature for apr-util-1,
> and is blocking release of apr-util-1.4. Everything else is long past done.
> Shipping this correct in apr_util 1.5, even 6 weeks from now, would eliminate
> my concerns over version compatibility created at the httpd project, and
> then give us the flexibility to break these underlying structures to
> properly dereferrence the provider based on the context.
>
> WDYT? If you buy this idea, I'll entirely help you fix this interface for
> apr-2 and push forwards to shipping apr-util-1.5, ASAP. But as you can tell
> from my long silence, I'm stupified at how to resolve this whole condominium
> of fixing a broken interface while preserving ABI. At least by 1.5 we can
> ensure that there is little chance for a 1.4-pre clash, and do this whole
> thing properly. You were very close, but weren't at the last mile when that
> 1.4 pre was tagged, unless you want to preserve the fixed-provider ABI. And
> I think the two of us agree that doesn't serve the purpose of abstracting
> this whole interface.
>
> Thoughts?
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 12/15/2009 4:57 AM, Graham Leggett wrote:
> William A. Rowe Jr. wrote:
>
>> As I mentioned, the actual contents of the structure are flexible IMHO.
>> As a user, folks aren't expected to know the difference, but as a developer,
>> something clearly labeled -alpha should be expected to be changing still.
>>
>> So if a *developer* coded to any of these API's, well, all bets are off.
>>
>> But we can leave the apr_crypto_driver_t at the same position as it was
>> originally in the structure, no?
>
> I plan to revert the entire change to v1.4 as you've requested, as
> making apr_crypto_t private is definitely an incompatible ABI change
> given that v1.4.x has been released.
>
> I can then just focus on v2, where this problem can be fixed properly
> for dbd and crypto (and then ldap).
I have another suggestion.
The correct approach would have started from the correct implementation,
and we are still missing this by a long shot. That implementation would
include the first two members of every crypto context, a pointer to it's
own apr_pool_t and a pointer to it's own apr_crypto_driver_t, and you would
not have broken the error lookup function interface.
I'm going to suggest that the implementation is too immature for apr-util-1,
and is blocking release of apr-util-1.4. Everything else is long past done.
Shipping this correct in apr_util 1.5, even 6 weeks from now, would eliminate
my concerns over version compatibility created at the httpd project, and
then give us the flexibility to break these underlying structures to
properly dereferrence the provider based on the context.
WDYT? If you buy this idea, I'll entirely help you fix this interface for
apr-2 and push forwards to shipping apr-util-1.5, ASAP. But as you can tell
from my long silence, I'm stupified at how to resolve this whole condominium
of fixing a broken interface while preserving ABI. At least by 1.5 we can
ensure that there is little chance for a 1.4-pre clash, and do this whole
thing properly. You were very close, but weren't at the last mile when that
1.4 pre was tagged, unless you want to preserve the fixed-provider ABI. And
I think the two of us agree that doesn't serve the purpose of abstracting
this whole interface.
Thoughts?
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 1/16/2010 3:11 AM, Graham Leggett wrote:
> On 15 Dec 2009, at 8:52 PM, William A. Rowe Jr. wrote:
>>
>> My gut says hold off releasing apr-1.4.1 for just a bit to see if this
>> feature would be the solution.
>
> I've come up with r899910, and it seems to work. Can you give it the
> once over for me if possible?
Ok; I'm 100% convinced this doesn't go into apr-1.4, once we sort that whole
hash/pool lifetime problem, 1.4 apr is baked.
But I'll review your trunk commit... I note you didn't do any autoconf tests
so you aren't thinking in the same direction as I was.
Essentially, An incomplete structure type looks like;
struct apr_foo_t
{
apr_pool_t *foo;
apr_foo_ctx_t *bar;
char incomplete[];
}
Whoops - indeterminate length; the user can't get sizeof(apr_foo_t), can't
allocate one themselves, etc etc. The program fills out the rest of the
structure in include/private/ declarations, so everything is fine.
Now to retrieve foo, we need to either be on a compiler where the above
does not fault, or provide an accessor that knows the platform alignment.
E.g. downcast to a complete type, but don't do so in a dangerous way.
I will take a close look at your patch, and contribute the implementation
that determines if it's a modern or classic K&R compiler, and work out
how to resolve the first few members of a struct. It's not easy but I'm
beginning to believe it's absolutely necessary for performance and the
code integrity. It might not be implemented until rev 2, given that we
want to expose all our apr_xxx_t's to this introspection ;-)
Bill
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h include/private/apr_crypto_internal.h test/testcrypto.c
Posted by Graham Leggett <mi...@sharp.fm>.
On 15 Dec 2009, at 8:52 PM, William A. Rowe Jr. wrote:
> Hold off... it is not incompatible (well, you can slide *errfn to the
> last element of the structure, but otherwise)...
>
> What we need is a way to document *and validate* incomplete C types
> into complete C types with structures. The approach in apr_general.h
> or somewhere similar would be;
>
> #if APR_HAVE_VOID_INCOMPLETE_TYPES
> #define APR_TYPEDEF_STRUCT(type, incompletion) \
> typedef struct type {
> incompletion
> void unk[];
> } type;
> #else
> typedef struct type type;
> #endif
>
> and then within apr_foo.h, an particular example;
>
> APR_TYPEDEF_STRUCT(apr_foo_t, \
> apr_pool_t *pool; \
> apr_foo_ctx_t *ctx; \
> )
>
> or something very closely resembling this. Need to work out the exact
> mechanics that aren't subject to macro problems, and the autoconf
> magic
> to detect the availability.
>
> My gut says hold off releasing apr-1.4.1 for just a bit to see if this
> feature would be the solution.
I've come up with r899910, and it seems to work. Can you give it the
once over for me if possible?
Regards,
Graham
--
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Graham Leggett wrote:
>
> I plan to revert the entire change to v1.4 as you've requested, as
> making apr_crypto_t private is definitely an incompatible ABI change
> given that v1.4.x has been released.
Hold off... it is not incompatible (well, you can slide *errfn to the
last element of the structure, but otherwise)...
What we need is a way to document *and validate* incomplete C types
into complete C types with structures. The approach in apr_general.h
or somewhere similar would be;
#if APR_HAVE_VOID_INCOMPLETE_TYPES
#define APR_TYPEDEF_STRUCT(type, incompletion) \
typedef struct type {
incompletion
void unk[];
} type;
#else
typedef struct type type;
#endif
and then within apr_foo.h, an particular example;
APR_TYPEDEF_STRUCT(apr_foo_t, \
apr_pool_t *pool; \
apr_foo_ctx_t *ctx; \
)
or something very closely resembling this. Need to work out the exact
mechanics that aren't subject to macro problems, and the autoconf magic
to detect the availability.
My gut says hold off releasing apr-1.4.1 for just a bit to see if this
feature would be the solution.
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by Graham Leggett <mi...@sharp.fm>.
William A. Rowe Jr. wrote:
> As I mentioned, the actual contents of the structure are flexible IMHO.
> As a user, folks aren't expected to know the difference, but as a developer,
> something clearly labeled -alpha should be expected to be changing still.
>
> So if a *developer* coded to any of these API's, well, all bets are off.
>
> But we can leave the apr_crypto_driver_t at the same position as it was
> originally in the structure, no?
I plan to revert the entire change to v1.4 as you've requested, as
making apr_crypto_t private is definitely an incompatible ABI change
given that v1.4.x has been released.
I can then just focus on v2, where this problem can be fixed properly
for dbd and crypto (and then ldap).
Regards,
Graham
--
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Graham Leggett wrote:
> William A. Rowe Jr. wrote:
>
>> And I think it's overkill. If the 'incomplete' apr_crypto_t is defined to always
>> complete to a first member referencing the apr_crypto_driver_t, we just don't need
>> this uglyness. A similar example was using pools as the first member of arbitrary
>> apr types to always ensure the pool-of could be extracted from an arbitrary type.
>>
>> The implementation of apr_crypto_error can simply map apr_crypto_t to the predictable
>> initial elements, e.g. pool and driver.
>>
>> Make sense?
>
> It does, but if we do this, apr_dbd.h, which contains this same pattern
> (and on which apr_crypto was based) needs to be changed at the same time
> for the same reason.
>
> (Obviously ABI-wise this is a 2.0 thing).
As I mentioned, the actual contents of the structure are flexible IMHO.
As a user, folks aren't expected to know the difference, but as a developer,
something clearly labeled -alpha should be expected to be changing still.
So if a *developer* coded to any of these API's, well, all bets are off.
But we can leave the apr_crypto_driver_t at the same position as it was
originally in the structure, no?
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by Graham Leggett <mi...@sharp.fm>.
William A. Rowe Jr. wrote:
> And I think it's overkill. If the 'incomplete' apr_crypto_t is defined to always
> complete to a first member referencing the apr_crypto_driver_t, we just don't need
> this uglyness. A similar example was using pools as the first member of arbitrary
> apr types to always ensure the pool-of could be extracted from an arbitrary type.
>
> The implementation of apr_crypto_error can simply map apr_crypto_t to the predictable
> initial elements, e.g. pool and driver.
>
> Make sense?
It does, but if we do this, apr_dbd.h, which contains this same pattern
(and on which apr_crypto was based) needs to be changed at the same time
for the same reason.
(Obviously ABI-wise this is a 2.0 thing).
Regards,
Graham
--
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Just a bit more detail on this one objection...
William A. Rowe Jr. wrote:
> minfrin@apache.org wrote:
>> Author: minfrin
>> Date: Tue Dec 15 00:29:42 2009
>> New Revision: 890580
>>
>> URL: http://svn.apache.org/viewvc?rev=890580&view=rev
>> Log:
>> Backport r890579:
>> Refactor the apr_crypto.h interface so that the apr_crypto_t structure
>> remains private. Correctly reference the apr_crypto_t context as a context
>> and not a factory.
>
> Just a few API/ABI version compatibility problems;
>
>> Modified: apr/apr-util/branches/1.4.x/include/apr_crypto.h
>> URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/include/apr_crypto.h?rev=890580&r1=890579&r2=890580&view=diff
>> ==============================================================================
>> --- apr/apr-util/branches/1.4.x/include/apr_crypto.h (original)
>> +++ apr/apr-util/branches/1.4.x/include/apr_crypto.h Tue Dec 15 00:29:42 2009
>> @@ -222,15 +213,14 @@
>> APU_DECLARE(const char *)apr_crypto_driver_name (const apr_crypto_driver_t *driver);
>>
>> /**
>> - * @brief Get the result of the last operation on a factory. If the result
>> + * @brief Get the result of the last operation on a context. If the result
>> * is NULL, the operation was successful.
>> - * @param driver - driver to use
>> - * @param factory - factory pointer will be written here
>> + * @param f - context pointer
>> * @param result - the result structure
>> * @return APR_SUCCESS for success
>> */
>> -APU_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_t *f,
>> - const apu_err_t **result);
>> +APR_DECLARE(apr_status_t) apr_crypto_error(const apr_crypto_driver_t *driver,
>> + const apr_crypto_t *f, const apu_err_t **result);
>
> This is ABI breakage from 1.4.0-dev to 1.4.1, please revert; extend with an
> apr_crypto_error_ex for querying from an arbitrary interface. It doesn't make
> sense why we would want this, but ...
And I think it's overkill. If the 'incomplete' apr_crypto_t is defined to always
complete to a first member referencing the apr_crypto_driver_t, we just don't need
this uglyness. A similar example was using pools as the first member of arbitrary
apr types to always ensure the pool-of could be extracted from an arbitrary type.
The implementation of apr_crypto_error can simply map apr_crypto_t to the predictable
initial elements, e.g. pool and driver.
Make sense?
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by Branko Čibej <br...@xbc.nu>.
Graham Leggett wrote:
> William A. Rowe Jr. wrote:
>
>
>> This is ABI breakage from 1.4.0-dev to 1.4.1, please revert; extend with an
>> apr_crypto_error_ex for querying from an arbitrary interface. It doesn't make
>> sense why we would want this, but ...
>>
>
> What is 1.4.0-dev?
>
> This API appears in none of our releases, why suddenly is this API cast
> in stone?
>
Because Paul in his wisdom released HTTPD with an unreleased APR bundled
with it. Which implies that some users have that unreleased APR, labeled
1.4, installed on their systems. Which is the source of all this back
and forth between Bill and Paul.
Sigh.
-- Brane
Re: svn commit: r890580 - in /apr/apr-util/branches/1.4.x: crypto/apr_crypto.c
crypto/apr_crypto_nss.c crypto/apr_crypto_openssl.c include/apr_crypto.h
include/private/apr_crypto_internal.h test/testcrypto.c
Posted by Graham Leggett <mi...@sharp.fm>.
William A. Rowe Jr. wrote:
> This is ABI breakage from 1.4.0-dev to 1.4.1, please revert; extend with an
> apr_crypto_error_ex for querying from an arbitrary interface. It doesn't make
> sense why we would want this, but ...
What is 1.4.0-dev?
This API appears in none of our releases, why suddenly is this API cast
in stone?
Regards,
Graham
--