Deprecate public use of the RAND_DRBG_USED_FLAGS define#7190
Deprecate public use of the RAND_DRBG_USED_FLAGS define#7190mspncp wants to merge 2 commits intoopenssl:masterfrom
Conversation
|
Should I add |
include/openssl/rand_drbg.h
Outdated
There was a problem hiding this comment.
Would it make more sense to wrapper this and the define above with an deprecated #ifdef?
There was a problem hiding this comment.
Scratch the prior define. It is necessary.
There was a problem hiding this comment.
Hmmm, how do you mean that? The flag is used internally and that will not change. Only the define will be moved from the public header into a private one or to drbg_lib.c, see #7182 (comment).
There was a problem hiding this comment.
Ok, one could deprecate it and use a slightly renamed constant internally, as @mattcaswell suggested in #7182 (comment). But is it worth the effort?
There was a problem hiding this comment.
I'd favour the final approach -- leave the current define there with its current value but wrapped:
#if OPENSSL_API_COMPAT < 0x10200000L
# define RAND_DRBG_USED_FLAGS (RAND_DRBG_FLAG_CTR_NO_DF)
#endif
Then add a new define to an internal header file that takes over the duties of the one. RAND_DRBG_ALL_FLAGS?
We can't deprecate something in a header by leaving it there. If we need it internally and we want to deprecate it, it should move to an internal header file.
There was a problem hiding this comment.
Ok, convinced. I'll do it and use your name suggestion. But it's too late in the night now for me to scratch my head whether the internal define should go into drbg_lib.c only or into an internal header...
There was a problem hiding this comment.
I'm happy to grab this one and run with it.
There was a problem hiding this comment.
I'd go for drbg_lib.c since it isn't used anywhere else.
It also doesn't need to be a #define. const unsigned int?
The name could then be kept but in lower case.
372cb69 to
a09ddda
Compare
|
Reworked the pr following @paulidale's suggestions. Squashed the fixups, since it's a small pr. |
a09ddda to
47649fe
Compare
|
Note: new commit message |
The new DRBG API added the aforementioned #define. However, it is used internally only and having it defined publicly does not serve any purpose except causing potential version compatibility problems. Fixes openssl#7182
47649fe to
fb08daa
Compare
mattcaswell
left a comment
There was a problem hiding this comment.
Approved. Got to be the shortest lived symbol from introduction to deprecation.
I would add it. The deprecation in the header file is enough of a prompt for us to come back later and remove it. |
Agreed. In fact, I already added it in fb08daa after addressing @paulidale's comments. |
I like scoring records ;-) |
|
Thanks for your approval, Matt. I'll wait for Pauli's feedback nevertheless, since it was his suggestion. |
paulidale
left a comment
There was a problem hiding this comment.
One formatting nit but approved either way.
crypto/rand/drbg_lib.c
Outdated
| static const unsigned int rand_drbg_used_flags = | ||
| RAND_DRBG_FLAG_CTR_NO_DF | | ||
| /* add new entries before this line */ | ||
| 0; |
There was a problem hiding this comment.
These two lines should go I think.
i.e. either
static const unsigned int rand_drbg_used_flags =
RAND_DRBG_FLAG_CTR_NO_DF ;
or everything on one line (if it fits);
Future items being added with the | leading the line.
There was a problem hiding this comment.
The original intention was to be diff-friendly, i.e., adding one flag will produce only a single line diff. But I understand that it violates the coding style guidelines, so I'll change it.
There was a problem hiding this comment.
Diffs don't handle things that move across files well.
Still approved.
It looks like you did not press the [Approve] button yet. |
|
Sorry about missing the radio button selection. |
The new DRBG API added the aforementioned #define. However, it is used internally only and having it defined publicly does not serve any purpose except causing potential version compatibility problems. Fixes #7182 Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from #7190)
The new DRBG API added the aforementioned #define. However, it is used internally only and having it defined publicly does not serve any purpose except causing potential version compatibility problems. Fixes #7182 Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from #7190) (cherry picked from commit c402e94)
|
Merged, thanks! |
The new DRBG API added the aforementioned define. However, it
is used internally only and having it defined publicly does not
serve any purpose except causing potential version compatibilty
problems.