mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-23 20:03:31 +01:00
Improve openssl_version tests with better messages
These tests would report errors, but wouldn't report the offending strings.
This commit is contained in:
parent
943291d7ae
commit
8483241b4e
4
changes/bug26152
Normal file
4
changes/bug26152
Normal file
@ -0,0 +1,4 @@
|
||||
o Minor bugfixes (testing):
|
||||
- When logging a version mismatch in our openssl_version tests,
|
||||
report the actual offending version strings. Fixes bug 26152; bugfix on
|
||||
0.2.9.1-alpha.
|
@ -152,8 +152,13 @@ test_crypto_openssl_version(void *arg)
|
||||
const char *h_version = crypto_openssl_get_header_version_str();
|
||||
tt_assert(version);
|
||||
tt_assert(h_version);
|
||||
tt_assert(!strcmpstart(version, h_version)); /* "-fips" suffix, etc */
|
||||
tt_assert(!strstr(version, "OpenSSL"));
|
||||
if (strcmpstart(version, h_version)) { /* "-fips" suffix, etc */
|
||||
TT_DIE(("OpenSSL library version %s did not begin with header version %s.",
|
||||
version, h_version));
|
||||
}
|
||||
if (strstr(version, "OpenSSL")) {
|
||||
TT_DIE(("assertion failed: !strstr(\"%s\", \"OpenSSL\")", version));
|
||||
}
|
||||
int a=-1,b=-1,c=-1;
|
||||
if (!strcmpstart(version, "LibreSSL") || !strcmpstart(version, "BoringSSL"))
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user