Skip to content

Commit e914e61

Browse files
committed
Remove status bits from OpenSSL >=3 version check.
OpenSSL traditionally did not guarantee ABI compatibility across release (and development) versions. Because of this, OpenSSH checked the lower 4 "status" bits returned by OpenSSL_version_num(), which were originally set to 0 for development versions and 0xf for release versions and, if they did not match, would report the discrepancy and exit. OpenSSL (unintentionally) changed these bits in the 3.0.0 and subsequent 3.x releases, setting them to zero in the release versions (which happened to also match the documentation), then changed them back in the 3.5.3 release. If OpenSSL was upgraded to (or from) this version without recompiling OpenSSH, it would cause OpenSSH flag it as potentially incompatible and refuse to use it. Ultimately OpenSSL rolled this back, but the check now has no value so is being removed for OpenSSL versions >=3. bz#3865 and openssl/openssl#28575, ok djm@
1 parent 35f3e2a commit e914e61

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

openbsd-compat/openssl-compat.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
#include "openssl-compat.h"
3333

3434
/*
35-
* OpenSSL version numbers: MNNFFPPS: major minor fix patch status
35+
* OpenSSL version numbers: MNNFFPPS: major minor fix patch status.
36+
* See the OpenSSL_version_num(3ssl) man page.
3637
* Versions >=3 require only major versions to match.
3738
* For versions <3, we accept compatible fix versions (so we allow 1.0.1
3839
* to work with 1.0.0). Going backwards is only allowed within a patch series.
@@ -49,10 +50,10 @@ ssh_compatible_openssl(long headerver, long libver)
4950
return 1;
5051

5152
/*
52-
* For versions >= 3.0, only the major and status must match.
53+
* For versions >= 3.0, only the major must match.
5354
*/
54-
if (headerver >= 0x3000000f) {
55-
mask = 0xf000000fL; /* major,status */
55+
if (headerver >= 0x30000000) {
56+
mask = 0xf0000000L; /* major only */
5657
return (headerver & mask) == (libver & mask);
5758
}
5859

0 commit comments

Comments
 (0)