-
Notifications
You must be signed in to change notification settings - Fork 133
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
SSL cleanups (with a few BSD odds & ends) #276
base: master
Are you sure you want to change the base?
Conversation
Bike shedding a little bit, but could you add the ssl.o and the utils.o to the gitignore? Also, I noticed ssl.o doesn't get removed from make clean. Edit: Could you also add generate_dh_params to the gitignore? |
With the Makefile command
Do you think you would ever need to specify the directory that utils.o is in? Something like this
This applies to the nrpe command as well |
Should the auto_dh be enabled by default or should it be disabled by default to conform with backwards compatibility? |
I did most of my testing in separate build directories so I didn't notice. I had just assumed all I missed the
No.
It's a bit of an effort to remember, but I don't think I changed backwards compatibility here. It defaulted to always generating a DH key, I just switched to auto keying on setups that supported it. It should support all the same ciphers suites and connections to older versions as before. I believe (sorry, it's been awhile) I tested various settings of |
Since 1.1.0 the library will auto initialize and on 3.x these functions are deprecated. Use ERR_get_error instead of ERR_get_error_line_data since we don't use the extra options. Detect if library supports SSL_OP_NO_TLSv1_1 before using.
Fix OpenSSL detection (don't include prefix and libraries may end in .a) Add rpath to linker flags if libraries aren't in default location. Switch to using recommended auto setup of DH parameters on OpenSSL 1.1.0+. Rewrite OpenSSL 3.0+ generation of DH parameters to use new API. Use OpenSSL headers to detect version since may mismatch detected binary. Move generation of DH parameters to Makefile.
Remove uses of strcat, strcpy, sprintf, etc. Fix warnings about unused variables.
AC_ARG_ENABLE([auto_dh], | ||
AS_HELP_STRING([--disable-auto-dh],[disables using builtin DH parameters (if available) and generates custom parameters]), | ||
auto_dh=no, | ||
auto_dh=yes) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe, because of this segment of code here, that unless you provide --disable-auto-dh
then auto_dh will equal yes. So I think to have the default behavior be "disabled by default" then it should look something like
AC_ARG_ENABLE([auto_dh], | |
AS_HELP_STRING([--disable-auto-dh],[disables using builtin DH parameters (if available) and generates custom parameters]), | |
auto_dh=no, | |
auto_dh=yes) | |
AC_ARG_ENABLE([auto_dh], | |
AS_HELP_STRING([--enable-auto-dh],[enables using builtin DH parameters (if available) and generates custom parameters]), | |
auto_dh=yes, | |
auto_dh=no) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naturally, correct me if I am wrong about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although it might be better if auto_dh is enabled by default anyways. I'll try testing how different versions play with each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it defaults to using auto DH keying on setups that support it, but only if need_dh
is true. So with the same configure
options the software should function the exact same. The source of the DH parameters (auto or self-generated) has no affect. OpenSSL recommends using auto keying.
Various patches cleaning up the SSL handling:
strcat
,strcpy
,sprintf
, etc.nrpe
&check_nrpe
to separatessl.c
fileThis has been compile tested on the following configurations:
It's been running in production (along with my other patches) on one of my Gentoo boxes. The others have been compile (and minimally run) tested only.