Bug 1562952 - #ifdef-out NSS and certificate-related flags with NO_SIGN_VERIFY. r=rstrong
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 10 Jul 2019 15:17:53 +0000
changeset 482338 250696e18e7dc5dddb48a0f00d2221f9d5cdf2b9
parent 482337 0c076622290967834426f37e4e557f1f475c7250
child 482339 6b09d4c0868ca40fb9bcfb828713a7cd60b1be5c
push id89703
push usermh@glandium.org
push dateThu, 11 Jul 2019 06:09:59 +0000
treeherderautoland@6b09d4c0868c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong
bugs1562952
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1562952 - #ifdef-out NSS and certificate-related flags with NO_SIGN_VERIFY. r=rstrong Differential Revision: https://phabricator.services.mozilla.com/D36991
modules/libmar/tool/mar.c
--- a/modules/libmar/tool/mar.c
+++ b/modules/libmar/tool/mar.c
@@ -119,26 +119,25 @@ static int mar_test(const char* path) {
   printf("SIZE\tMODE\tNAME\n");
   mar_enum_items(mar, mar_test_callback, NULL);
 
   mar_close(mar);
   return 0;
 }
 
 int main(int argc, char** argv) {
-  char* NSSConfigDir = NULL;
   const char* certNames[MAX_SIGNATURES];
   char* MARChannelID = MAR_CHANNEL_ID;
   char* productVersion = MOZ_APP_VERSION;
+  int rv = -1;
+#if !defined(NO_SIGN_VERIFY)
+  char* NSSConfigDir = NULL;
   uint32_t k;
-  int rv = -1;
   uint32_t certCount = 0;
   int32_t sigIndex = -1;
-
-#if !defined(NO_SIGN_VERIFY)
   uint32_t fileSizes[MAX_SIGNATURES];
   const uint8_t* certBuffers[MAX_SIGNATURES];
 #  if ((!defined(MAR_NSS) && defined(XP_WIN)) || defined(XP_MACOSX)) || \
       ((defined(XP_WIN) || defined(XP_MACOSX)) && !defined(MAR_NSS))
   char* DERFilePaths[MAX_SIGNATURES];
 #  endif
 #  if (!defined(XP_WIN) && !defined(XP_MACOSX)) || defined(MAR_NSS)
   CERTCertificate* certs[MAX_SIGNATURES];
@@ -176,18 +175,18 @@ int main(int argc, char** argv) {
     }
     if (argv[1][0] == '-' && argv[1][1] == 'C') {
       if (chdir(argv[2]) != 0) {
         return -1;
       }
       argv += 2;
       argc -= 2;
     }
-#if !defined(NO_SIGN_VERIFY) && \
-    ((!defined(MAR_NSS) && defined(XP_WIN)) || defined(XP_MACOSX))
+#if !defined(NO_SIGN_VERIFY)
+#if (!defined(MAR_NSS) && defined(XP_WIN)) || defined(XP_MACOSX)
     /* -D DERFilePath, also matches -D[index] DERFilePath
        We allow an index for verifying to be symmetric
        with the import and export command line arguments. */
     else if (argv[1][0] == '-' && argv[1][1] == 'D' &&
              (argv[1][2] == (char)('0' + certCount) || argv[1][2] == '\0')) {
       if (certCount >= MAX_SIGNATURES) {
         print_usage();
         return -1;
@@ -218,17 +217,19 @@ int main(int argc, char** argv) {
           argv[1][2] >= '0' && argv[1][2] <= '9') {
         sigIndex = argv[1][2] - '0';
         argv++;
         argc--;
       } else {
         argv += 2;
         argc -= 2;
       }
-    } else if (argv[1][0] == '-' && argv[1][1] == 'H') {  // MAR channel ID
+    }
+#endif
+    else if (argv[1][0] == '-' && argv[1][1] == 'H') {  // MAR channel ID
       MARChannelID = argv[2];
       argv += 2;
       argc -= 2;
     } else if (argv[1][0] == '-' && argv[1][1] == 'V') {  // Product Version
       productVersion = argv[2];
       argv += 2;
       argc -= 2;
     } else {