[BACK]Return to version.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / openssl

Diff for /src/usr.bin/openssl/version.c between version 1.10 and 1.11

version 1.10, 2022/11/11 17:07:39 version 1.11, 2023/03/06 14:32:06
Line 142 
Line 142 
         int options;          int options;
         int platform;          int platform;
         int version;          int version;
 } version_config;  } cfg;
   
 static int  static int
 version_all_opts(void)  version_all_opts(void)
 {  {
         version_config.cflags = 1;          cfg.cflags = 1;
         version_config.date = 1;          cfg.date = 1;
         version_config.dir= 1;          cfg.dir= 1;
         version_config.options = 1;          cfg.options = 1;
         version_config.platform = 1;          cfg.platform = 1;
         version_config.version = 1;          cfg.version = 1;
   
         return (0);          return (0);
 }  }
Line 168 
Line 168 
                 .name = "b",                  .name = "b",
                 .desc = "Date the current version of OpenSSL was built",                  .desc = "Date the current version of OpenSSL was built",
                 .type = OPTION_FLAG,                  .type = OPTION_FLAG,
                 .opt.flag = &version_config.date,                  .opt.flag = &cfg.date,
         },          },
         {          {
                 .name = "d",                  .name = "d",
                 .desc = "OPENSSLDIR value",                  .desc = "OPENSSLDIR value",
                 .type = OPTION_FLAG,                  .type = OPTION_FLAG,
                 .opt.flag = &version_config.dir,                  .opt.flag = &cfg.dir,
         },          },
         {          {
                 .name = "f",                  .name = "f",
                 .desc = "Compilation flags",                  .desc = "Compilation flags",
                 .type = OPTION_FLAG,                  .type = OPTION_FLAG,
                 .opt.flag = &version_config.cflags,                  .opt.flag = &cfg.cflags,
         },          },
         {          {
                 .name = "o",                  .name = "o",
                 .desc = "Option information",                  .desc = "Option information",
                 .type = OPTION_FLAG,                  .type = OPTION_FLAG,
                 .opt.flag = &version_config.options,                  .opt.flag = &cfg.options,
         },          },
         {          {
                 .name = "p",                  .name = "p",
                 .desc = "Platform settings",                  .desc = "Platform settings",
                 .type = OPTION_FLAG,                  .type = OPTION_FLAG,
                 .opt.flag = &version_config.platform,                  .opt.flag = &cfg.platform,
         },          },
         {          {
                 .name = "v",                  .name = "v",
                 .desc = "Current OpenSSL version",                  .desc = "Current OpenSSL version",
                 .type = OPTION_FLAG,                  .type = OPTION_FLAG,
                 .opt.flag = &version_config.version,                  .opt.flag = &cfg.version,
         },          },
         {NULL},          {NULL},
 };  };
Line 218 
Line 218 
                 exit(1);                  exit(1);
         }          }
   
         memset(&version_config, 0, sizeof(version_config));          memset(&cfg, 0, sizeof(cfg));
   
         if (options_parse(argc, argv, version_options, NULL, NULL) != 0) {          if (options_parse(argc, argv, version_options, NULL, NULL) != 0) {
                 version_usage();                  version_usage();
Line 226 
Line 226 
         }          }
   
         if (argc == 1)          if (argc == 1)
                 version_config.version = 1;                  cfg.version = 1;
   
         if (version_config.version) {          if (cfg.version) {
                 if (SSLeay() == SSLEAY_VERSION_NUMBER) {                  if (SSLeay() == SSLEAY_VERSION_NUMBER) {
                         printf("%s\n", SSLeay_version(SSLEAY_VERSION));                          printf("%s\n", SSLeay_version(SSLEAY_VERSION));
                 } else {                  } else {
Line 237 
Line 237 
                             SSLeay_version(SSLEAY_VERSION));                              SSLeay_version(SSLEAY_VERSION));
                 }                  }
         }          }
         if (version_config.date)          if (cfg.date)
                 printf("%s\n", SSLeay_version(SSLEAY_BUILT_ON));                  printf("%s\n", SSLeay_version(SSLEAY_BUILT_ON));
         if (version_config.platform)          if (cfg.platform)
                 printf("%s\n", SSLeay_version(SSLEAY_PLATFORM));                  printf("%s\n", SSLeay_version(SSLEAY_PLATFORM));
         if (version_config.options) {          if (cfg.options) {
                 printf("options:  ");                  printf("options:  ");
                 printf("%s ", BN_options());                  printf("%s ", BN_options());
 #ifndef OPENSSL_NO_RC4  #ifndef OPENSSL_NO_RC4
Line 258 
Line 258 
 #endif  #endif
                 printf("\n");                  printf("\n");
         }          }
         if (version_config.cflags)          if (cfg.cflags)
                 printf("%s\n", SSLeay_version(SSLEAY_CFLAGS));                  printf("%s\n", SSLeay_version(SSLEAY_CFLAGS));
         if (version_config.dir)          if (cfg.dir)
                 printf("%s\n", SSLeay_version(SSLEAY_DIR));                  printf("%s\n", SSLeay_version(SSLEAY_DIR));
   
         return (0);          return (0);

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11