New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove redundant declarations of ERR_load_*_strings() #5150
Conversation
|
(I am hoping I can skip the CLA on this one, since it only removes code.) |
|
Looks like we did some of them, but not all. If you think this is not copyrightable, please amend your commit message to put "CLA: trivial" in the text. I kind of think there's no originality here, the compiler will warn you and tell you what to do, so I am okay with this being trivial. |
|
Amended the commit message per request; no other changes. |
include/openssl/pem2.h
Outdated
| @@ -12,7 +12,6 @@ extern "C" { | |||
| #endif | |||
|
|
|||
| #ifndef HEADER_PEM_H | |||
| int ERR_load_PEM_strings(void); | |||
| #endif | |||
Hm. Additionally, should this file begin including pemerr.h?
Nope. On second thought, this file should be removed entirely, and additionally, crypto/err/err_all.c should be changed to include the <openssl/*err.h> headers instead of the main ones...
... and you can remove the inclusion of <openssl/pem2.h> in include/openssl/pem.h...
...
come to think of it, you're right, we have to have this file include <openssl/pemerr.h> for the sake of the occasional poor guy who does include this one directly (should never happen, but it is a public header file, so...).
What I said about crypto/err/err_all.c and include/openssl/pem.h stands, though...
I've tried to take this into account with two new commits just pushed.
include/openssl/store.h
Outdated
| @@ -207,7 +207,6 @@ int OSSL_STORE_do_all_loaders(void (*do_function) (const OSSL_STORE_LOADER | |||
| /* | |||
| * Error strings | |||
| */ | |||
|
Sad to say that I do not believe (because of the err_all change) that this is still trivial. |
|
Do you suppose you could merge the other parts in that case? I hadn't intended to refactor any code beyond the headers originally. If not, I'll try to negotiate the CLA process. For what it's worth, the err_all change was mechanically generated: I replaced ".h>" with "err.h>", and then reverted the changes that the compiler cared about. |
|
Others may be inclined to view this as no-cla-needed. You can either wait for them to approve, or pull out the all_err changes, or deal with the CLA. So many fine choices to choose from :) |
include/openssl/pem2.h
Outdated
| #ifndef HEADER_PEM_H | ||
| int ERR_load_PEM_strings(void); | ||
| #endif | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif |
|
I've sent some questions to legal@; I'll revisit this PR once I have a CLA in place. |
|
Ah, now I notice the discussion... yeah, I'd say we've now walked into CLA land. |
crypto/err/err_all.c
Outdated
| #include <openssl/pemerr.h> | ||
| #include <openssl/x509err.h> | ||
| #include <openssl/x509v3err.h> | ||
| #include <openssl/conferr.h> |
You need to add #include <openssl/pkcs7err.h> here. It was previously included via <openssl/x509.h>, but since that got changed to <openssl/x509err.h>, ...
|
Thanks for the fast answers. I've sent in a CLA and made the requested changes. |
|
One last hurdle. Either change the commit email to be your MIT address, or we need a corporate CLA from Torproject. Or remove the err_all changes. Sorry for all the hassle. |
|
Ok. Technically, I'm an officer of the corporation, but I ought to ask the director first. I'll get back to you when I hear more |
|
The corporate CLA has been sent. |
|
Hmmm, Travis is still unhappy, but that's because Either way, you need to do a |
|
Done. Any better now? |
|
Travis is probably happier... I'm not entirely, but that's not your fault, and I'll fix in a separate PR |
|
... or well, the following patch will make the result somewhat better. Feel free to apply it and do another diff --git a/util/mkdef.pl b/util/mkdef.pl
index 98cdae537..d62b5fc08 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -302,7 +302,7 @@ $crypto.=" include/internal/err.h";
$crypto.=" include/internal/rand.h";
foreach my $f ( glob(catfile($config{sourcedir},'include/openssl/*.h')) ) {
my $fn = "include/openssl/" . lc(basename($f));
- $crypto .= " $fn" if !defined $skipthese{$fn} && $f !~ m@/[a-z]+err\.h$@;
+ $crypto .= " $fn" if !defined $skipthese{$fn};
}
my $symhacks="include/openssl/symhacks.h"; |
|
I've tried doing what you said. |
|
it couldn't hurt if you rebase against a fresh master and push. |
|
Done! The patch from @levitte is now redundant, so I removed it during the rebase, and I did a fresh "make update" run. I should have a CLA on file; I'm not sure why the bot is saying I don't. |
|
Close/Reopen to kick the bot |
|
There was an error in our CLA records. Fixed now. |
|
Argh... the removal of those module specific key words at the end of lines in |
|
#5275 corrects the issues I'm seeing. |
|
I see #5275 is merged. Should I rebase again? |
|
Yes, please, and a new |
In commit 52df25c, the ERR_load_FOO_strings() functions were moved from their original location in foo.h into new headers called fooerr.h. But they were never removed from their original locations. This duplication causes redundant-declaration warnings on programs that use OpenSSL's headers with such warnings enabled.
- pem2.h is empty, so pem.h doesn't need to include it.
- pem2.h once declared ERR_load_PEM_strings(), so it should now
include pemerr.h
|
Done, as requested. |
|
@richsalz, your approval still valid, I take it? |
|
yes, still valid. |
No worries. The first time I tried to get a nontrivial patch into OpenSSL, I had to revise it something like 18-25 times. :) |
In commit 52df25c, the ERR_load_FOO_strings() functions were moved from their original location in foo.h into new headers called fooerr.h. But they were never removed from their original locations. This duplication causes redundant-declaration warnings on programs that use OpenSSL's headers with such warnings enabled. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from #5150)
- pem2.h is empty, so pem.h doesn't need to include it.
- pem2.h once declared ERR_load_PEM_strings(), so it should now
include pemerr.h
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from #5150)
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from #5150)
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from #5150)
In commit 52df25c, the
ERR_load_FOO_strings() functions were moved from their original
location in foo.h into new headers called fooerr.h. But they were
never removed from their original locations. This duplication
causes redundant-declaration warnings on programs that use OpenSSL's
headers with such warnings enabled.
This patch removes redundant declarations only, and adds no new code.
The text was updated successfully, but these errors were encountered: