Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1515236 - Centralize a SSLKEYLOGFILE enable/disable flag at build…
….sh r=mt

--HG--
extra : absorb_source : 9a0c6bc1834c59df56780b28f614c2533b247854
extra : transplant_source : %90f%9D0%E0%0F%1C%CB%AB%CF%00z%26x%BF%B0%89%5B%09f
  • Loading branch information
jcjones committed Jan 24, 2019
1 parent 62e5324 commit e76a339
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
4 changes: 4 additions & 0 deletions build.sh
Expand Up @@ -50,6 +50,7 @@ fuzz=0
fuzz_tls=0
fuzz_oss=0
no_local_nspr=0
sslkeylogfile=1

gyp_params=(--depth="$cwd" --generator-output=".")
ninja_params=()
Expand Down Expand Up @@ -103,6 +104,7 @@ while [ $# -gt 0 ]; do
--enable-fips) gyp_params+=(-Ddisable_fips=0) ;;
--enable-libpkix) gyp_params+=(-Ddisable_libpkix=0) ;;
--mozpkix-only) gyp_params+=(-Dmozpkix_only=1 -Ddisable_tests=1 -Dsign_libs=0) ;;
--disable-keylog) sslkeylogfile=0 ;;
*) show_help; exit 2 ;;
esac
shift
Expand All @@ -116,6 +118,8 @@ else
target=Debug
fi

gyp_params+=(-Denable_sslkeylogfile="$sslkeylogfile")

# Do special setup.
if [ "$fuzz" = 1 ]; then
source "$cwd"/coreconf/fuzz.sh
Expand Down
10 changes: 8 additions & 2 deletions gtests/ssl_gtest/ssl_gtest.gyp
Expand Up @@ -33,7 +33,6 @@
'ssl_gather_unittest.cc',
'ssl_gtest.cc',
'ssl_hrr_unittest.cc',
'ssl_keylog_unittest.cc',
'ssl_keyupdate_unittest.cc',
'ssl_loopback_unittest.cc',
'ssl_misc_unittest.cc',
Expand Down Expand Up @@ -92,6 +91,14 @@
'<(DEPTH)/lib/dbm/src/src.gyp:dbm',
],
}],
[ 'enable_sslkeylogfile==1', {
'sources': [
'ssl_keylog_unittest.cc',
],
'defines': [
'NSS_ALLOW_SSLKEYLOGFILE',
],
}],
],
}
],
Expand All @@ -101,7 +108,6 @@
],
'defines': [
'NSS_USE_STATIC_LIBS',
'NSS_ALLOW_SSLKEYLOGFILE=1',
],
},
'variables': {
Expand Down
4 changes: 0 additions & 4 deletions gtests/ssl_gtest/ssl_keylog_unittest.cc
Expand Up @@ -4,8 +4,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifdef NSS_ALLOW_SSLKEYLOGFILE

#include <cstdlib>
#include <fstream>
#include <sstream>
Expand Down Expand Up @@ -164,5 +162,3 @@ INSTANTIATE_TEST_CASE_P(
#endif

} // namespace nss_test

#endif // NSS_ALLOW_SSLKEYLOGFILE
2 changes: 2 additions & 0 deletions help.txt
Expand Up @@ -51,3 +51,5 @@ NSS build tool options:
--enable-libpkix make libpkix part of the build
--mozpkix-only build only static mozpkix and mozpkix-test libraries
support for this build option is limited
--disable-keylog enable support for logging key data to a file specified
by the SSLKEYLOGFILE environment variable
10 changes: 5 additions & 5 deletions lib/ssl/ssl.gyp
Expand Up @@ -73,6 +73,11 @@
'-std=gnu99',
],
}],
[ 'enable_sslkeylogfile==1', {
'defines': [
'NSS_ALLOW_SSLKEYLOGFILE',
],
}],
],
'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports',
Expand All @@ -92,11 +97,6 @@
}
}
],
'target_defaults': {
'defines': [
'NSS_ALLOW_SSLKEYLOGFILE=1'
]
},
'variables': {
'module': 'nss'
}
Expand Down

0 comments on commit e76a339

Please sign in to comment.