-
Notifications
You must be signed in to change notification settings - Fork 287
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
Support building on OpenBSD #224
base: main
Are you sure you want to change the base?
Conversation
Well, I've tried to run it and discoevered that dovecot can't start on OpenBSD and probably on non Linux. It doesn't build and install
but it is included into So, when I try to run dovecot, it fails as:
Thus, I had pushed some small polish, but I haven't tested that SNI works because I can't start it :( |
you could just disable imap-hibernate? not sure why it even tries to start up though. do you have service imap-hibernate block in your config? |
I don’t but it is added via default settings :) I’m making a way to exclude it, but it is a bit messy and I’m cleaning it right now. |
I just pushed an updated version. It was tested with keys which is generated by command:
A test was:
and confirmation that the rigth cerificate is used. The used config:
|
I had discovered one more edge case for OpenBSD which already handled well for FreeBSD. I have added one more commit. |
configure.ac
Outdated
@@ -729,7 +729,7 @@ libdovecot_headers= | |||
libdovecot_c_files= | |||
non_libdovecot_headers= | |||
non_libdovecot_c_files= | |||
all_files=`find $srcdir/src -name '*.[[ch]]' | grep -v '/src/config/all-settings.c' | grep -v '/src/lib-settings/' | grep -v '/test-' | xargs grep '\\(struct setting_parser_info [[a-z]]\\)\\|\\(struct service_settings [[a-z]]\\)\\|\\(<settings checks>\\)' | sed 's/:.*//' | sort | uniq` | |||
all_files=`find $srcdir/src -name '*.[[ch]]' | grep -v '/src/config/all-settings.c' | grep -v '/src/lib-settings/' | grep -v '/test-' | xargs egrep '(struct setting_parser_info [[a-z]])|(struct service_settings [[a-z]])|(<settings checks>)' | sed 's/:.*//' | sort | uniq` |
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 remember reading somewhere egrep is going to be deprecated. Should use grep -E instead.
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.
Indeed, egrep
was removed from POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap04.html
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.
After some thinking the cleaner way is using $GREP
, $EGREP
and $SED
and allow configure to decided which should be used on this platform.
#ifdef HAVE_X25519 | ||
if (!IS_XD_CURVE(nid)) | ||
#endif | ||
OPENSSL_free(pub_pt_hex); |
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.
Isn't this going to complain because pub_pt_hex is const pointer, or does OPENSSL_free() just cast it away? Anyway, perhaps nicer:
const char *pub_pt_hex = NULL;
char *pub_pt_hex_free = NULL;
...
pub_pt_hex = pub_pt_hex_free =
ec_key_get_pub_point_hex(EVP_PKEY_get0_EC_KEY(pub));
...
OPENSSL_free(pub_pt_hex_free);
Would also avoid the secondary ifdef/if checks.
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.
Indeed, it makes code cleaner.
The commit titles also could use a bit of clarifying / making them more consistent with how we usually write them, but I could change them also at the end. |
LibreSSL hasn't got SSL_CTX_select_current_cert and it was broken as side effect at 88da15b
LibreSSL doesn't implement any 448bit curves, so some ifdef magic is required to be able build it on OpenBSD.
OpenBSD 7.6 won't have EVP_PKEY_check anymore, see: openbsd/src@a8d73a0
LibreSSL hasn't got it, and here binary_to_hex_ucase which is the same and is used for OpenSSL 3.
Also, grep is used for simple patterns and basic regular expressions (BREs); egrep can handle extended regular expressions (EREs). A pattern in form 'a|b|c' requires ERE, and BRE isn't enough for non-GNU grep.
@sirainen the branch is rebased to the last main and I had reworked affected commits as it was suggested at review. |
BTW I think that f8ac266 worth to be backported to 2.3 as well. |
…or net_connect_ip_full Without this I can find errors in the logs like Fatal: connect(...) failed: Address already in use not often, like a few times a week. With this fix, which extends FreeBSD's condition to OpenBSD as well, such will no longer occur. This changes was sent upstream as part of dovecot/core#224 OK: sthen@
Here some micro polish which allows to build the main branch on OpenBSD 7.6 beta.
I haven't tested it a lot, but it defently compiled :)